> ## Documentation Index
> Fetch the complete documentation index at: https://platform.lulacommerce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect your order API

> Deliver marketplace and storefront orders straight into the order API your own app already uses.

If your stores already receive orders from your own mobile app through an order API, Lula can deliver orders from every other channel into that same API. Your kitchen PC, kitchen displays, and POS see a DoorDash or Lula Direct order exactly the way they see an order from your own app. Nothing new has to be installed in the store.

```mermaid theme={null}
flowchart LR
  DD[DoorDash] --> L[Lula]
  UE[Uber Eats] --> L
  GH[Grubhub] --> L
  LD[Lula Direct] --> L
  APP[Your mobile app] --> OAPI
  L -- order destination --> OAPI[Your order API]
  OAPI --> KPC[Kitchen PC] --> KDS[Kitchen displays]
  KPC -- accept, ready --> L
```

## Create a destination

```bash theme={null}
curl -X POST https://api.lulacommerce.com/v1/order-destinations \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Remote order API",
    "url": "https://orders.example.com/api/v2/remote-orders",
    "auth": {
      "type": "oauth2_client_credentials",
      "token_url": "https://login.example.com/oauth2/token",
      "client_id": "lula-orders",
      "client_secret": "REDACTED",
      "scope": "orders.write"
    },
    "payload_format": "custom_template",
    "order_id_path": "$.orderNumber"
  }'
```

Lula supports OAuth 2.0 client credentials, an API key header, or mutual TLS to call your API.

## Payload formats

* **`lula_order_v1`** sends the standard [order object](https://platform.lulacommerce.com/api-reference/orders/get-an-order.md), the same one webhooks carry.
* **`custom_template`** sends a payload mapped to your existing order contract, so your API does not need a new endpoint. Lula's integration team builds and tests the mapping with you against your sandbox.

## Delivery guarantees

* Lula retries until your API returns a `2xx`, with exponential backoff for up to 30 minutes.
* Requests carry an `Idempotency-Key` header with the Lula order ID, so a retry never creates a duplicate order in your system.
* The order number your API returns (found at `order_id_path`) is saved as `external_order_id`, so either system can look the order up by either ID.
* If delivery still fails, Lula emits `order.delivery_failed` and the order appears in the Lula store app, so no order is ever lost.
* `GET /order-destinations/{id}` reports success rate and latency for the last 24 hours.

## Limiting what is delivered

Filter a destination by `store_ids`, `channels`, or `stations`. For example, deliver only orders containing kitchen items to your kitchen order API, and let retail-only orders flow to the store app.

## Status back to the channel

Your kitchen systems report progress with the standard order calls (`accept`, `ready`, `complete`), using either the Lula order ID or your own. Lula relays each update to the marketplace, the customer, and the courier.

## Payment

Every delivered order includes a `payment` object. Marketplace and storefront orders are paid before they reach the store (`status: paid`), so your POS can release them without collecting payment. Tenders include card, wallet, EBT SNAP, loyalty, and gift card.

## Test it

`POST /order-destinations/{id}/test` sends a sample order and returns your API's response. In the sandbox, [simulate orders](https://platform.lulacommerce.com/concepts/sandbox.md) on any channel to see them arrive end to end.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.