/** * 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'; * ``` */ 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. */ 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"`. */ 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()`. */ 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. */ 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. */ 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. */ 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; } 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. */ 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; } 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. */ 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. */ interface Price$1 { /** * 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. */ 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 */ 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. */ 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. */ 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$1; } /** * Order pricing model, price, and payment schedule. */ 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 */ 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. */ 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. */ 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 */ declare 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. */ declare function requestCurrentMemberOrderCancellation(orderId: string, effectiveAt: string): Promise; type ordersSdkModuleContext_Buyer = Buyer; type ordersSdkModuleContext_Cancellation = Cancellation; type ordersSdkModuleContext_Coupon = Coupon; type ordersSdkModuleContext_CurrentCycle = CurrentCycle; type ordersSdkModuleContext_CurrentMemberFilterOptions = CurrentMemberFilterOptions; type ordersSdkModuleContext_Duration = Duration; type ordersSdkModuleContext_Order = Order; type ordersSdkModuleContext_OrderRecurrence = OrderRecurrence; type ordersSdkModuleContext_Orders = Orders; type ordersSdkModuleContext_PaginationOptions = PaginationOptions; type ordersSdkModuleContext_PausePeriod = PausePeriod; type ordersSdkModuleContext_PriceDetails = PriceDetails; type ordersSdkModuleContext_PriceDuration = PriceDuration; type ordersSdkModuleContext_Prices = Prices; type ordersSdkModuleContext_Pricing = Pricing; type ordersSdkModuleContext_SortingOptions = SortingOptions; type ordersSdkModuleContext_Tax = Tax; declare const ordersSdkModuleContext_listCurrentMemberOrders: typeof listCurrentMemberOrders; type ordersSdkModuleContext_priceDetailsPricingModelOneOf = priceDetailsPricingModelOneOf; type ordersSdkModuleContext_pricingPricingModelOneOf = pricingPricingModelOneOf; declare const ordersSdkModuleContext_requestCurrentMemberOrderCancellation: typeof requestCurrentMemberOrderCancellation; declare namespace ordersSdkModuleContext { export { type ordersSdkModuleContext_Buyer as Buyer, type ordersSdkModuleContext_Cancellation as Cancellation, type ordersSdkModuleContext_Coupon as Coupon, type ordersSdkModuleContext_CurrentCycle as CurrentCycle, type ordersSdkModuleContext_CurrentMemberFilterOptions as CurrentMemberFilterOptions, type ordersSdkModuleContext_Duration as Duration, type ordersSdkModuleContext_Order as Order, type ordersSdkModuleContext_OrderRecurrence as OrderRecurrence, type ordersSdkModuleContext_Orders as Orders, type ordersSdkModuleContext_PaginationOptions as PaginationOptions, type ordersSdkModuleContext_PausePeriod as PausePeriod, type Price$1 as Price, type ordersSdkModuleContext_PriceDetails as PriceDetails, type ordersSdkModuleContext_PriceDuration as PriceDuration, type ordersSdkModuleContext_Prices as Prices, type ordersSdkModuleContext_Pricing as Pricing, type ordersSdkModuleContext_SortingOptions as SortingOptions, type ordersSdkModuleContext_Tax as Tax, ordersSdkModuleContext_listCurrentMemberOrders as listCurrentMemberOrders, type ordersSdkModuleContext_priceDetailsPricingModelOneOf as priceDetailsPricingModelOneOf, type ordersSdkModuleContext_pricingPricingModelOneOf as pricingPricingModelOneOf, ordersSdkModuleContext_requestCurrentMemberOrderCancellation as requestCurrentMemberOrderCancellation }; } /** * Contains functionality for ordering a site's pricing plans. * * Use the Pricing Plans Checkout API to create online orders for [pricing plans](https://support.wix.com/en/article/pricing-plans-an-overview) from page code. * * * ### Setup pricing plans * * To use APIs for checking out 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). * * * ### Check out pricing plans * * Use the Checkout APIs to create orders and facilitate payment. * * The Checkout API allows you to: * + Create online orders and facilitate their payment. * + Create your own customized ordering process. * * Updating the properties of a pricing plan doesn't affect any current orders of the plan by site members. * The existing orders retain their existing terms and pricing. * * 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). * * ### Drafts * * Orders created online are considered drafts until they're paid for. Drafts aren't listed in the Subscriptions * dashboard page and aren't saved in the `Orders` collection. * * Offline orders are never considered drafts even if they're not yet paid for. Unlike online orders, * offline orders are immediately listed in the Subscriptions dashboard page and saved in the `Orders` collection. * * * ### 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 API. * * 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 ([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. * * ### Roles and permissions * * You need "Manage Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) to perform pricing * plan checkout methods. * * * ### Import the APIs * * To use the Checkout API, import `checkout` from the `wix-pricing-plans-frontend` module. * * ```javascript * import {checkout} from 'wix-pricing-plans-frontend'; * ``` */ interface Checkout { /** * Orders a pricing plan. * * To process pricing plans on a site, a site first must be set up to offer pricing plans * as described in [Pricing Plans: An Overview](https://support.wix.com/en/article/pricing-plans-an-overview). * When setting up a site to accept pricing plans, [define the plans you want to offer](https://support.wix.com/en/article/pricing-plans-creating-a-one-time-payment-plan). * * Ordering a plan places an order for the plan, without actually purchasing it. You can then continue the * payment process with [Wix Pay](https://dev.wix.com/docs/velo/apis/wix-pay-frontend/introduction), which applies the plan to the buyer on completion of payment. * * To understand how `createOnlineOrder()` is used in a customized pricing plan lifecycle, * see the Custom Purchase Flow API ([SDK](https://dev.wix.com/docs/sdk/frontend-modules/pricing-plans/custom-purchase-flow/introduction) | [Velo](https://dev.wix.com/docs/velo/apis/wix-pricing-plans-frontend/custom-purchase-flow/introduction)). * * * > **Note:** * > + To work with the Pricing Plans API, a site needs to be published. * @param planId - The plan ID. * @requiredField planId * @param startDate - Start date and time for the ordered plan. * @returns Fulfilled - The created order. * @servicePath wix-pricing-plans-frontend.Orders.Order */ createOnlineOrder(planId: string, startDate?: Date): Promise; /** * Orders and purchases a pricing plan. * * `startOnlinePurchase()` returns a Promise that resolves to a `Purchase` * object when the member completes the purchase process. Depending on whether the plan * is free, the `Purchase` object returns different properties. * * To process pricing plans on a site, a site first must be set up to offer pricing plans * as described in [Pricing Plans: An Overview](https://support.wix.com/en/article/pricing-plans-an-overview). * When setting up a site to accept pricing plans, [define the plans you want to offer](https://support.wix.com/en/article/pricing-plans-creating-a-one-time-payment-plan), * including the payment method. * * Purchasing a plan orders the plan and continues the * payment process with the [Wix Pay API](https://dev.wix.com/docs/velo/apis/wix-pay-frontend/introduction). After payment is complete, the plan * is assigned to the member. * * To understand the lifecycle of how `startOnlinePurchase()` is used, * see [Direct Purchase of a Pricing Plan](https://dev.wix.com/docs/velo/apis/wix-pricing-plans-frontend/introduction#apis_wix-pricing-plans-frontend_direct-order-of-a-pricing-plan). * * > **Note:** * > + To work with the Pricing Plans API, a site needs to be published publish. * @param planId - The plan ID. * @requiredField planId * @param startDate - Start date and time for the ordered plan. * @returns Fulfilled - Details about the purchased plan. * @servicePath wix-pricing-plans-frontend.Checkout.Purchase */ startOnlinePurchase(planId: string, startDate?: Date): Promise; } interface CreateOnlineOrderOptions { /** * Start date and time for the ordered plan. * * Default: Current date and time */ startDate?: Date; /** * Coupon code to apply. * * To learn more about coupons, see [applyCoupon()](https://dev.wix.com/docs/velo/api-reference/wix-pricing-plans-backend/checkout/applycoupon). */ couponCode?: string; } /** * An object representing the period for which a plan is valid. */ interface Period { /** * The number of units until the plan expires. * @requiredField amount */ amount: number; /** * Time period for billing the plan, such as `"MONTH"`. * @requiredField unit */ unit: string; } /** * An object representing the price of a purchased plan. */ interface Price { /** * Payment currency. A three-letter * [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. * @requiredField currency */ currency: string; /** * The cost of the plan. * @requiredField amount */ amount: number; } /** * An object representing a purchase for a non-free plan. */ interface Purchase { /** * The order being purchased. * @requiredField order * @servicePath wix-pricing-plans-frontend.Orders.Order */ order: Order; /** * Payment status in [Wix Pay](https://www.wix.com/velo/reference/wix-pay-frontend). Omitted for free plans. * One of: * + `"Successful"`: Payment was successfully received. * + `"Pending"`: Payment is pending payment provider approval. * + `"Failed"`: Payment has failed. * + `"Chargeback"`: Payment is chargeback. * + `"Refunded"`: Payment was fully refunded. * + `"Offline"`: Payment will be executed offline. * + `"PartiallyRefunded"`: Payment was partially refunded. * + `"Cancelled"`: Payment was cancelled and was not processed. * + `"Undefined"`: Payment status is pending payment provider input. */ wixPayStatus?: string; } interface StartOnlinePurchaseOptions { /** * Start date and time for the ordered plan. * * Default: Current date and time */ startDate?: Date; /** * Coupon code to apply. * * To learn more about coupons, see [applyCoupon()](https://dev.wix.com/docs/velo/api-reference/wix-pricing-plans-backend/checkout/applycoupon). */ couponCode?: string; } /** * An object representing how long a plan is valid. */ interface ValidFor { /** * If true, the plan does not expire. * @requiredField forever */ forever: boolean; /** * Object containing the period for which the plan is valid. * @requiredField period * @servicePath wix-pricing-plans-frontend.Checkout.Period */ period: Period; } /** * Orders a pricing plan. * * To process pricing plans on a site, a site first must be set up to offer pricing plans * as described in [Pricing Plans: An Overview](https://support.wix.com/en/article/pricing-plans-an-overview). * When setting up a site to accept pricing plans, [define the plans you want to offer](https://support.wix.com/en/article/pricing-plans-creating-a-one-time-payment-plan). * * Ordering a plan places an order for the plan, without actually purchasing it. You can then continue the * payment process with [Wix Pay](https://dev.wix.com/docs/velo/apis/wix-pay-frontend/introduction), which applies the plan to the buyer on completion of payment. * * To understand how `createOnlineOrder()` is used in a customized pricing plan lifecycle, * see the Custom Purchase Flow API ([SDK](https://dev.wix.com/docs/sdk/frontend-modules/pricing-plans/custom-purchase-flow/introduction) | [Velo](https://dev.wix.com/docs/velo/apis/wix-pricing-plans-frontend/custom-purchase-flow/introduction)). * * * > **Note:** * > + To work with the Pricing Plans API, a site needs to be published. * @param planId - The plan ID. * @requiredField planId * @param startDate - Start date and time for the ordered plan. * @returns Fulfilled - The created order. * @servicePath wix-pricing-plans-frontend.Orders.Order */ declare function createOnlineOrder(planId: string, startDate?: Date): Promise; /** * Orders and purchases a pricing plan. * * `startOnlinePurchase()` returns a Promise that resolves to a `Purchase` * object when the member completes the purchase process. Depending on whether the plan * is free, the `Purchase` object returns different properties. * * To process pricing plans on a site, a site first must be set up to offer pricing plans * as described in [Pricing Plans: An Overview](https://support.wix.com/en/article/pricing-plans-an-overview). * When setting up a site to accept pricing plans, [define the plans you want to offer](https://support.wix.com/en/article/pricing-plans-creating-a-one-time-payment-plan), * including the payment method. * * Purchasing a plan orders the plan and continues the * payment process with the [Wix Pay API](https://dev.wix.com/docs/velo/apis/wix-pay-frontend/introduction). After payment is complete, the plan * is assigned to the member. * * To understand the lifecycle of how `startOnlinePurchase()` is used, * see [Direct Purchase of a Pricing Plan](https://dev.wix.com/docs/velo/apis/wix-pricing-plans-frontend/introduction#apis_wix-pricing-plans-frontend_direct-order-of-a-pricing-plan). * * > **Note:** * > + To work with the Pricing Plans API, a site needs to be published publish. * @param planId - The plan ID. * @requiredField planId * @param startDate - Start date and time for the ordered plan. * @returns Fulfilled - Details about the purchased plan. * @servicePath wix-pricing-plans-frontend.Checkout.Purchase */ declare function startOnlinePurchase(planId: string, startDate?: Date): Promise; type checkoutSdkModuleContext_Checkout = Checkout; type checkoutSdkModuleContext_CreateOnlineOrderOptions = CreateOnlineOrderOptions; type checkoutSdkModuleContext_Period = Period; type checkoutSdkModuleContext_Price = Price; type checkoutSdkModuleContext_Purchase = Purchase; type checkoutSdkModuleContext_StartOnlinePurchaseOptions = StartOnlinePurchaseOptions; type checkoutSdkModuleContext_ValidFor = ValidFor; declare const checkoutSdkModuleContext_createOnlineOrder: typeof createOnlineOrder; declare const checkoutSdkModuleContext_startOnlinePurchase: typeof startOnlinePurchase; declare namespace checkoutSdkModuleContext { export { type checkoutSdkModuleContext_Checkout as Checkout, type checkoutSdkModuleContext_CreateOnlineOrderOptions as CreateOnlineOrderOptions, type checkoutSdkModuleContext_Period as Period, type checkoutSdkModuleContext_Price as Price, type checkoutSdkModuleContext_Purchase as Purchase, type checkoutSdkModuleContext_StartOnlinePurchaseOptions as StartOnlinePurchaseOptions, type checkoutSdkModuleContext_ValidFor as ValidFor, checkoutSdkModuleContext_createOnlineOrder as createOnlineOrder, checkoutSdkModuleContext_startOnlinePurchase as startOnlinePurchase }; } type Methods$2 = { [P in keyof T as T[P] extends Function ? P : never]: T[P]; }; declare const checkoutContext: Methods$2; /** * The Custom Purchase Flow API contains functionality for customizing the plan purchase flow on a site. * * Use the Custom Purchase Flow API to customize the pages in the plan purchase flow on a site. This API provides * functionality for directing users to the Plans & Pricing and Checkout pages outside of the default flow. It also * allows you to customize the content displayed on the Plan & Pricing, Checkout, and Thank You pages. * * ### Set up pricing plans * To use APIs to customize the plan purchase flow, a site must first be set up to: * * + Accept payments as described in [Accepting Payments: An Overview](https://support.wix.com/en/article/accepting-payments-an-overview). * * + Offer membership plans as described in [Pricing Plans: An Overview](https://support.wix.com/en/article/pricing-plans-an-overview). When setting up a site to accept pricing plans, * define the plans you want to offer [using the dashboard](https://support.wix.com/en/article/pricing-plans-creating-a-one-time-payment-plan) or * using the Pricing Plan APIs. * * ### Direct users to pages in the purchase flow * The Custom Purchase Flow API lets you direct customers to either of 2 pages in the plan purchase flow: * * + **The Plans & Pricing page**: You can navigate from anywhere in a site to the Plans & Pricing page. * + **The Checkout page**: If a site uses a custom Plans & Pricing page, you can navigate to checkout from anywhere in a site, including * the Plans & Pricing page. If a site uses the default Plans & Pricing page, visitors will still be directed from Plans & Pricing to the * Checkout page without you calling any method. However, you may also direct customers to checkout from any other page in a site. * * ### Customize the content of the Plans & Pricing and Checkout pages * You can use `navigateToPricingPage()` and `navigateToCheckout()` methods to customize * pages in the plan purchase flow: * * + **Customizing the Plans & Pricing page**: You can set page content such as the title and subtitle of the Plans & Pricing page by passing * options to `navigateToPricingPage()`. In the same method you can also pass options to customize the content * on the Checkout and Thank You pages. * + **Customizing the Checkout page**: In `navigateToCheckout()`, you can pass options to customize the * content displayed on the Checkout and Thank You pages. * + **Retrieving the Pricing Page options**: You can call `getPricingPageOptions()` on the Plans & Pricing page to * retrieve the Pricing page options you set in `navigateToPricingPage()`. * * ### Customize the pricing plan purchase flow * You can now add custom pages to the pricing plan flow, as well as build a custom Plans & Pricing page. * * If you add pages between Plans & Pricing and Checkout, you'll need to store the options set in `navigateToPricingPage()` * globally, for example using the Wix Storage API and access them before you call `navigateToCheckout()`. * * If you are navigating directly from the Plans & Pricing page to Checkout, you can * call [`getPricingPageOptions()`](#getPricingPageOptions) and pass the retrieved options directly to [`navigateToCheckout()`](#navigateToCheckout). * * ### Import the APIs * To use the CustomPurchaseFlow API, import `customPurchaseFlow` from the `wix-pricing-plans-frontend` module. * * ```javascript * import { customPurchaseFlow } from 'wix-pricing-plans-frontend'; * ``` */ interface CustomPurchaseFlow { /** * Returns the options set for the current Plans & Pricing page. * * `getPricingPageOptions()` retrieves the options set for the Plans & Pricing Page in `navigateToPricingPage()`. * The returned `PricingPageOptions` object also includes any options set for the Checkout and Thank You pages. * * Call this method in the page code of a default or custom Plans & Pricing page. If you need to pass the returned pricing page * options to `navigateToCheckout()` at a later point, store the options object globally so you can access it later. * * > **Note:** * > + To work with the Pricing Plans API, a site needs to be published. * * @servicePath wix-pricing-plans-frontend.CustomPurchaseFlow.PricingPageOptions */ getPricingPageOptions(): Promise; /** * Directs site visitor to the Checkout page in the plan purchase flow. * * `navigateToCheckout()` redirects the site visitor to the Checkout page from any other page on a site. It also provides * options to customize the Checkout and Thank You pages that come later in the plan purchase flow. * * Note that the use of `navigateToCheckout()` differs slightly depending on whether you use the default Plans & Pricing page or a custom one: * + If you choose to use the default Plans & Pricing page, you won't be able to call `navigateToCheckout()` from there, but * you may still call it from any other page in a site. * + If you are using a custom Plans & Pricing page, you can call `navigateToCheckout()` on the plans page as well as anywhere else on a * site. * * > **Notes:** * > + Setting the `minStartDate` and `maxStartDate` parameters have no effect unless you've allowed customers * > to [set the plan start date](https://support.wix.com/en/article/pricing-plans-creating-a-one-time-payment-plan#step-4-adjust-your-plans-settings). * > + To work with the Pricing Plans API, a site needs to be published. * @param options - Options to customize the Checkout page and subsequent flow. * @requiredField options * @servicePath wix-pricing-plans-frontend.CustomPurchaseFlow.CheckoutOptions */ navigateToCheckout(options: CheckoutOptions): Promise; /** * Directs site visitor to the Pricing & Plans page in the plan purchase flow. * * `navigateToPricingPage()` directs the site visitor to the active Plans & Pricing page from any other page on a site. * It also provides options to customize the Checkout and Thank You pages that come later in the plan purchase flow. This allows you to * customize each of the pages in the flow with a single method. * * > **Notes:** * > * > + Setting the `minStartDate` and `maxStartDate` parameters have no effect unless you've allowed customers * > to [set the plan start date](https://support.wix.com/en/article/pricing-plans-creating-a-one-time-payment-plan#step-4-adjust-your-plans-settings). * > + To work with the Pricing Plans API, a site needs to be published. * @param options - Options to customize the Plans & Pricing page and subsequent flow. * @requiredField options * @servicePath wix-pricing-plans-frontend.CustomPurchaseFlow.PricingPageOptions */ navigateToPricingPage(options: PricingPageOptions): Promise; } /** * Sets the data associated with the Checkout page. */ interface CheckoutOptions { /** * Selected pricing plan ID. * @requiredField planId */ planId: string; /** * Earliest date the selected plan can start in `yyyy-MM-dd` format. */ minStartDate?: string; /** * Latest date the selected plan can start in `yyyy-MM-dd` format. */ maxStartDate?: string; /** * The data associated with the Thank You page. * @servicePath wix-pricing-plans-frontend.CustomPurchaseFlow.ThankYouPage */ thankYouPage?: ThankYouPage; } /** * Sets the data associated with the Checkout page. */ interface CheckoutPageOptions { /** * Earliest date the selected plan can start in `yyyy-MM-dd` format. */ minStartDate?: string; /** * Latest date the selected plan can start in `yyyy-MM-dd` format. */ maxStartDate?: string; /** * The data associated with the Thank You page. * @servicePath wix-pricing-plans-frontend.CustomPurchaseFlow.ThankYouPage */ thankYouPage?: ThankYouPage; } /** * Settings for the display of the Plans & Pricing page and subsequent pages in the plan purchase flow. */ interface PricingPageOptions { /** * List of plan IDs displayed on the Plans & Pricing page. */ planIds?: string[]; /** * Plans & Pricing page title. */ title?: string; /** * Plans & Pricing page subtitle. */ subtitle?: string; /** * The data associated with the Checkout page. * @servicePath wix-pricing-plans-frontend.CustomPurchaseFlow.CheckoutPageOptions */ checkout?: CheckoutPageOptions; } /** * Options to customize the Thank You page that's displayed after a customer purchases a plan. */ interface ThankYouPage { /** * The content displayed on the Thank You page. * @servicePath wix-pricing-plans-frontend.CustomPurchaseFlow.content */ content?: content; /** * The page to navigate to when a user clicks the button on the Thank You Page. * It must be a page on a site. * @servicePath wix-pricing-plans-frontend.CustomPurchaseFlow.navigation */ navigation?: navigation; } /** * The content displayed on the Thank You page. */ interface content { /** * Thank You page title. */ title?: string; /** * Thank You page body. */ message?: string; /** * Thank You page button label. */ cta?: string; } /** * The page to navigate to when a user clicks the button on the Thank You Page. * It must be a page on a site. */ interface navigation { /** * URL of a page on a site. The link may be relative or a site's base URL. Examples: * + `/home` * + `https://my.wixsite.com/path` * @requiredField url */ url: string; /** * Link type. * * Supported values: * - `"url"` * @requiredField type */ type: string; } /** * Returns the options set for the current Plans & Pricing page. * * `getPricingPageOptions()` retrieves the options set for the Plans & Pricing Page in `navigateToPricingPage()`. * The returned `PricingPageOptions` object also includes any options set for the Checkout and Thank You pages. * * Call this method in the page code of a default or custom Plans & Pricing page. If you need to pass the returned pricing page * options to `navigateToCheckout()` at a later point, store the options object globally so you can access it later. * * > **Note:** * > + To work with the Pricing Plans API, a site needs to be published. * * @servicePath wix-pricing-plans-frontend.CustomPurchaseFlow.PricingPageOptions */ declare function getPricingPageOptions(): Promise; /** * Directs site visitor to the Checkout page in the plan purchase flow. * * `navigateToCheckout()` redirects the site visitor to the Checkout page from any other page on a site. It also provides * options to customize the Checkout and Thank You pages that come later in the plan purchase flow. * * Note that the use of `navigateToCheckout()` differs slightly depending on whether you use the default Plans & Pricing page or a custom one: * + If you choose to use the default Plans & Pricing page, you won't be able to call `navigateToCheckout()` from there, but * you may still call it from any other page in a site. * + If you are using a custom Plans & Pricing page, you can call `navigateToCheckout()` on the plans page as well as anywhere else on a * site. * * > **Notes:** * > + Setting the `minStartDate` and `maxStartDate` parameters have no effect unless you've allowed customers * > to [set the plan start date](https://support.wix.com/en/article/pricing-plans-creating-a-one-time-payment-plan#step-4-adjust-your-plans-settings). * > + To work with the Pricing Plans API, a site needs to be published. * @param options - Options to customize the Checkout page and subsequent flow. * @requiredField options * @servicePath wix-pricing-plans-frontend.CustomPurchaseFlow.CheckoutOptions */ declare function navigateToCheckout(options: CheckoutOptions): Promise; /** * Directs site visitor to the Pricing & Plans page in the plan purchase flow. * * `navigateToPricingPage()` directs the site visitor to the active Plans & Pricing page from any other page on a site. * It also provides options to customize the Checkout and Thank You pages that come later in the plan purchase flow. This allows you to * customize each of the pages in the flow with a single method. * * > **Notes:** * > * > + Setting the `minStartDate` and `maxStartDate` parameters have no effect unless you've allowed customers * > to [set the plan start date](https://support.wix.com/en/article/pricing-plans-creating-a-one-time-payment-plan#step-4-adjust-your-plans-settings). * > + To work with the Pricing Plans API, a site needs to be published. * @param options - Options to customize the Plans & Pricing page and subsequent flow. * @requiredField options * @servicePath wix-pricing-plans-frontend.CustomPurchaseFlow.PricingPageOptions */ declare function navigateToPricingPage(options: PricingPageOptions): Promise; type customPurchaseFlowSdkModuleContext_CheckoutOptions = CheckoutOptions; type customPurchaseFlowSdkModuleContext_CheckoutPageOptions = CheckoutPageOptions; type customPurchaseFlowSdkModuleContext_CustomPurchaseFlow = CustomPurchaseFlow; type customPurchaseFlowSdkModuleContext_PricingPageOptions = PricingPageOptions; type customPurchaseFlowSdkModuleContext_ThankYouPage = ThankYouPage; type customPurchaseFlowSdkModuleContext_content = content; declare const customPurchaseFlowSdkModuleContext_getPricingPageOptions: typeof getPricingPageOptions; declare const customPurchaseFlowSdkModuleContext_navigateToCheckout: typeof navigateToCheckout; declare const customPurchaseFlowSdkModuleContext_navigateToPricingPage: typeof navigateToPricingPage; type customPurchaseFlowSdkModuleContext_navigation = navigation; declare namespace customPurchaseFlowSdkModuleContext { export { type customPurchaseFlowSdkModuleContext_CheckoutOptions as CheckoutOptions, type customPurchaseFlowSdkModuleContext_CheckoutPageOptions as CheckoutPageOptions, type customPurchaseFlowSdkModuleContext_CustomPurchaseFlow as CustomPurchaseFlow, type customPurchaseFlowSdkModuleContext_PricingPageOptions as PricingPageOptions, type customPurchaseFlowSdkModuleContext_ThankYouPage as ThankYouPage, type customPurchaseFlowSdkModuleContext_content as content, customPurchaseFlowSdkModuleContext_getPricingPageOptions as getPricingPageOptions, customPurchaseFlowSdkModuleContext_navigateToCheckout as navigateToCheckout, customPurchaseFlowSdkModuleContext_navigateToPricingPage as navigateToPricingPage, type customPurchaseFlowSdkModuleContext_navigation as navigation }; } type Methods$1 = { [P in keyof T as T[P] extends Function ? P : never]: T[P]; }; declare const customPurchaseFlowContext: Methods$1; type Methods = { [P in keyof T as T[P] extends Function ? P : never]: T[P]; }; declare const ordersContext: Methods; export { checkoutContext as checkout, customPurchaseFlowContext as customPurchaseFlow, ordersContext as orders };