Plans V3: Sample Flows

This article presents possible use cases and corresponding sample flows that you can support. It provides a useful starting point as you plan your implementation.

Import plans from external systems

You can create plans using data stored in external systems. This is useful when migrating to Wix from another platform or maintaining data across multiple platforms.

To import plans from an external system:

  1. Prepare your plan data as an array of plan objects, ensuring each has the required fields: pricingVariants and visibility.

  2. Iterate through your plan array, calling Create Plan for each plan. To comply with rate limits, send the requests at least 1 second apart from each other.

  3. Set up ongoing synchronization using events to keep both systems in sync.

Sync pricing plans across multiple systems

You can synchronize plan data between Wix and external systems to maintain consistency across platforms.

To sync pricing plans with an external system:

  1. Call Query Plans to retrieve all existing plans from Wix.

  2. Store the plan data in your external system, ensuring you save the plan's id and revision for future updates.

  3. Set up event listeners for Plan Created, Plan Updated, and Plan Deleted events to automatically sync changes.

Note: When receiving a Plan Updated event, use the revision number to avoid conflicts and update only the changed fields in your external system.

Did this help?