Search...
onOrderEndDatePostponed( )
An event that triggers when the endDate
of an order is postponed or made earlier.
Description
The onOrderEndDatePostponed()
event handler runs when an order is postponed or made earlier.
The received OrderEndDatePostponedEvent
object contains information about the order that was postponed.
Note: Backend events don't work when previewing your site.
Syntax
function onOrderEndDatePostponed(event: OrderEndDatePostponedEvent): void
onOrderEndDatePostponed Parameters
NAME
TYPE
DESCRIPTION
event
OrderEndDatePostponedEvent
Information about the order that is postponed and metadata for the event.
Returns
This function does not return anything.
Return Type:
void
Was this helpful?
An event triggered when an order is postponed or made earlier
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_onOrderEndDatePostponed(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":"e10b1220-8380-41c4-9f13-853ed4736f5a",15 * "entityId":"1601de9d-c6ff-494e-a6b7-b84e99b178bb",16 * "eventTime":"2022-07-26T16:01:13.138635Z",17 * "triggeredByAnonymizeRequest":false18 * },19 * "data": {20 * "order": {21 * "_id":"1601de9d-c6ff-494e-a6b7-b84e99b178bb",22 * "planId":"2900552c-012f-43c9-b724-90503d273a4d",23 * "subscriptionId":"f0899480-1b5a-4b91-aa5f-28ad6a5058e9",24 * "buyer": {25 * "memberId":"c3d92519-3488-49b5-8ad5-c411ef52d833",26 * "contactId":"c3d92519-3488-49b5-8ad5-c411ef52d833"27 * },28 * "priceDetails": {29 * "subtotal":"0",30 * "discount":"0",31 * "total":"0",32 * "planPrice":"0",33 * "currency":"EUR",34 * "singlePaymentForDuration": {35 * "count":6,36 * "unit":"MONTH"37 * }},38 * "pricing": {39 * "singlePaymentForDuration": {40 * "count":6,"unit":"MONTH"41 * },42 * "prices": [{43 * "duration": {44 * "cycleFrom":1,45 * "numberOfCycles":146 * },47 * "price": {48 * "subtotal":"0",49 * "discount":"0",50 * "total":"0",51 * "currency":"EUR"52 * }53 * }]},54 * "type":"OFFLINE",55 * "orderMethod":"UNKNOWN",56 * "status":"ACTIVE",57 * "lastPaymentStatus":"NOT_APPLICABLE",58 * "startDate":"2022-07-02T16:23:00.000Z",59 * "endDate":"2023-01-04T16:23:00.000Z",60 * "pausePeriods":[],61 * "earliestEndDate":"2023-01-02T16:23:00.000Z",62 * "currentCycle": {63 * "index":1,64 * "startedDate":"2022-07-02T16:23:00.000Z",65 * "endedDate":"2023-01-04T16:23:00.000Z"66 * },67 * "planName":"Free, 6 Months",68 * "planDescription":"",69 * "planPrice":"0",70 * "_createdDate":"2022-07-13T20:37:06.543Z",71 * "_updatedDate":"2022-07-26T16:01:13.029Z"72 * }73 * }74 * }75 */