Search...
resumeOrder( )
Resumes a paused pricing plan order.
Description
The resumeOrder()
function returns a Promise that resolves when a paused order is successfully resumed.
For orders with recurring payments, resumeOrder()
also restarts the payment schedule.
Resuming an order causes the following changes:
- The order status changes to
"ACTIVE"
. - The
pausePeriods
array is updated. - The
endDate
for the order is adjusted to include the pause period. - The
earliestEndDate
is adjusted to include the pause period. This property is reserved for future use.
The onOrderResumed()
and onOrderUpdated()
event handlers run when an order is resumed.
Note: Only site visitors with the Manage Pricing Plans and Manage Subscriptions permissions can resume orders. You can override the permissions by setting the function's
suppressAuth
option totrue
.
Syntax
function resumeOrder(orderId: string, [options: Options]): Promise<void>
resumeOrder Parameters
NAME
TYPE
DESCRIPTION
orderId
string
ID of the order being resumed.
options
Optional
Options
Options to use when resuming an order.
Returns
Fulfilled - When the order is resumed.
Return Type:
Promise<void>
Related Content:
Was this helpful?
Resume a paused order
Copy Code
1import { orders } from 'wix-pricing-plans-backend';23// Sample orderId value: '19b28b41-1ef2-42dc-afaa-9dc1854d0191'45export async function myResumeOrderFunction(orderId) {6 try {7 const order = await orders.resumeOrder(orderId);89 return order;10 } catch (error) {11 console.error(error);12 }13}1415// Returns a promise that resolves to void
Resume a paused order, bypassing permission checks
Copy Code
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 myResumeOrderWithOptionsFunction(orderId, options) {12 try {13 const order = await orders.resumeOrder(orderId, options);1415 return order;16 } catch (error) {17 console.error(error);18 }19}2021// Returns a promise that resolves to void