Skip to content

Create order

Request

Create a new order. Order items cannot be changed - if they need to be updated, cancel the order and place a new one.

Security
OAuth2(Required scopes: orders:write)
Bodyapplication/jsonrequired
customerNamestring, [ 1 .. 100 ] characters^[A-Za-z]+(?:[\s'-][A-Za-z]+)*$required

Name of the customer who placed the order. Must start and end with a letter, and can contain letters, spaces, hyphens, and apostrophes (e.g., "John Doe", "Mary-Jane", "O'Brien").

orderItemsArray of objects, non-emptyrequired

List of items to include in the order.

curl -i -X POST \
  https://cafe.redocly.com/_mock/openapi/cafe/orders \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "customerName": "Mary Ann",
    "orderItems": [
      {
        "menuItemId": "prd_01h1s5z6vf2mm1mz3hevnn9va7",
        "quantity": 2,
        "comment": "No sugar!",
        "discount": 0
      }
    ]
  }'

Responses

Order placed successfully.

Bodyapplication/json
idstring, (ulid)^ord_[0-9abcdefghjkmnpqrstvwxyz]{26}$read-only

Order ID. Unique identifier prefixed with ord_.

Example:"ord_01h1s5z6vf2mm1mz3hevnn9va7"
objectstringread-only

Entity name.

Value:"order"
customerNamestring, [ 1 .. 100 ] characters^[A-Za-z]+(?:[\s'-][A-Za-z]+)*$required

Name of the customer who placed the order. Must start and end with a letter, and can contain letters, spaces, hyphens, and apostrophes (e.g., "John Doe", "Mary-Jane", "O'Brien").

statusstring(OrderStatus)read-only

Order status.

Enum:"placed""preparing""completed""canceled"
totalPriceinteger, >= 0read-only

Total order price in cents.

createdAtstring, (date-time)read-only

Created date.

updatedAtstring, (date-time)read-only

Updated date.

orderItemsArray of objects, non-emptyrequired

List of items to include in the order.

Response
{ "id": "ord_01h1s5z6vf2mm1mz3hevnn9va7", "customerName": "Mary Ann", "orderItems": [ {} ], "object": "order", "status": "placed", "totalPrice": 200, "createdAt": "2026-08-24T14:15:22Z", "updatedAt": "2026-08-24T14:15:22Z" }