> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - 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/fulfillment-methods/sample-flows.md

## Article Content:

# Sample Flows

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

## Allow a restaurant owner to manage their site's fulfillment methods through an external app

A restaurant owner wants to manage its fulfillment method availability through an external app. Any changes made on the app must be synced to their Wix site and vice versa.

## Prerequisites

The site owner must do the following:

+ Install the Wix Restaurants Orders app.
+ Configure the fulfillment methods for the 3rd-party delivery providers.

## Flows

The following flows require a mapping from the fulfillment methods on Wix to the fulfillment methods in the external app. Create this mapping and store it on your app's server.
According to this mapping, you can sync the data between the app and the site using webhooks and API calls. 

**>Note:** Make sure to ignore webhooks resulting from calls you have triggered so that you don't create an endless loop of updates.

After creating the mapping, you can follow these two flows to create the two-way sync:

### Flow 1: Synchronizing to the external system

1. Sign up to the following fulfillment method webhooks to receive notifications about any changes to fulfillment methods on the Wix site. The webhooks are:
    + [Fulfillment Method Created](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/fulfillment-methods/fulfillment-method-created.md)
    + [Fulfillment Method Updated](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/fulfillment-methods/fulfillment-method-updated.md)
    + [Fulfillment Method Deleted](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/fulfillment-methods/fulfillment-method-deleted.md)
2. When one of the webhooks is triggered, update the corresponding fulfillment method in the external app according to the mapping.
3. Update the mapping to reflect any new or deleted fulfillment methods.

### Flow 2: Synchronizing to Wix

1. When a change is made to any of the fulfillment methods in the external app, find the `id` of the corresponding fulfillment method in Wix according to the mapping.
2. If the change is an update, use the `id` from step 1 to get the current revision of the corresponding fulfillment method object using [Get Fulfillment Method](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/fulfillment-methods/get-fulfillment-method.md). This is required when calling the Update fulfillment method endpoint on Wix.
3. Using the `id` from step 1, call the appropriate endpoint in the Fulfillment Methods API to update the information in Wix. The endpoints are:
   + [Create Fulfillment Method](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/fulfillment-methods/create-fulfillment-method.md)
   + [Update Fulfillment Method](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/fulfillment-methods/update-fulfillment-method.md)
   + [Delete Fulfillment Method](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/fulfillment-methods/delete-fulfillment-method.md)
4. Update the mapping to reflect any new or deleted fulfillment methods.