> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: onOrderCycleStarted(event: OrderCycleStartedEvent) # Method package: wixPricingPlansV2 # Method menu location: wixPricingPlansV2 --> onOrderCycleStarted # Method Link: https://dev.wix.com/docs/velo/events-service-plugins/pricing-plans/events/on-order-cycle-started.md # Method Description: Triggered at the start of a new payment cycle for an existing order. Not triggered at the initial start of an offline order. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## onOrderCycleStarted example ```javascript // Place this code in the events.js file // of your site's Backend section. // Add the file if it doesn't exist. export function wixPricingPlans_onOrderCycleStarted(event) { const orderId = event.data.order._id; const transactionId = event.data.transactionId; const eventTime = event.metadata.eventTime; console.log(`Order ID ${orderId} has started its order cycle with transaction ID ${transactionId} at ${eventTime}. The full event object:`, event); } /* Full event object: * { * "data": { * "cycleNumber": 1, * "order": { * "_createdDate": "2024-01-25T11:45:05.036Z", * "_id": "3b620f8b-33f3-4e29-b1db-c21d7a6afa01", * "_updatedDate": "2024-01-25T11:45:05.036Z", * "buyer": { * "contactId": "554c9e11-f4d8-4579-ac3a-a17f7e6cb0b4", * "memberId": "554c9e11-f4d8-4579-ac3a-a17f7e6cb0b4" * }, * "currentCycle": { * "index": 1, * "startedDate": "2024-01-25T11:45:05.036Z" * }, * "cycles": [ * { * "index": 1, * "startedDate": "2024-01-25T11:45:05.036Z" * } * ], * "formData": { * "formId": "ee62cefa-bdc2-4b5d-baab-6faeef83cecb", * "submissionData": {}, * "submissionId": "1b282868-0a1e-42c6-9123-3a611b0014bf" * }, * "lastPaymentStatus": "NOT_APPLICABLE", * "orderMethod": "UNKNOWN", * "pausePeriods": [], * "planDescription": "", * "planId": "aa0d8e0e-99ad-4c95-ac48-4955e37956c5", * "planName": "Default", * "planPrice": "0", * "priceDetails": { * "currency": "EUR", * "discount": "0", * "fees": [], * "planPrice": "0", * "proration": "0", * "subtotal": "0.00", * "total": "0" * }, * "pricing": { * "prices": [ * { * "duration": { * "cycleFrom": 1, * "numberOfCycles": 1 * }, * "price": { * "currency": "EUR", * "discount": "0", * "fees": [], * "proration": "0", * "subtotal": "0.00", * "total": "0" * } * } * ], * "singlePaymentUnlimited": true * }, * "startDate": "2024-01-25T11:45:05.036Z", * "status": "ACTIVE", * "statusNew": "DRAFT", * "subscriptionId": "e9fff457-bc89-4c8c-94c0-1d162711c9a6", * "type": "ONLINE" * } * }, * "metadata": { * "entityId": "3b620f8b-33f3-4e29-b1db-c21d7a6afa01", * "eventTime": "2024-01-25T11:45:06.852478956Z", * "id": "9481d95b-3fd6-423c-af43-5198bed9691c", * "triggeredByAnonymizeRequest": false * } * } */ ``` ---