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

# Update order

> Modify an open customer order before it is sent to the kitchen.

Updates fields on an order that is still `OPEN`. Use this while the customer edits the cart.

> [!NOTE]
>
> Requires a Storefront API access token from [Token
> exchange](https://firespark.cloud/docs/storefront-api/oauth/exchange/post.md).

> [!WARNING]
>
> Once Fire spark fires [`order.status.changed`](https://firespark.cloud/docs/integrations-api/orders/webhooks)
> to the merchant POS, the operational ticket may already exist. Avoid PATCH
> after kitchen handoff unless your channel supports those edits.

## Path parameters

| Parameter | Required | Description |
| - | - | - |
| `id` | Yes | External order identifier |

## Request body

| Field | Required | Type | Description |
| - | - | - | - |
| `lines` | No | array | Full replacement of priced order lines |
| `totals` | No | object | Recomputed order totals |
| `store_id` | No | string | Updated store scope |
| `channel_id` | No | string | Updated channel scope |
| `fulfillment_id` | No | string | Updated fulfillment scope |
| `brand_id` | No | string \| null | Updated brand scope |
| `customer` | No | object | Updated customer snapshot |
| `metadata` | No | object | Channel-specific metadata |
| `redeem` | No | array | Full replacement of order redeems. Each needs `payment_id` and `amount` |
| `redemption_steps` | No | array | Applied redeems in order. The server recomputes and stores them on every cart change. |

Tenders are not on this body. Save them with [Save payment intent](https://firespark.cloud/docs/storefront-api/orders/\[id]/payment-intent/put). `payment_status` is derived from those tenders.

## Request

```bash theme={null}
curl -X PATCH "https://firespark.cloud/api/storefront/v1/orders/ord-48291" \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "lines": [
      {
        "type": "PRODUCT",
        "uid": "11111111-1111-1111-1111-111111111111",
        "id": "burger-classic",
        "parent_uid": null,
        "parent_id": null,
        "name": "Classic Burger",
        "quantity": 2,
        "tax_rate": 0.15,
        "discount_rate": 0,
        "unit_subtotal": 12.99,
        "unit_discount": 0,
        "unit_tax_total": 1.95,
        "unit_total": 14.94,
        "subtotal": 25.98,
        "discount_total": 0,
        "tax_total": 3.9,
        "total": 29.88,
        "unit_group_subtotal": 12.99,
        "unit_group_discount": 0,
        "unit_group_tax_total": 1.95,
        "unit_group_total": 14.94,
        "group_subtotal": 25.98,
        "group_discount": 0,
        "group_tax_total": 3.9,
        "group_total": 29.88,
        "metadata": {}
      }
    ],
    "totals": {
      "currency": "USD",
      "subtotal": 25.98,
      "discount_rate": 0,
      "discount_total": 0,
      "tax_rate": 0.15,
      "tax_total": 3.9,
      "total": 29.88
    }
  }'
```

## Response

Returns the updated order in `data`.

## Error responses

| Status | Description |
| - | - |
| `401` | Missing or invalid access token |
| `404` | Order not found |
| `422` | Order is not `OPEN` or body is invalid |


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