createOnlineOrder( )


Orders a pricing plan.

The createOnlineOrder() function returns a Promise that resolves to an Order object.

To process pricing plans on your site, first set up your site to offer pricing plans as described in About Pricing Plans. When setting up your site to accept pricing plans, define the plans you want to offer.

Ordering a plan places an order for the plan, without actually purchasing it. You can then continue the payment process with Wix Pay, which applies the plan to the buyer on completion of payment.

To understand how createOnlineOrder() is used in a customized pricing plan lifecycle, see Customized Pricing Plan Purchases.

Notes:

  • The pricing plan createOnlineOrder() and createOfflineOrder() functions replace the deprecated paid plans orderPlan() function. The deprecated function will continue to work, but will not receive updates. To keep any existing code compatible with future changes, see the orderPlan() migration instructions.

  • To work with the Pricing Plans API, you need to publish your site.

Method Declaration
Copy
Method Parameters
planIdstringRequired

The plan ID.


startDateDate

Start date and time for the ordered plan.

Returns
Return Type:Promise<Order>
Was this helpful?
Yes
No