pauseOrder( )
Pauses a pricing plans order.
Description
The pauseOrder()
function returns a Promise that resolves when the order is successfully paused.
For orders with recurring payments, pauseOrder()
also pauses the payment schedule. Buyers are not
charged when an order is paused. Use pauseOrder()
, for example, if the buyer is away and would
like to put their pricing plan membership on hold until they return. Pausing an order affects the
end date of the order by adding the time the order is paused to the endDate
. Can only pause orders
with an ACTIVE
status.
Pausing an order causes the following changes:
- The order status changes to
"PAUSED"
. - The
pausePeriods
array is updated.
The endDate
and the earliestEndDate
for the order are adjusted to include the pause period when the order is resumed.
The onOrderPaused()
and onOrderUpdated()
event handlers run when an order is paused.
Paused orders can be continued with the resumeOrder()
function.
Note: Only site visitors with the Manage Pricing Plans and Manage Subscriptions permissions can pause orders. You can override the permissions by setting the function's
suppressAuth
option totrue
.
Syntax
function pauseOrder(orderId: string, [options: Options]): Promise<void>
pauseOrder Parameters
NAME
TYPE
DESCRIPTION
ID of the order being paused.
Options to use when pausing an order.
Returns
Fulfilled - When the order is paused.
Return Type:
Related Content:
Was this helpful?
1import { orders } from 'wix-pricing-plans-backend';23// Sample orderId value: '19b28b41-1ef2-42dc-afaa-9dc1854d0191'45export async function myPauseOrderFunction(orderId) {6 try {7 const order = await orders.pauseOrder(orderId);89 return order;10 } catch (error) {11 console.error(error);12 }13}1415// Returns a promise that resolves to void
1import { orders } from 'wix-pricing-plans-backend';23/* Sample orderId value: '895fd8d9-f732-444f-a82b-19f7e55e9617'4 *5 * Sample options object:6 * {7 * suppressAuth : true8 * }9 */1011export async function myPauseOrderWithOptionsFunction(orderId, options) {12 try {13 const order = await orders.pauseOrder(orderId, options);1415 return order;16 } catch (error) {17 console.error(error);18 }19}2021// Returns a promise that resolves to void