Search...
onOrderResumed( )
An event that triggers when an order resumes.
Description
The onOrderResumed()
event handler runs when an order resumes.
The received OrderResumedEvent
object contains information about the order that is resumed.
Note: Backend events don't work when previewing your site.
Syntax
function onOrderResumed(event: OrderResumedEvent): void
onOrderResumed Parameters
NAME
TYPE
DESCRIPTION
event
OrderResumedEvent
Information about the order that is resumed and metadata for the event.
Returns
This function does not return anything.
Return Type:
void
Was this helpful?
An event triggered when an order resumes
Copy Code
1// Place this code in the events.js file2// of your site's Backend section.3// Add the file if it doesn't exist.45export function wixPricingPlans_onOrderResumed(event) {6 const orderId = event.data.order._id;7 const eventId = event.metadata.id;8 const eventTime = event.metadata.eventTime;9}1011/* Full event object:12 * {13 * "metadata": {14 * "id":"1bae9a9d-814d-41c3-b329-b40120302494",15 * "entityId":"066da054-3a62-4629-be0c-055ff5278f54",16 * "eventTime":"2022-07-26T15:45:28.557397Z",17 * "triggeredByAnonymizeRequest":false18 * },19 * "data": {20 * "order": {21 * "_id":"066da054-3a62-4629-be0c-055ff5278f54",22 * "planId":"099e2c86-3b7e-4477-8c27-f77402b8cceb",23 * "subscriptionId":"f30ad1c0-604f-4542-93e3-22b174159eac",24 * "wixPayOrderId":"ee63dd97-3250-4fb9-afec-807d074bb682",25 * "buyer": {26 * "memberId":"ea3d74df-b7dc-4ca1-a7c9-c416b9017a86",27 * "contactId":"ea3d74df-b7dc-4ca1-a7c9-c416b9017a86"28 * },29 * "priceDetails": {30 * "subtotal":"74.99",31 * "discount":"0",32 * "total":"74.99",33 * "planPrice":"74.99",34 * "currency":"EUR",35 * "subscription": {36 * "cycleDuration": {37 * "count":1,38 * "unit":"MONTH"39 * },40 * "cycleCount":341 * }},42 * "pricing": {43 * "subscription": {44 * "cycleDuration": {45 * "count":1,46 * "unit":"MONTH"47 * },48 * "cycleCount":349 * },50 * "prices": [{51 * "duration": {52 * "cycleFrom":1,53 * "numberOfCycles":354 * },55 * "price": {56 * "subtotal":"74.99",57 * "discount":"0",58 * "total":"74.99",59 * "currency":"EUR"60 * }61 * }]},62 * "type":"OFFLINE",63 * "orderMethod":"UNKNOWN",64 * "status":"ACTIVE",65 * "autoRenewCanceled":false,66 * "lastPaymentStatus":"PAID",67 * "startDate":"2022-07-26T14:14:36.346Z",68 * "endDate":"2022-10-26T14:14:47.395Z",69 * "pausePeriods": [{70 * "status":"ENDED",71 * "pauseDate":"2022-07-26T15:45:17.391Z",72 * "resumeDate":"2022-07-26T15:45:28.440Z"73 * }],74 * "earliestEndDate":"2022-10-26T14:14:47.395Z",75 * "currentCycle":{"index":1,76 * "startedDate":"2022-07-26T14:14:36.346Z",77 * "endedDate":"2022-08-26T14:14:47.395Z"78 * },79 * "planName":"Platinum Pro",80 * "planDescription":"",81 * "planPrice":"74.99",82 * "_createdDate":"2022-07-26T14:14:36.346Z",83 * "_updatedDate":"2022-07-26T15:45:17.391Z"84 * }85 * }86 * }87 */