> 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: Introduction

## Article: Introduction

## Article Link: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/delivery-orders/introduction.md

## Article Content:

# About the Delivery Order API

The Delivery Order API lets you send Wix Restaurants delivery orders to a third-party delivery provider. The restaurant prepares the order, and the provider's courier picks it up and drops it off at the customer's address.

With the Delivery Order API, you can:

- Retrieve the delivery providers available to a restaurant, and check whether each one is ready to take deliveries.
- Schedule a delivery for an order with a delivery provider.
- Listen for an event when a delivery is scheduled.

The API currently supports a single delivery provider, DoorDash.

## Before you begin

It's important to note the following points before starting to code:

- The site must have the Wix Restaurants Orders app installed, and the delivery provider's app must be installed and set up. In the site dashboard, the restaurant connects its DoorDash account and completes the provider's setup, such as online payments and tips.
- The provider is set up per business location. A provider can be ready for one location and not for another.
- Schedule deliveries only for delivery orders whose fulfillment method uses the delivery provider. Don't send orders placed for pickup, dine-in, or the restaurant's own delivery to a provider.
- Don't send test orders to a delivery provider.

## Activation status

[List Delivery Providers](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/delivery-orders/list-delivery-providers.md) returns an activation status for each provider at a business location:

- `ACTIVE`: The provider is set up and can take deliveries.
- `INACTIVE`: The provider can serve the location, but the restaurant's setup isn't complete. For example, online payments or tips aren't set up, or the location is archived.
- `NOT_SUPPORTED`: The provider can't be used for the location. For example, the provider's app isn't installed, the location isn't set up with the provider, or the location's address is outside the provider's coverage area.

Schedule deliveries only with providers whose status is `ACTIVE`.

## Scheduling a delivery

[Schedule Delivery](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/delivery-orders/schedule-delivery.md) builds the delivery from the eCommerce order:

- The pickup location is the order's business location.
- The drop-off address is the order's shipping address.
- The order's delivery instructions are passed to the courier as pickup instructions. If the order has none, the courier pickup instructions set on the restaurant's delivery fulfillment method may be used instead.

Specify either a pickup time or a drop-off time. The time must be in the future. The provider estimates the other time and returns both in the response. The returned times can differ from the time you requested.

The delivery ID with the provider matches the Wix order ID, so each order can have a single delivery with a provider. A request for an order that already has a delivery can be rejected with the `DUPLICATE_DELIVERY_ID` reason.

When the provider rejects a delivery, the method returns a `DELIVERY_REJECTED` error. The error details list the reasons, such as a drop-off address outside the provider's coverage area or an invalid phone number. Fix the order details or choose a different time, then try again. An `UNKNOWN_REASON` can also mean that the order's business location isn't set up with the provider or that the provider didn't respond. Check the provider's activation status for the location before you retry.

## Use cases

- [Schedule a delivery for a new order](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/delivery-orders/sample-flows.md#schedule-a-delivery-for-a-new-order)
- [Show delivery providers in your app](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/delivery-orders/sample-flows.md#show-delivery-providers-in-your-app)

## Terminology

- **Delivery provider**: A third-party company, such as DoorDash, whose couriers deliver orders for the restaurant.
- **Delivery order**: A Wix Restaurants order that a delivery provider delivers to the customer.
- **Business location**: A physical location of the restaurant. Delivery providers are set up per location.
- **Activation status**: Whether a delivery provider is ready to take deliveries for a business location.
- **Pickup time**: When the courier collects the order from the restaurant.
- **Drop-off time**: When the courier delivers the order to the customer.

