Wix Restaurants Online Orders: Sample Flows

This article presents possible use cases and corresponding sample flows that you can support. This can be a helpful jumping off point as you plan your implementation.

Export Wix orders to an external POS system

To export orders from Wix Restaurants to an external POS:

  1. Listen for changes to Wix Orders with the Order Created and Order Approved events.

  2. When these events are triggered, verify that the order contains restaurants items by checking lineItems for items with catalogReference.appId equal to "9a5d83fd-8570-482e-81ab-cfa88942ee60".

    For example:

    Copy

    See the full Order Object structure for reference.

  3. Create a mapping between Wix Restaurants orders and your external POS system orders to support syncing between them. Make sure to include all external IDs, such as order and customer IDs in the mapping. Store this mapping on your servers.

  4. Create the complete order in the POS system using your POS API.

Import POS orders to Wix

To import orders from an external POS into Wix Restaurants:

  1. Retrieve the external order from the POS.

  2. Create a mapping between your external POS system orders and Wix Restaurants orders to support syncing between them. Make sure to include all external IDs, such as order and item IDs in the mapping. Store this mapping on your servers.

  3. Call List Locations to identify and save the relevant location ID. Use this ID as the businessLocationId when creating Wix orders in the next step.

  4. Call Create Order with restaurants catalog references.

    You must specify the following in catalogReference:

    • catalogItemId: The ID of the item.
    • appId: The Wix Restaurants Orders (New) appId, "9a5d83fd-8570-482e-81ab-cfa88942ee60".
    • options.operationId: The operationId of the operation the item is being ordered from.
    • options.menuId: The menuId of the menu the item is being ordered from.
    • options.sectionId: The sectionId of the section the item is being ordered from.

    You can optionally specify options.onlineOrderingPageUrl. Specifying this allows customers on the site to click the item in the cart and navigate back to the item's modal where they can edit the item details.

    Copy

    If you want the order to be visible to the user in the orders kanban in the dashboard, create a fulfillment with the order details using Create Fulfillment.

    Note: Wix Restaurants fulfillments are automatically created with the "Pending" status.

Update Wix orders according to changes in an external POS system

To keep Wix Restaurants orders up to date with changes in an external POS:

  1. Create a mapping between your external POS system orders and Wix Restaurants orders to support syncing between them. Make sure to include all external IDs, such as order and item IDs in the mapping. Store this mapping on your servers.

  2. Listen to external events for changes to the POS.

  3. Update your mapping according to the changes.

  4. On any changes, update the relevant Wix order fulfillments by calling Update Fulfillment.

Did this help?