Using the Pricing Plans API, you can build a customized membership plan experience.
First, set up a site to:
Accept payments as described in About Accepting Payments.
Offer membership plans as described in About Pricing Plans. When setting up a site to accept pricing plans, define the plans you want to offer with either the Pricing Plans app or the Pricing Plans APIs (Velo | SDK).
When plans are set up, you can use the API to:
There are 2 flows for setting up pricing plans: Direct purchases and customized purchases.
Note: To work with the Pricing Plans API, a site needs to be published.
Direct ordering mirrors the ordering of a plan using the Pricing Plans app.
For standard pricing plan processing, call startOnlinePurchase()
(SDK | Velo).
The following outlines the steps in a direct order lifecycle:
startOnlinePurchase()
(SDK | Velo) to handle all stages of buying the plan (selecting, ordering, and payment):
wixPayStatus
is Successful
.wixPayStatus
is Pending
and the order's status
is DRAFT
. The site member fills in contact
details and selects a payment method. Once payment is completed, the wixPayStatus
is Successful
and the order's status
is ACTIVE
.onOrderPurchased()
(SDK | Velo).This flow lets buyers (logged-in site members) order and pay for a plan using a customized flow. You customize the entire process of selecting, requesting, and paying for a plan. You can add elements, such as confirmation lightboxes and forms, to customize the buyer's experience.
To let the buyer order a plan, call createOnlineOrder()
(SDK | Velo).
The following outlines the steps for customizing the pricing plan purchase:
createOnlineOrder()
(SDK | Velo) to handle the initial order of the plan.onOrderPurchased()
(SDK | Velo).For ordering pricing plans, import wixPricingPlansFrontend
from the wix-pricing-plans-frontend
module.