The HTTP surface for creating and reading orders.
Submit a cart and create a new order.
| Name | In | Type | Description |
|---|---|---|---|
| idempotency-key | header | string | Safe-retry key |
| Field | Type | Description |
|---|---|---|
| items required | Item[] | Line items |
| coupon | string | Optional discount code |
| Status | Description | |
|---|---|---|
| 201 | Order created | |
| 400 | Invalid cart | |
| 401 | Missing or invalid token | |
{ "items": [{ "sku": "A1", "qty": 2 }] }
{ "id": "ord_123", "status": "pending" }
| Code | Meaning | When |
|---|---|---|
| 201 | Created | Order accepted |
| 400 | Bad request | Cart failed validation |
| 401 | Unauthorized | Missing or invalid token |