Search.../

onOrderStartDateChanged( )

Developer Preview

Triggered when an order's startDate is changed.

Syntax

function wixPricingPlans_onOrderStartDateChanged(event: OrderStartDateChangedEvent): void

onOrderStartDateChanged Parameters

NAME
TYPE
DESCRIPTION
event
Optional
OrderStartDateChangedEvent

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

onOrderStartDateChanged 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_onOrderStartDateChanged(event) {
6 const orderId = event.data.order._id;
7 const buyerContactId = event.data.buyer.contactId;
8 const startDate = event.startDate;
9
10 console.log(`Start date for order ID ${orderId} was changed to ${startDate} by contact ID ${buyerContactId}. Full event object:`, event);
11}
12
13/* Full event object:
14 * {
15 * "data": {
16 * "order": {
17 * "_createdDate": "2024-02-14T11:15:57.921Z",
18 * "_id": "a15b2fdf-f21c-4d3e-bae2-12a344cc4cad",
19 * "_updatedDate": "2024-02-14T11:16:45.641Z",
20 * "buyer": {
21 * "contactId": "600e2577-6414-42a5-b35b-839e166eaf5a",
22 * "memberId": "600e2577-6414-42a5-b35b-839e166eaf5a"
23 * },
24 * "cycles": [
25 * {
26 * "index": 1,
27 * "startedDate": "2024-02-16T22:00:00.000Z"
28 * }
29 * ],
30 * "formData": {
31 * "submissionData": {}
32 * },
33 * "lastPaymentStatus": "UNPAID",
34 * "orderMethod": "UNKNOWN",
35 * "pausePeriods": [],
36 * "planDescription": "Full feature enablement - lifetime plan",
37 * "planId": "e901222b-c137-4bc7-adc3-c1efa3c880a2",
38 * "planName": "Quality Plan - Lifetime",
39 * "planPrice": "1500",
40 * "priceDetails": {
41 * "currency": "USD",
42 * "discount": "0",
43 * "planPrice": "1500",
44 * "subtotal": "1500.00",
45 * "tax": {
46 * "amount": "97.50",
47 * "includedInPrice": false,
48 * "name": "Tax",
49 * "rate": "6.5"
50 * },
51 * "total": "1597.50"
52 * },
53 * "pricing": {
54 * "prices": [
55 * {
56 * "duration": {
57 * "cycleFrom": 1,
58 * "numberOfCycles": 1
59 * },
60 * "price": {
61 * "currency": "USD",
62 * "discount": "0",
63 * "fees": [],
64 * "proration": "0",
65 * "subtotal": "1500.00",
66 * "tax": {
67 * "amount": "97.50",
68 * "includedInPrice": false,
69 * "name": "Tax",
70 * "rate": "6.5"
71 * },
72 * "total": "1597.50"
73 * }
74 * }
75 * ],
76 * "singlePaymentUnlimited": true
77 * },
78 * "startDate": "2024-02-16T22:00:00.000Z",
79 * "status": "DRAFT",
80 * "statusNew": "DRAFT",
81 * "subscriptionId": "78933e41-6482-4545-a7e0-483ec74cfa97",
82 * "type": "ONLINE",
83 * "wixPayOrderId": "97aa019c-13f2-4e2a-a8a2-62cd9ffa6ef0"
84 * }
85 * },
86 * "metadata": {
87 * "entityId": "a15b2fdf-f21c-4d3e-bae2-12a344cc4cad",
88 * "eventTime": "2024-02-14T11:16:45.787406262Z",
89 * "id": "05924d5a-5f1e-4f9a-ba77-f3a784661d41",
90 * "triggeredByAnonymizeRequest": false
91 * }
92 * }
93 */