> 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/operations/sample-flows.md

## Article Content:

# Operations API: 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.

## Show the earliest pickup and delivery times

You're building a restaurant ordering page and want to show customers how soon they can get their order, before they add anything to the cart. The delivery time depends on the customer's address, so you ask for the address first.

To show the earliest pickup and delivery times:

1. Call [Query Operation](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/operations/query-operation.md) to retrieve the operations of the restaurant's business location, filtering by `businessLocationId`. A business location has one operation for each operation group, such as takeaway and catering. Choose the operation the page is for, for example by `name`, and save its `id`.
1. Ask the customer for their delivery address.
1. Call [Calculate First Available Time Slot Per Fulfillment Type](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/operations/calculate-first-available-time-slot-per-fulfillment-type.md) with the operation ID and the customer's address in `deliveryAddress`.
1. For each item in `timeslotsPerFulfillmentType`, display the fulfillment type and its `timeSlot.startTime` and `timeSlot.endTime`. If no delivery time slot is returned, the restaurant either doesn't deliver to the customer's address or has no delivery time slot available.

## Let customers schedule an order for a later date

You're building a catering storefront where customers order days in advance. Customers pick a date and a time slot on that date, and the order is placed for that time slot.

To let customers schedule an order for a later date:

1. Call [Query Operation](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/operations/query-operation.md) to retrieve the catering operation, filtering by `businessLocationId` and choosing the operation by `name`. Save its `id`.
1. Let the customer choose pickup or delivery. For delivery, ask for the customer's delivery address.
1. Call [Calculate Available Dates In Range](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/operations/calculate-available-dates-in-range.md) with the operation ID and a `from` and `until` date range, such as the next 14 days. For delivery, specify the customer's address in `deliveryAddress`.
1. Display the dates in `availableDatesPerFulfillmentType` for the fulfillment type the customer chose, and let the customer select one.
1. Call [Calculate Available Time Slots For Date](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/operations/calculate-available-time-slots-for-date.md) with the operation ID, the selected date, and for delivery, the same `deliveryAddress`.
1. Display the returned time slots and let the customer select one.
1. Call [Add Line Items To Current Cart](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/cart-v2/add-line-items-to-current-cart.md) with the customer's items. For each item, specify the Wix Restaurants Orders app ID, `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`, in `catalogReference.appId`, and the operation ID, menu ID, and menu section ID in `catalogReference.options` as `operationId`, `menuId`, and `menuSectionId`.
1. Call [Update Current Cart](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/cart-v2/update-current-cart.md) to set the cart's address in `cart.deliveryInfo.address`. You can't set a delivery method on a cart without an address, even for pickup. For pickup, the restaurant's country is enough. For delivery, specify the customer's address.
1. Call [Set Delivery Method For Current Cart](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/cart-v2/set-delivery-method-for-current-cart.md) with the code of the selected time slot:
    - If the time slot's `orderSchedulingType` is `ASAP`, use `"<TYPE>|ASAP"`. For example, `"PICKUP|ASAP"`.
    - Otherwise, use `"<TYPE>|<startTime>|<endTime>"`, with the time slot's `timeSlot.startTime` and `timeSlot.endTime` converted to epoch milliseconds. For example, `"PICKUP|1766433600000|1766435400000"`.

For the checkout steps, see [Place an order from a custom storefront](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/sample-flows.md).

## Pause online ordering for a few hours

You're building a dashboard app for restaurant staff. When the kitchen is overwhelmed, staff can pause online ordering for a set time. Ordering resumes automatically when that time passes, so choose the resume time carefully: setting `onlineOrderingStatus` back to `ENABLED` doesn't end the pause early.

To pause online ordering for a few hours:

1. Call [Get Operation](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/operations/get-operation.md) to retrieve the operation. Save its `revision`.
1. Call [Update Operation](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/operations/update-operation.md) with the operation's `id` and `revision`, `onlineOrderingStatus` set to `PAUSED_UNTIL`, and the time to resume ordering in `pausedUntilOptions.time`. For example:

    ```json
    {
      "operation": {
        "id": "48605ac5-53fc-49b4-96b2-87f7636f5ce0",
        "revision": "4",
        "onlineOrderingStatus": "PAUSED_UNTIL",
        "pausedUntilOptions": {
          "time": "2025-12-10T18:00:00Z"
        }
      }
    }
    ```