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 { Permissions, webMethod } from 'wix-web-module';2import { orders } from 'wix-pricing-plans-backend';34// Sample orderId value: '19b28b41-1ef2-42dc-afaa-9dc1854d0191'56export const myResumeOrderFunction = webMethod(Permissions.Anyone, async (orderId) => {7 try {8 const order = await orders.resumeOrder(orderId);910 return order;11 } catch (error) {12 console.error(error);13 }14});1516// Returns a promise that resolves to void
Resume a paused order, bypassing permission checks
Copy Code
1import { Permissions, webMethod } from 'wix-web-module';2import { orders } from 'wix-pricing-plans-backend';34/* Sample orderId value: '895fd8d9-f732-444f-a82b-19f7e55e9617'5 *6 * Sample options object:7 * {8 * suppressAuth : true9 * }10 */1112export const myResumeOrderWithOptionsFunction = webMethod(Permissions.Anyone, async (orderId, options) => {13 try {14 const order = await orders.resumeOrder(orderId, options);1516 return order;17 } catch (error) {18 console.error(error);19 }20});2122// Returns a promise that resolves to void