Use the Custom Purchase Flow API to customize the pages in the plan purchase flow on your 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.
To use APIs to customize the plan purchase flow, first set up pricing plans on your site:
Accept payments as described in About Accepting Payments.
Offer membership plans as described in About Pricing Plans. When setting up your site to accept pricing plans, define the plans you want to offer using the Dashboard or using the Pricing Plan APIs.
The Custom Purchase Flow API lets you direct customers to either of two pages in the plan purchase flow:
You can use the navigateToPricingPage()
and navigateToCheckout()
functions to customize
pages in the plan purchase flow:
navigateToPricingPage()
. In the same function you can also pass options to customize the content
on the Checkout and Thank You pages.navigateToCheckout()
function, you can pass options to customize the
content displayed on the Checkout and Thank You pages.getPricingPageOptions()
on the Plans & Pricing page to
retrieve the Pricing page options you set in navigateToPricingPage()
.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 will 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()
and pass the retrieved options directly to navigateToCheckout()
.
To use the CustomPurchaseFlow API, import customPurchaseFlow
from the wix-pricing-plans-frontend
module.