> ## 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.

# Placing orders

> End-to-end checkout flow from menu to kitchen ticket in your owned channel.

This guide walks through how a customer order moves from your app or web channel into Fire spark and then into the merchant kitchen — in language that works for developers and for teams explaining the process to stakeholders.

## The journey in plain terms

1. **Browse** — The customer picks a store, channel context, and fulfillment type, then loads the [composed menu](/docs/storefront-api/menus/get) for that combination.
2. **Checkout** — Your channel collects items, payment, and delivery details.
3. **Submit** — Your server calls [Create order](/docs/storefront-api/customers/\[id]/orders/post) with an external order id you control.
4. **Route** — Fire spark validates the order, records payment and fulfillment state, and notifies the merchant's POS integration.
5. **Kitchen** — When the integration receives [`order.injected`](/docs/integrations-api/orders/webhooks), it creates the ticket in the POS **with the order exactly as Fire spark stored it** at that moment.
6. **Track** — Poll or subscribe to status via [Get order](/docs/storefront-api/customers/\[id]/orders/\[id]/get) while the customer waits for updates from your UI.

## Prerequisites

* Customer registered and authenticated via [Token exchange](/docs/storefront-api/oauth/exchange/post)
* Store, channel, and fulfillment ids from [List stores](/docs/storefront-api/stores/get) and [List fulfillment](/docs/storefront-api/fulfillment/get)
* Menu loaded for the same store, channel, and fulfillment triple

## Step 1 — Build the cart from the menu

Use product and modifier ids from the composed menu response. Those same external ids appear on order line items and on POS tickets after injection.

```json Example cart item theme={null}
{
  "id": "burger-classic",
  "quantity": 1,
  "modifiers": [
    { "id": "cola", "quantity": 1 }
  ]
}
```

## Step 2 — Choose ids before checkout

Assign the order id on your server **before** calling POST. This makes retries safe if the client loses connectivity.

```javascript theme={null}
const orderId = `ord-${crypto.randomUUID().slice(0, 8)}`;
```

## Step 3 — Create the order

```bash theme={null}
curl -X POST "https://firespark.cloud/api/storefront/v1/customers/cust-001/orders" \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "ord-48291",
    "store_id": "downtown",
    "channel_id": "app",
    "fulfillment_id": "delivery",
    "items": [
      { "id": "burger-classic", "quantity": 1, "modifiers": [] }
    ]
  }'
```

Fire spark responds with the order object including `payment_status`, `fulfillment_status`, and `status`.

## Step 4 — What happens in the back office

You do not call the Integrations API from the storefront. After creation:

| Stage        | What Fire spark does                                                                       |
| ------------ | ------------------------------------------------------------------------------------------ |
| Validation   | Confirms items exist on the menu for that store, channel, and fulfillment                  |
| Storage      | Persists lines, totals, customer, and payment intents                                      |
| Notification | Sends webhooks to the merchant POS integration                                             |
| Injection    | On `order.injected`, delivers the full order payload so the POS creates the kitchen ticket |

<Info>
  **For marketing and ops:** The customer sees confirmation as soon as your
  channel receives `201` from Create order. The kitchen sees the ticket when
  the POS integration handles `order.injected` — usually seconds later, depending
  on merchant configuration.
</Info>

## Step 5 — Show status to the customer

Poll [Get order](/docs/storefront-api/customers/\[id]/orders/\[id]/get) or refresh from your own realtime layer as `fulfillment_status` moves from `IDLE` → `PREPARING` → `PREPARED` → `DELIVERED`.

| Status field                                             | Customer-facing copy (examples) |
| -------------------------------------------------------- | ------------------------------- |
| `payment_status: PENDING`                                | Confirming payment…             |
| `payment_status: PAID` + `fulfillment_status: PREPARING` | Your order is being prepared    |
| `fulfillment_status: PREPARED`                           | Ready for pickup / On the way   |
| `status: COMPLETED`                                      | Delivered — thanks!             |

## Step 6 — Cancel if needed

If the customer cancels before the order is fulfilled, call [Cancel order](/docs/storefront-api/customers/\[id]/orders/\[id]/delete). Fire spark propagates cancellation to the POS integration.

## Related endpoints

<CardGroup cols={2}>
  <Card title="Create order" icon="plus" href="/docs/storefront-api/customers/[id]/orders/post">
    Submit checkout
  </Card>

  <Card title="List orders" icon="list" href="/docs/storefront-api/customers/[id]/orders/get">
    Order history
  </Card>

  <Card title="Order webhooks" icon="webhook" href="/docs/integrations-api/orders/webhooks">
    How orders reach the POS
  </Card>

  <Card title="Orders concept" icon="shopping-cart" href="/docs/concepts/orders">
    Commercial overview
  </Card>
</CardGroup>
