/** * The Pricing Plans Orders API contains functionality for managing * a site's pricing plan [orders](https://support.wix.com/en/article/pricing-plans-an-overview). * * Use the Pricing Plans Orders API to manage orders for pricing plans. The Pricing Plans * Orders API provides functionality for managing pricing plan orders created * in the Wix Pricing Plans app or using this Wix Pricing Plans API. * * * ### Set up orders * * To use APIs to manage plan orders, first set up a site to: * * + Accept payments as described in [About Accepting Payments](https://support.wix.com/en/article/about-accepting-payments). * * + Offer membership plans as described in [About Pricing Plans](https://support.wix.com/en/article/about-pricing-plans). When setting up a site to accept pricing plans, * define the plans you want to offer [using a Wix user's dashboard](https://support.wix.com/en/article/creating-a-plan-in-pricing-plans) or * [using the Pricing Plan APIs](https://dev.wix.com/docs/velo/api-reference/wix-pricing-plans-backend/create-plan). * * * ### Manage orders * * Site members can order pricing plans in 2 ways: * * + **Online**. Site members order and pay for their plans * on a site without manual intervention. This can also be done * in [backend code](https://dev.wix.com/docs/velo/api-reference/wix-pricing-plans-backend/checkout/create-online-order). * + **Offline**. Site members place their order by phone, text, or email. This can only be done * in [backend code](https://dev.wix.com/docs/velo/api-reference/wix-pricing-plans-backend/checkout/create-offline-order). * * Use the Orders API to manage online pricing plan orders. You can: * * + List orders for the currently logged-in site member. * + Allow site members to request cancellation of their own orders. * * * ### Orders and subscriptions * * * Actions related to basic pricing plan management are available from the [Pricing Plans](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fmembership%3FreferralInfo%3Dvelo-docs) * page in a Wix user's dashboard. These actions correspond to the methods available in the [Pricing Plans APIs](pricing-plans/introduction). * * Every pricing plan order corresponds to a Wix subscription, including orders for single payment plans. You can see all orders from a site's * [Subscriptions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fsubscriptions%3FreferralInfo%3Dvelo-docs) * page in a Wix user's dashboard. Actions available on this page correspond to the methods available in the [Orders APIs](pricing-plans/orders/introduction) and the [Checkout APIs](pricing-plans/checkout/introduction). * * * > **Notes**: * > * > + Wix pricing plans are 1 type of Wix subscriptions available from the Subscriptions page. For example, the Subscriptions page also includes Wix Stores subscriptions and Wix Invoice subscriptions. * > * > + Pricing plans can be 1 of 3 different pricing models: `singlePaymentForDuration`, `singlePaymentUnlimited`, and `subscription`. Orders for all pricing plan models are displayed * on the Subscriptions page, not just `subscription` type models. See Pricing Models ([Velo](https://dev.wix.com/docs/velo/apis/wix-pricing-plans-backend/introduction#apis_wix-pricing-plans-backend_pricing-models) | [SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/introduction#pricing-models)) to learn more. * * * ### Roles and permissions * * The current site visitor needs to be logged in to perform * plan order methods, such as `listCurrentMemberOrders()` or `requestCurrentMemberOrderCancellation()`. * * * ### Import the APIs * * To use the Orders API, import `orders` from the `wix-pricing-plans-frontend` module. * * ```javascript * import {orders} from 'wix-pricing-plans-frontend'; * ``` */ export interface Orders { /** * Lists the orders for the currently logged-in member. * * > **Note:** * > + To work with the Pricing Plans API, a site needs to be published. * > * > + `listCurrentMemberOrders()` doesn't work in preview mode. * @param filters - Filter options for limiting which orders are listed. * @servicePath wix-pricing-plans-frontend.Orders.CurrentMemberFilterOptions * @param sorting - Sorting options, such as by which property and in which direction. * @servicePath wix-pricing-plans-frontend.Orders.SortingOptions * @param paging - Pagination options, such as how many results are listed at a time. * @servicePath wix-pricing-plans-frontend.Orders.PaginationOptions * @returns Fulfilled - An array of order objects for the currently logged-in member. * Rejected - Error message. * @servicePath wix-pricing-plans-frontend.Orders.Order */ listCurrentMemberOrders(filters?: CurrentMemberFilterOptions, sorting?: SortingOptions, paging?: PaginationOptions): Promise; /** * Requests the cancellation of a specific order of a plan for the currently logged-in member. * * `requestCurrentMemberOrderCancellation()` requests the cancellation of an order, * after verifying that the site member is logged in. * * This method doesn't immediately cancel the order. The cancellation request is initiated * and the `status` of the order is updated to `"PENDING_CANCELLATION"`. When the cancellation * is completed, the order status is updated to `"CANCELED"`. * * Keep in mind that a site member can order several subscriptions of the same plan. * This API doesn't cancel the plan and remove all corresponding subscriptions. * This API removes only the one specified order of the plan. * * If a plan's [Allow Plan Cancellation](https://support.wix.com/en/article/pricing-plans-allowing-clients-to-cancel-plans) * setting is disabled and the currently logged-in site member tries to cancel an order for the plan using `requestCurrentMemberOrderCancellation()`, * an error is thrown. * * * > **Note**: * > + To work with the Pricing Plans API, a site needs to be published. * @param orderId - The order ID of the order whose cancellation is requested. * @requiredField orderId * @param effectiveAt - When the cancellation should take effect. * One of: * + `"IMMEDIATELY"`. The cancellation occurs immediately and the buyer cannot use the plan at this point. * + `"NEXT_PAYMENT_DATE"`. The cancellation occurs at the next payment date. The buyer can continue to use the plan until that date. * @requiredField effectiveAt * @returns Fulfilled - When the order cancellation is requested. */ requestCurrentMemberOrderCancellation(orderId: string, effectiveAt: string): Promise; } /** * Buyer details. */ export interface Buyer { /** * Member ID for the buyer. See the Members API to learn more about a site's members. * @requiredField memberId */ memberId: string; /** * Contact ID for the buyer. See the Contacts API to learn more about a site's contacts. * @requiredField contactId */ contactId: string; } /** * Details about the cancellation of an order. Only present if the order `status` is `"CANCELED"`. */ export interface Cancellation { /** * Date and time when the cancellation was requested. * @requiredField requestedDate */ requestedDate: Date; /** * The reason for the cancellation. * Supported values: * + `"OWNER_ACTION"`: The Wix user canceled the order. * + `"MEMBER_ACTION"`: The buyer initiated the cancellation. * + `"PAYMENT_FAILURE"`: A payment transaction failed. * + `"PAYMENT_SETUP_FAILURE"`: The buyer's payment details weren't set up correctly. * @requiredField cause */ cause: string; /** * When the cancellation takes effect. Set when cancelling the order. * Supported values: * + `"IMMEDIATELY"`: The cancellation occurs immediately and the buyer can no longer use the plan at this point. * + `"NEXT_PAYMENT_DATE"`: The cancellation occurs at the next payment date and time. The buyer can continue to use the plan until that date and time. * @requiredField effectiveAt */ effectiveAt: string; } /** * Coupon applied to the order. * * To learn more about coupons, see `applyCoupon()`. */ export interface Coupon { /** * Code of the applied coupon. * @requiredField code */ code: string; /** * Total discount of the coupon, as a monetary amount. * @requiredField amount */ amount: string; /** * Coupon ID. * @requiredField id */ id: string; } /** * Current payment cycle for the order. * * `currentCycle` will be omitted if the order's `status` is `CANCELED` or `ENDED`, or if the `startDate` hasn't been reached yet. */ export interface CurrentCycle { /** * Index of the current payment cycle in the order. * * `0` when the order is in a free trial period. In all other cases, the index starts with `1`. * @requiredField index */ index: number; /** * Start date and time for the current payment cycle. * @requiredField startedDate */ startedDate: Date; /** * End date and time for the current payment cycle. * @requiredField endedDate */ endedDate: Date; } /** * Fields to filter by when listing orders for the current member. */ export interface CurrentMemberFilterOptions { /** * Specific IDs of plans that were ordered by the current member. */ planIds?: string[]; /** * Whether the auto-renewal of the current member's recurring orders was canceled. */ autoRenewCanceled?: boolean; /** * Specific statuses for the current member's orders. * + `"DRAFT"`: The order has been initiated but payment hasn't been processed yet. The plan isn't yet available for use. * + `"PENDING"`: Payment is being processed. The plan isn't yet available for use. * + `"ACTIVE"`: The order has been processed and paid for. The plan is available for use. * + `"PAUSED"`: Use of the plan has been paused, see `pauseOrder()`, for example, if the buyer is away. The plan can be resumed, see `resumeOrder()`. * + `"ENDED"`: The order has completed its duration and is no longer available for use. * + `"CANCELED"`: The order has been canceled, see `cancelOrder()`. */ orderStatuses?: string[]; /** * Specific payment statuses for the current member's orders. * + `"PAID"`: The last payment was paid. * + `"REFUNDED"`: The last payment was refunded. * + `"FAILED"`: The last payment transaction didn't complete. * + `"UNPAID"`: The last payment wasn't paid. * + `"PENDING"`: Awaiting payment. * + `"NOT_APPLICABLE"`: No payment was necessary, such as for free plans or free trials. */ paymentStatuses?: string[]; } /** * Length of one payment cycle. For example, `1` `MONTH` for monthly payments. */ export interface Duration { /** * The amount of a duration `unit` in a single payment cycle. * * Currently limited to support only value of `1`. * @requiredField count */ count: number; /** * Unit of time for the cycle duration. * * Supported values: `"UNDEFINED"`, `"DAY"`, `"WEEK"`, `"MONTH"`, `"YEAR"` * @requiredField unit */ unit: string; } export interface Order { /** * Order ID. * @requiredField _id */ _id: string; /** * ID of the plan that was ordered. * @requiredField planId */ planId: string; /** * ID of the related Wix subscription. * * Every pricing plan order corresponds to a Wix subscription, including orders for single payment plans. You can see all orders from a site's [Subscriptions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fsubscriptions%3FreferralInfo%3Dvelo-docs) page in the dashboard. * @requiredField subscriptionId */ subscriptionId: string; /** * ID of the associated Wix Pay order. * * Created by the `createOnlineOrder()` or `createOfflineOrder()` method. For online orders, send this value as a parameter to the Wix Pay `startPayment()` method to enable a buyer to pay for an order. `wixPayOrderId` is omitted if the order is free. */ wixPayOrderId?: string; /** * The buyer's IDs. Includes `memberId` and `contactId`. * * Currently, Pricing Plan orders are limited to members only. `contactId` is returned, but a buyer won't be able to order a plan without a `memberId`. * @requiredField buyer * @servicePath wix-pricing-plans-frontend.Orders.Buyer */ buyer: Buyer; /** * **Deprecated.** Use `pricing` instead. * @requiredField priceDetails * @servicePath wix-pricing-plans-frontend.Orders.PriceDetails */ priceDetails: PriceDetails; /** * Order pricing model, price, and payment schedule. See Pricing Models ([SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/introduction#pricing-models) | [Velo](https://dev.wix.com/docs/velo/apis/wix-pricing-plans-backend/introduction#apis_wix-pricing-plans-backend_pricing-models)) to learn more. * @servicePath wix-pricing-plans-frontend.Orders.Pricing */ pricing?: Pricing; /** * How the order was processed. * Supported values: * + `"ONLINE"`: The buyer ordered the plan using the site. * + `"OFFLINE"`: The buyer made a manual, offline order without using the site. * @requiredField type */ type: string; /** * Status of the order. * Supported values: * + `"DRAFT"`: The order has been initiated but payment hasn't been processed yet. The plan isn't yet available for use. * + `"PENDING"`: The order has been processed and its start date is set in the future. The plan isn't yet available for use. * + `"ACTIVE"`: The order has been processed. The plan is available for use. * + `"PAUSED"`: The order and use of the plan is paused, see `pauseOrder()`. For example, if the buyer is away. The order and use of the plan can be resumed, see `resumeOrder()`. * + `"ENDED"`: The order has completed its duration and is no longer available for use. * + `"CANCELED"`: The order has been canceled, see `cancelOrder()`. * @requiredField status */ status: string; /** * Whether the order will be canceled at the next payment date. * * If `true`, the order `status` will be `"CANCELED"` and the next payment won't be charged. Omitted for single payment orders. */ autoRenewCanceled?: boolean; /** * Details about the cancellation of an order. Only present if the `status` is `"CANCELED"`. * @servicePath wix-pricing-plans-frontend.Orders.Cancellation */ cancellation?: Cancellation; /** * Status of the last payment for the order. This is updated automatically for online orders. The Wix user updates this manually for offline orders. * Supported values: * + `"PAID"`: The last payment was paid. * + `"REFUNDED"`: The last payment was refunded. * + `"FAILED"`: The last payment transaction didn't complete. * + `"UNPAID"`: The last payment wasn't paid. * + `"PENDING"`: Awaiting payment. * + `"NOT_APPLICABLE"`: No payment was necessary. For example, for free plans or free trials. * @requiredField lastPaymentStatus */ lastPaymentStatus: string; /** * Start date and time for the ordered plan. * @requiredField startDate */ startDate: Date; /** * Current date and time the ordered plan will expire. * * `endDate` may be updated over the course of an order. If the order is paused, see `pauseOrder()`, it will have a later `endDate` once it resumes, see `resumeOrder()`. `endDate` may also be postponed, see `postponeEndDate()`. * * Omitted if the order is valid until canceled and still `"ACTIVE"`. */ endDate?: Date; /** * List of periods during which this order is paused. * @requiredField pausePeriods * @servicePath wix-pricing-plans-frontend.Orders.PausePeriod */ pausePeriods: PausePeriod[]; /** * Free trial period, in days. Only available for recurring plans. */ freeTrialDays?: string; /** * Earliest end date and time that the plan for this order can expire. * * This is calculated by adding all pause periods to the original end date. Omitted if the order is active until canceled. Reserved for future use. */ earliestEndDate?: Date; /** * Current payment cycle for the order. * * `currentCycle` will be omitted if the order's status is `"CANCELED"` or `"ENDED"`, or if the `startDate` hasn't passed yet. * @requiredField currentCycle * @servicePath wix-pricing-plans-frontend.Orders.CurrentCycle */ currentCycle: CurrentCycle; /** * Name of the plan at the time of the order. * @requiredField planName */ planName: string; /** * Description of the plan at the time of the order. * @requiredField planDescription */ planDescription: string; /** * Plan price as it was at the moment of order creation. * @requiredField planPrice */ planPrice: string; /** * Date and time the order was created. * @requiredField _createdDate */ _createdDate: Date; /** * Date and time the order was last updated. For example, the date and time an order was paused, resumed, or canceled. * @requiredField _updatedDate */ _updatedDate: Date; } /** * The order has recurring payments. */ export interface OrderRecurrence { /** * Length of one payment cycle. For example, `1` `MONTH` for monthly payments. * @requiredField cycleDuration * @servicePath wix-pricing-plans-frontend.Orders.Duration */ cycleDuration: Duration; /** * Amount of payment cycles this subscription is valid for. * * `0` for orders of plans that are unlimited or until-canceled. * @requiredField cycleCount */ cycleCount: number; } export interface PaginationOptions { /** * Limit the number of orders returned. * * Default: `50` */ limit?: number; /** * Number of entries to skip. */ skip?: number; } /** * Period during which the order of a plan is suspended. */ export interface PausePeriod { /** * Status of the pause period. * Supported values: * + `"ACTIVE"`. Status while the order is [paused](https://dev.wix.com/docs/velo/apis/wix-pricing-plans-v2/orders/pause-order). * + `"ENDED"`. Status while the order is [resumed](https://dev.wix.com/docs/velo/apis/wix-pricing-plans-v2/orders/resume-order). * @requiredField status */ status: string; /** * Start date and time of the pause period. * @requiredField pauseDate */ pauseDate: Date; /** * End date and time of the pause period. * * Omitted while the pause period remains `"ACTIVE"`. * @requiredField resumeDate */ resumeDate: Date; } /** * Order price details. */ export interface Price { /** * Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`. * @requiredField subtotal */ subtotal: string; /** * Coupon applied to the order. * * To learn more about coupons, see `applyCoupon()`. * @requiredField coupon * @servicePath wix-pricing-plans-frontend.Orders.Coupon */ coupon: Coupon; /** * Total discount applied to the order. * @requiredField discount */ discount: string; /** * Tax applied to the order. * @servicePath wix-pricing-plans-frontend.Orders.Tax */ tax?: Tax; /** * Price after tax and discount is applied, specified as a monetary amount. For example, `"13.98"`. * * If no tax is applied, this amount is the same as `subtotal`. * @requiredField total */ total: string; /** * 3-letter currency code in [ISO 4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. * @requiredField currency */ currency: string; } /** * **Deprecated.** Use `pricing` instead. */ export interface PriceDetails extends priceDetailsPricingModelOneOf { /** * Price of the order, excluding tax. Specified as a monetary amount, such as `"3.99"`. * @requiredField subtotal */ subtotal: string; /** * Tax applied for the plan. Omitted if no tax was applied. * @servicePath wix-pricing-plans-frontend.Orders.Tax */ tax?: Tax; /** * Price after tax is applied. Specified as a monetary amount, such as `"4.98"`. If no tax was applied, this amount is the same as `subtotal`. * @requiredField total */ total: string; /** * Price of the plan when the order was created. This price is the amount for a single payment. For subscriptions, this is the amount to pay for each single payment cycle and the `planPrice` is required. Otherwise, the payment is for the entire plan. * @requiredField planPrice */ planPrice: string; /** * Currency code. Must be a valid [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code (for example, `"USD"`). * @requiredField currency */ currency: string; /** * Pricing model indicating that the order has recurring payments. This type of subscription isn't a "Wix subscription," which encompasses various types of subscriptions, such as Wix Stores subscriptions, Wix invoice subscriptions, and *all* pricing plan models. * @servicePath wix-pricing-plans-frontend.Orders.OrderRecurrence */ subscription?: OrderRecurrence; /** * Pricing model indicating that the order is paid with a single payment per cycle and what the length of the cycle is. The cycle is the duration of the order's plan, not a payment cycle. * @servicePath wix-pricing-plans-frontend.Orders.Duration */ singlePaymentForDuration?: Duration; /** * Pricing model indicating that the order of the plan is paid in 1 single payment and that the order is active until canceled. */ singlePaymentUnlimited?: boolean; /** * Free trial period for the order in days. Available only for orders whose plans are recurring, meaning plans whose pricing model is `subscription`. */ freeTrialDays?: number; } /** * @oneof */ export interface priceDetailsPricingModelOneOf { /** * Pricing model indicating that the order is paid with a single payment per cycle and what the length of the cycle is. The cycle is the duration of the order's plan, not a payment cycle. * @servicePath wix-pricing-plans-frontend.Orders.Duration */ singlePaymentForDuration?: Duration; /** * Pricing model indicating that the order of the plan is paid in 1 single payment and that the order is active until canceled. */ singlePaymentUnlimited?: boolean; /** * Pricing model indicating that the order has recurring payments. This type of subscription isn't a "Wix subscription," which encompasses various types of subscriptions, such as Wix Stores subscriptions, Wix invoice subscriptions, and *all* pricing plan models. * @servicePath wix-pricing-plans-frontend.Orders.OrderRecurrence */ subscription?: OrderRecurrence; } /** * Cycle duration to apply `price` for. */ export interface PriceDuration { /** * Price starts to apply with this cycle. * * `1` is the first payment cycle for all pricing models. * @requiredField cycleFrom */ cycleFrom: number; /** * Amount of cycles to apply price for. * * For `subscription` pricing models with a finite number of cycles, the `numberOfCycles` is the same as `pricing.subscription.cycleCount`. * * For `subscription` pricing models that are unlimited or until-canceled, the `numberOfCycles` isn't returned. * * For `singlePaymentForDuration` and `singlePaymentUnlimited` pricing models, the `numberOfCycles` is `1`. * @requiredField numberOfCycles */ numberOfCycles: number; } /** * Pricing details for all pricing models. */ export interface Prices { /** * Cycle duration to apply `price` for. * * Use with all pricing models. Can apply the same price to multiple payment cycles. * @requiredField duration * @servicePath wix-pricing-plans-frontend.Orders.PriceDuration */ duration: PriceDuration; /** * Order price. * @requiredField price * @servicePath wix-pricing-plans-frontend.Orders.Price */ price: Price; } /** * Order pricing model, price, and payment schedule. */ export interface Pricing extends pricingPricingModelOneOf { /** * Pricing model for an order with recurring payment cycles. * @servicePath wix-pricing-plans-frontend.Orders.OrderRecurrence */ subscription?: OrderRecurrence; /** * Pricing model for an order with a one-time payment and the order is valid for a specific amount of time. * @servicePath wix-pricing-plans-frontend.Orders.Duration */ singlePaymentForDuration?: Duration; /** * Pricing model for an order with a one-time payment and the order is valid until canceled. */ singlePaymentUnlimited?: boolean; /** * Pricing details for all pricing models. * @requiredField prices * @servicePath wix-pricing-plans-frontend.Orders.Prices */ prices: Prices; } /** * @oneof */ export interface pricingPricingModelOneOf { /** * Pricing model for an order with a one-time payment and the order is valid for a specific amount of time. * @servicePath wix-pricing-plans-frontend.Orders.Duration */ singlePaymentForDuration?: Duration; /** * Pricing model for an order with a one-time payment and the order is valid until canceled. */ singlePaymentUnlimited?: boolean; /** * Pricing model for an order with recurring payment cycles. * @servicePath wix-pricing-plans-frontend.Orders.OrderRecurrence */ subscription?: OrderRecurrence; } /** * Sorting details. */ export interface SortingOptions { /** * Name of the property to sort by. * * Supported values: `_createdDate`, `endDate` * * Default: `_createdDate` */ fieldName?: string; /** * Sort order. * * Supported values: * + `"ASC"`: Ascending * + `"DESC"`: Descending * * Default: `"ASC"` */ order?: string; } /** * Tax applied to the order. If empty, no tax was applied. */ export interface Tax { /** * Name of the tax. For example, VAT. * @requiredField name */ name: string; /** * Whether tax is included in the original price. When `false`, tax is added at checkout. * @requiredField includedInPrice */ includedInPrice: boolean; /** * Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`. * @requiredField rate */ rate: string; /** * Total tax, specified as a monetary amount. For example, `"3.99"`. * @requiredField amount */ amount: string; } /** * Lists the orders for the currently logged-in member. * * > **Note:** * > + To work with the Pricing Plans API, a site needs to be published. * > * > + `listCurrentMemberOrders()` doesn't work in preview mode. * @param filters - Filter options for limiting which orders are listed. * @servicePath wix-pricing-plans-frontend.Orders.CurrentMemberFilterOptions * @param sorting - Sorting options, such as by which property and in which direction. * @servicePath wix-pricing-plans-frontend.Orders.SortingOptions * @param paging - Pagination options, such as how many results are listed at a time. * @servicePath wix-pricing-plans-frontend.Orders.PaginationOptions * @returns Fulfilled - An array of order objects for the currently logged-in member. * Rejected - Error message. * @servicePath wix-pricing-plans-frontend.Orders.Order */ export function listCurrentMemberOrders(filters?: CurrentMemberFilterOptions, sorting?: SortingOptions, paging?: PaginationOptions): Promise; /** * Requests the cancellation of a specific order of a plan for the currently logged-in member. * * `requestCurrentMemberOrderCancellation()` requests the cancellation of an order, * after verifying that the site member is logged in. * * This method doesn't immediately cancel the order. The cancellation request is initiated * and the `status` of the order is updated to `"PENDING_CANCELLATION"`. When the cancellation * is completed, the order status is updated to `"CANCELED"`. * * Keep in mind that a site member can order several subscriptions of the same plan. * This API doesn't cancel the plan and remove all corresponding subscriptions. * This API removes only the one specified order of the plan. * * If a plan's [Allow Plan Cancellation](https://support.wix.com/en/article/pricing-plans-allowing-clients-to-cancel-plans) * setting is disabled and the currently logged-in site member tries to cancel an order for the plan using `requestCurrentMemberOrderCancellation()`, * an error is thrown. * * * > **Note**: * > + To work with the Pricing Plans API, a site needs to be published. * @param orderId - The order ID of the order whose cancellation is requested. * @requiredField orderId * @param effectiveAt - When the cancellation should take effect. * One of: * + `"IMMEDIATELY"`. The cancellation occurs immediately and the buyer cannot use the plan at this point. * + `"NEXT_PAYMENT_DATE"`. The cancellation occurs at the next payment date. The buyer can continue to use the plan until that date. * @requiredField effectiveAt * @returns Fulfilled - When the order cancellation is requested. */ export function requestCurrentMemberOrderCancellation(orderId: string, effectiveAt: string): Promise;