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.
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.
Offer membership plans as described in Pricing Plans: An Overview. When setting up a 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 2 pages in the plan purchase flow:
You can use navigateToPricingPage()
and navigateToCheckout()
methods to customize
pages in the plan purchase flow:
navigateToPricingPage()
. In the same method you can also pass options to customize the content
on the Checkout and Thank You pages.navigateToCheckout()
, 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'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()
and pass the retrieved options directly to navigateToCheckout()
.
To use the CustomPurchaseFlow API, import customPurchaseFlow
from the wix-pricing-plans-frontend
module.