> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: pauseOrder(_id: string) # Method package: wixPricingPlansV2 # Method menu location: wixPricingPlansV2 --> orders --> pauseOrder # Method Link: https://dev.wix.com/docs/velo/apis/wix-pricing-plans-v2/orders/pause-order.md # Method Description: Pauses an order. Calling this method changes the order status to `"PAUSED"` and updates the `pausePeriods` array. Only orders with `status`: `ACTIVE` can be paused. For orders with recurring payments, it also pauses the payment schedule. Buyers are not charged when an order is paused. Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`. The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed. To resume a paused order, call Resume Order. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Pause a pricing plan order (dashboard page code) ```javascript import { orders } from 'wix-pricing-plans.v2'; import { elevate } from 'wix-auth'; /* Sample _id value: '9af3cbe6-fe27-4fdb-a0b0-892289b03d22' */ const elevatedPauseOrder = elevate(orders.pauseOrder); export async function myPauseOrderFunction(_id) { try { await elevatedPauseOrder(_id); return; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to void */ ``` ## Pause a pricing plan order (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { orders } from 'wix-pricing-plans.v2'; import { elevate } from 'wix-auth'; // Sample _id value: '9af3cbe6-fe27-4fdb-a0b0-892289b03d22' const elevatedPauseOrder = elevate(orders.pauseOrder); export const myPauseOrderFunction = webMethod(Permissions.Anyone, async (_id) => { try { await elevatedPauseOrder(_id); return; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to void */ ``` ## Cancel or pause a member order ```javascript /******************************* * Backend code - order.web.js * ********************************/ import { Permissions, webMethod } from 'wix-web-module'; import { orders } from 'wix-pricing-plans.v2'; import { elevate } from 'wix-auth'; const elevatedPauseOrder = elevate(orders.pauseOrder); export const listCurrentMemberOrders = webMethod( Permissions.Anyone, async (orderStatuses) => { try { const result = await orders.memberListOrders(orderStatuses); return result; } catch (error) { console.error(error); // Handle the error } }); export const requestCancellation = webMethod( Permissions.Anyone, async (orderId) => { const effectiveAt = 'NEXT_PAYMENT_DATE'; try { await orders.requestCancellation(orderId, effectiveAt) ; return; } catch (error) { console.error(error); // Handle the error } }); export const pauseOrder = webMethod( Permissions.Anyone, async (orderId) => { try { await elevatedPauseOrder(orderId); return; } catch (error) { console.error(error); // Handle the error } }); /************* * Page code * *************/ import { listCurrentMemberOrders, requestCancellation, pauseOrder } from 'backend/order.web'; $w.onReady(function () { // Disabe UI elements on page load $w('#requestCancelOrderBtn').disable(); $w('#pauseOrderBtn').disable(); $w('#ordersDropdown').disable(); let selectedOrderId; populateOrdersDropdown(); $w('#ordersDropdown').onChange( () => { selectedOrderId = $w('#ordersDropdown').value; $w('#requestCancelOrderBtn').enable(); $w('#pauseOrderBtn').enable(); }); $w('#requestCancelOrderBtn').onClick(async () => { await requestCancellation(selectedOrderId); }); $w('#pauseOrderBtn').onClick(async () => { await pauseOrder(selectedOrderId); }); }); async function populateOrdersDropdown() { const activeOrdersList = await listCurrentMemberOrders({orderStatuses: 'ACTIVE'}); $w('#ordersDropdown').options = activeOrdersList.orders.map((order) => { return { label: order.planName, value: order._id } }); $w('#ordersDropdown').enable(); } ``` ---