> 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: onOrderAutoRenewCanceled(event: OrderAutoRenewCanceledEvent) # Method package: wixPricingPlansV2 # Method menu location: wixPricingPlansV2 --> onOrderAutoRenewCanceled # Method Link: https://dev.wix.com/docs/velo/events-service-plugins/pricing-plans/events/on-order-auto-renew-canceled.md # Method Description: Triggered when an order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`. This webhook is *not* triggered in the following scenarios: + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`. Instead, at the time of cancellation, Order Canceled is triggered. + When an order expires at the end of the current payment cycle because it was canceled and `effectiveAt` was set to `NEXT_PAYMENT_DATE`. Instead, at the time of expiration, Order Canceled and Order Ended are triggered. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## onOrderAutoRenewCanceled 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_onOrderAutoRenewCanceled(event) { const orderId = event.data.order._id; const buyerContactId = event.data.buyer.contactId; const planId = event.data.planId; const eventTime = event.metadata.eventTime; console.log(`Order autorenew was cancelled for order ID ${orderId} by buyer ID ${buyerContactId}, for plan ID ${planId} on ${eventTime}. Full event object:`, event) } /* Full event object: * { * "data": { * "order": { * "_createdDate": "2024-01-28T09:49:21.041Z", * "_id": "82d99338-5653-459a-a751-b57483f7cfb5", * "_updatedDate": "2024-02-07T13:22:47.459Z", * "autoRenewCanceled": true, * "buyer": { * "contactId": "554c9e11-f4d8-4579-ac3a-a17f7e6cb0b4", * "memberId": "554c9e11-f4d8-4579-ac3a-a17f7e6cb0b4" * }, * "cancellation": { * "cause": "OWNER_ACTION", * "effectiveAt": "NEXT_PAYMENT_DATE" * }, * "currentCycle": { * "endedDate": "2024-04-27T09:49:21.041Z", * "index": 0, * "startedDate": "2024-01-28T09:49:21.041Z" * }, * "cycles": [ * { * "endedDate": "2024-04-27T09:49:21.041Z", * "index": 0, * "startedDate": "2024-01-28T09:49:21.041Z" * } * ], * "endDate": "2024-04-27T09:49:21.041Z", * "earliestEndDate": "2026-04-27T09:49:21.041Z", * "formData": { * "submissionData": {} * }, * "freeTrialDays": 90, * "orderMethod": "UNKNOWN", * "pausePeriods": [], * "planDescription": "3 mo free trial with discount for 1 year", * "planId": "cb4a8c57-273a-4567-94e3-cc43d5d339f2", * "planName": "Beginner's Plan", * "planPrice": "50", * "priceDetails": { * "currency": "USD", * "discount": "0", * "fees": [], * "freeTrialDays": 90, * "planPrice": "50", * "subtotal": "50.00", * "total": "50.00", * "subscription": { * "cycleCount": 2, * "cycleDuration": { * "count": 1, * "unit": "YEAR" * } * } * }, * "pricing": { * "prices": [ * { * "duration": { * "cycleFrom": 1, * "numberOfCycles": 2 * }, * "price": { * "currency": "USD", * "discount": "0", * "fees": [], * "proration": "0", * "subtotal": "50.00", * "total": "50.00" * } * } * ], * "subscription": { * "cycleCount": 2, * "cycleDuration": { * "count": 1, * "unit": "YEAR" * } * } * }, * "startDate": "2024-01-28T09:49:21.041Z", * "status": "ACTIVE", * "statusNew": "ACTIVE", * "subscriptionId": "305f8fc9-3724-4cac-9f67-4e29f2c46def", * "type": "OFFLINE", * "wixPayOrderId": "2f0e79d8-f15d-46c6-ac1a-10ec7a2030fb" * } * }, * "metadata": { * "entityId": "82d99338-5653-459a-a751-b57483f7cfb5", * "eventTime": "2024-02-07T13:22:47.641175778Z", * "id": "ef926c78-1c7a-4ffd-a8c4-fa59bdcf09c1", * "triggeredByAnonymizeRequest": false * } * } */ ``` ---