Search.../

Introduction

Use the Pricing Plans Checkout API to create online and offline orders for your pricing plans. The Pricing Plans Checkout API provides functionality for creating orders created in the Wix Pricing Plans app or using this Wix Pricing Plans API.

Note: As part of our Velo rebranding efforts, we have improved plan ordering and purchasing functionality in our Pricing Plans APIs. The Pricing Plans APIs replace the deprecated Paid Plans APIs. The deprecated APIs will continue to work, but they will not receive updates. To keep any existing code compatible with future changes, see the migration instructions for each function.

Setting up pricing plans

To use APIs for checking out orders, first set up your site to:

Checking out pricing plans

Use the Checkout APIs to create orders and facilitate payment.

The Checkout API allows you to:

  • Create both offline and online orders, and facilitate their payment.
  • Preview orders and their pricing.
  • Change the start date for an unpaid order.

Updating the properties of a pricing plan does not affect any current orders of the plan. The existing orders retain their existing terms and pricing.

Members can order pricing plans in 2 ways:

  • Online. Members order and pay for their plans on your site without manual intervention. This can also be done in page code.
  • Offline. Members place their order by phone, text, or email. You manually record each stage of the transaction.

Drafts

Online orders are considered drafts until they are paid for. Drafts are not listed in the Subscriptions dashboard page and are not saved in the Orders collection. Drafts are displayed when listing orders with the listOrders() function.

Offline orders are never considered drafts even if they are 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 page in the Dashboard. These actions correspond to the functions available in the Pricing Plans APIs.

Every pricing plan order corresponds to a Wix subscription, including orders for single payment plans. You can see all orders from your site's Subscriptions page in the Dashboard. Actions available on this page correspond to the functions available in the Orders APIs and the Checkout APIs.

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, or subscription. Orders for all pricing plan models are displayed on the Subscriptions page, not just subscription type models. See Pricing Models to learn more.

Roles and permissions

Some functions require that only site visitors with the Manage Pricing Plans and Manage Subscriptions permissions can perform pricing plan checkout functions. You can override the permissions by setting the function's suppressAuth option to true.

Other functions might require that the site visitor just be logged in.

Importing the APIs

To use the Checkout API, import checkout from the wix-pricing-plans-backend module.

import {checkout} from 'wix-pricing-plans-backend';
javascript | Copy Code

Was this helpful?