Below are the recommended steps to successfully create or update a Wix Pricing Plans (or several at once) on Wix and attach a booking session to a pricing plan, with real-world troubleshooting and fixes for common API issues.
Wix Pricing Plans includes Plans that allows Wix users to build a customized membership plan experiences and sell them to their customers. Pricing plans can also have bundled booking session as benefits.
Before proceeding to further steps I must read the following documentation on how to form request to pricing plans API.
Creating a pricing plan can be done by using create plan endpoint.
To attach integrating app entity, like bookings or blog to pricing plans read the Benefit Programs documentation and proceed to further steps.
Use Get Program Definition By External Id And Namespace endpoint to find the corresponding program definition of the plan. The call must have these query params:
externalId must be equal to pricing plan id.namespace must be @wix/pricing-plansExample the request in curl:
Only one pool definition per integrating app must be created. The pool definition should be created using create pool definition endpoint.
The request for this endpoint must adhere to these rules:
namespace must be @wix/pricing-planscreditConfiguration must be empty if the benefit is unlimitedThis step is needed to attach the integrating app entity to benefit program. This is done by using bulk create items endpoint.
Each item in the request for this endpoint must adhere to these rules:
namespace must be @wix/pricing-planscategory must be empty stringitemSetId must set to the created pool definition benefit item set id.externalId must be set to the integrating app entity id, example: booking service id or blog post id.