> 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: wixPricingPlansBackend # Method menu location: wixPricingPlansBackend --> Events --> onOrderAutoRenewCanceled # Method Link: https://dev.wix.com/docs/velo/apis/wix-pricing-plans-backend/events/on-order-auto-renew-canceled.md # Method Description: An event that triggers when an order is canceled with `effectiveAt` as `NEXT_PAYMENT_DATE`. The `onOrderAutoRenewCanceled()` event handler runs when an order's auto-renewal is canceled for the next payment date. The received `OrderAutoRenewCanceled` object contains information about the order whose auto-renewal is canceled for the next payment date. The `onOrderAutoRenewCanceled()` event will *not* trigger in the following scenarios: + If the order was canceled with `effectiveAt` as `IMMEDIATELY`. + When an order expires by reaching its `endDate` and was not canceled. > **Note:** Backend events don't work when previewing your site. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## An event triggered when an order's auto-renewal is canceled ```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 eventId = event.metadata.id; const eventTime = event.metadata.eventTime; } /* Full event object: * { * "metadata": { * "id":"5eb980d2-f734-4962-a043-e7d3b1d84797", * "entityId":"c778761f-0d19-4533-ac6d-434408398bf9", * "eventTime":"2022-08-08T10:55:10.795171Z", * "triggeredByAnonymizeRequest":false * }, * "data": { * "order": { * "_id":"c778761f-0d19-4533-ac6d-434408398bf9", * "planId":"099e2c86-3b7e-4477-8c27-f77402b8cceb", * "subscriptionId":"5493bc14-2ca4-4496-ba43-bcfc0fc3a47c", * "wixPayOrderId":"c63bcec6-dc46-4080-8892-82cb09492986", * "buyer": { * "memberId":"fac761ea-e6f1-4e3d-8b30-a4852f091415", * "contactId":"fac761ea-e6f1-4e3d-8b30-a4852f091415" * }, * "priceDetails": { * "subtotal":"74.99", * "discount":"0", * "total":"74.99", * "planPrice":"74.99", * "currency":"EUR", * "subscription": { * "cycleDuration": { * "count":1, * "unit":"MONTH" * }, * "cycleCount":3 * }}, * "pricing": { * "subscription": { * "cycleDuration": { * "count":1, * "unit":"MONTH" * }, * "cycleCount":3 * }, * "prices": [{ * "duration": { * "cycleFrom":1, * "numberOfCycles":3 * }, * "price": { * "subtotal":"74.99", * "discount":"0", * "total":"74.99", * "currency":"EUR" * } * }]}, * "type":"OFFLINE", * "orderMethod":"UNKNOWN", * "status":"ACTIVE", * "autoRenewCanceled":true, * "cancellation": { * "cause":"OWNER_ACTION", * "effectiveAt":"NEXT_PAYMENT_DATE" * }, * "lastPaymentStatus":"PAID", * "startDate":"2022-06-08T11:00:00.000Z", * "endDate":"2022-08-08T11:00:00.000Z", * "pausePeriods":[], * "earliestEndDate":"2022-09-08T11:00:00.000Z", * "currentCycle": { * "index":2, * "startedDate":"2022-07-08T11:00:00.000Z", * "endedDate":"2022-08-08T11:00:00.000Z" * }, * "planName":"Platinum Pro", * "planDescription":"", * "planPrice":"74.99", * "_createdDate":"2022-08-08T10:54:30.869Z", * "_updatedDate":"2022-08-08T10:55:10.677Z" * }} * } */ ``` ---