Subchapter 8.82
references/pricing-plans/pricing-plans-bookings-integration.mdMarkdown8 KBView on GitHub
Below are the recommended steps to successfully integrate Wix Pricing Plans with Wix Bookings services, enabling customers to purchase packages and memberships for booking sessions. This recipe covers the complete workflow including the required Benefit Programs integration.
Before starting the integration, ensure the following apps are installed on the site:
If you receive app-related errors, install the missing app using the Apps Installer API.
Steps:
For detailed app installation procedures, refer to:
Integrating Pricing Plans with Bookings allows businesses to offer:
The integration requires coordination between three APIs:
payment.options.pricingPlan automatically becomes true when benefit programs are properly connectedexternalId must exactly match the pricing plan id for the connection to workCreate the pricing plan first using the Pricing Plans API. You can create either:
singlePaymentForDuration pricing model with "type": "bookings-package" in clientDatasubscription pricing model with "type": "bookings-membership" in clientDataImportant Validation Requirements:
validity.duration must be minimum 7 days (P7D format)P1D or shorter periods due to API validationKeep the returned plan.id for the next step.
Use the Benefit Programs API to create the program definition that links to your pricing plan. The externalId must exactly match the pricing plan id from step 1, and use "@wix/pricing-plans" as the namespace.
Error Handling Note: If you receive “Entity already exists” errors, the program definition may already exist from a previous attempt. Query existing programs first or handle the error gracefully.
Create the benefit definition that connects the program to your specific booking service:
creditAmount set to the desired session countcreditAmount field entirelyserviceId from your bookings service and "@wix/pricing-plans" namespaceRevision Number Handling: The Benefit Programs API requires revision numbers. If operations fail due to revision conflicts, retrieve the current revision number and retry.
Query the service to confirm integration is working. The service should now show payment.options.pricingPlan: true and the plan should appear in the booking UI as a payment option.
id → Benefit Program Definition externalIdid → Benefit Definition serviceIdid → Benefit Definition programDefinitionIdcreditAmount: Users consume credits per sessioncreditAmount: Users get unlimited access during subscription"@wix/pricing-plans" as namespace for pricing plan integrations“App not installed” Error (428):
“Plan not found” Error:
externalId exactly matches pricing plan id“Entity already exists” Error:
Service doesn’t show pricing plan option:
serviceIdpayment.options.pricingPlan: trueCredits not working correctly:
creditAmount is set to desired session countcreditAmount is omitted entirelyMinimum Duration Validation Errors:
validity.duration is at least P7D (7 days)Revision Number Conflicts:
POST https://www.wixapis.com/pricing-plans/v3/plansPOST https://www.wixapis.com/_api/benefit-programs/v1/program-definitions