> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: Sample Flows ## Article: Sample Flows ## Article Link: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/sample-flows.md ## Article Content: # 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](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/orders/order-created.md) and [Order Approved](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/orders/order-approved.md) 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: ```json "catalogReference": { "catalogItemId": "d0d5a022-26d5-4203-828f-94798735812a", "appId": "9a5d83fd-8570-482e-81ab-cfa88942ee60", "options": { "operationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "menuId": "550e8400-e29b-41d4-a716-446655440000", "sectionId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "onlineOrderingPageUrl": "/online-ordering" } } ``` See the full [Order Object](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/orders/order-object.md) 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](https://dev.wix.com/docs/rest/business-management/locations/list-locations.md) 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](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/orders/create-order.md) with restaurants catalog references. You must specify the following in `catalogReference`: - `catalogItemId`: The ID of the [item](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/menus/items/items/item-object.md). - `appId`: The Wix Restaurants Orders appId, `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`. - `options.operationId`: The `operationId` of the [operation](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/operations/introduction.md) the item is being ordered from. - `options.menuId`: The `menuId` of the [menu](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/menus/menus/introduction.md) the item is being ordered from. - `options.sectionId`: The `sectionId` of the [section](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/menus/sections/introduction.md) 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. ```json { "lineItems": [ { "catalogReference": { "catalogItemId": "d0d5a022-26d5-4203-828f-94798735812a", "appId": "9a5d83fd-8570-482e-81ab-cfa88942ee60", "options": { "operationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "menuId": "ee71e79b-58cc-4372-a123-0e02b2450d490", "sectionId": "e231weob-58cc-1102-a123-0111b2450e020", "onlineOrderingPageUrl": "/online-ordering" } }, "quantity": 1 } ] } ``` 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](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/order-fulfillments/create-fulfillment.md). > **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](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/order-fulfillments/update-fulfillment.md).