Search.../

onOrderEndDatePostponed( )

Developer Preview

Triggered when an order's endDate is postponed.

Syntax

function wixPricingPlans_onOrderEndDatePostponed(event: OrderEndDatePostponedEvent): void

onOrderEndDatePostponed Parameters

NAME
TYPE
DESCRIPTION
event
Optional
OrderEndDatePostponedEvent

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

onOrderEndDatePostponed example

Copy Code
1// Place this code in the events.js file
2// of your site's Backend section.
3// Add the file if it doesn't exist.
4
5export function wixPricingPlans_onOrderEndDatePostponed(event) {
6 const orderId = event.data.order._id;
7 const buyerContactId = event.data.buyer.contactId;
8 const planId = event.data.planId;
9
10 console.log(`Order ID of ${orderId} was postponed for plan ID ${planId} for buyer contact ID ${buyerContactId}. Full event object:`, event);
11}
12
13/* Full event object:
14 * {
15 * "data": {
16 * "order": {
17 * "_createdDate": "2024-01-28T09:49:21.041Z",
18 * "_id": "82d99338-5653-459a-a751-b57483f7cfb5",
19 * "_updatedDate": "2024-02-07T13:22:47.459Z",
20 * "autoRenewCanceled": true,
21 * "buyer": {
22 * "contactId": "554c9e11-f4d8-4579-ac3a-a17f7e6cb0b4",
23 * "memberId": "554c9e11-f4d8-4579-ac3a-a17f7e6cb0b4"
24 * },
25 * "cancellation": {
26 * "cause": "OWNER_ACTION",
27 * "effectiveAt": "NEXT_PAYMENT_DATE"
28 * },
29 * "currentCycle": {
30 * "endedDate": "2024-04-27T09:49:21.041Z",
31 * "index": 0,
32 * "startedDate": "2024-01-28T09:49:21.041Z"
33 * },
34 * "cycles": [
35 * {
36 * "endedDate": "2024-04-27T09:49:21.041Z",
37 * "index": 0,
38 * "startedDate": "2024-01-28T09:49:21.041Z"
39 * }
40 * ],
41 * "endDate": "2024-04-27T09:49:21.041Z",
42 * "earliestEndDate": "2026-04-27T09:49:21.041Z",
43 * "formData": {
44 * "submissionData": {}
45 * },
46 * "freeTrialDays": 90,
47 * "orderMethod": "UNKNOWN",
48 * "pausePeriods": [],
49 * "planDescription": "3 mo free trial with discount for 1 year",
50 * "planId": "cb4a8c57-273a-4567-94e3-cc43d5d339f2",
51 * "planName": "Beginner's Plan",
52 * "planPrice": "50",
53 * "priceDetails": {
54 * "currency": "USD",
55 * "discount": "0",
56 * "fees": [],
57 * "freeTrialDays": 90,
58 * "planPrice": "50",
59 * "subtotal": "50.00",
60 * "total": "50.00",
61 * "subscription": {
62 * "cycleCount": 2,
63 * "cycleDuration": {
64 * "count": 1,
65 * "unit": "YEAR"
66 * }
67 * }
68 * },
69 * "pricing": {
70 * "prices": [
71 * {
72 * "duration": {
73 * "cycleFrom": 1,
74 * "numberOfCycles": 2
75 * },
76 * "price": {
77 * "currency": "USD",
78 * "discount": "0",
79 * "fees": [],
80 * "proration": "0",
81 * "subtotal": "50.00",
82 * "total": "50.00"
83 * }
84 * }
85 * ],
86 * "subscription": {
87 * "cycleCount": 2,
88 * "cycleDuration": {
89 * "count": 1,
90 * "unit": "YEAR"
91 * }
92 * }
93 * },
94 * "startDate": "2024-01-28T09:49:21.041Z",
95 * "status": "ACTIVE",
96 * "statusNew": "ACTIVE",
97 * "subscriptionId": "305f8fc9-3724-4cac-9f67-4e29f2c46def",
98 * "type": "OFFLINE",
99 * "wixPayOrderId": "2f0e79d8-f15d-46c6-ac1a-10ec7a2030fb"
100 * }
101 * },
102 * "metadata": {
103 * "entityId": "82d99338-5653-459a-a751-b57483f7cfb5",
104 * "eventTime": "2024-02-07T13:22:47.641175778Z",
105 * "id": "ef926c78-1c7a-4ffd-a8c4-fa59bdcf09c1",
106 * "triggeredByAnonymizeRequest": false
107 * }
108 * }
109 */
110