Skip to content

List all orders

Request

Retrieve a collection of orders with optional filtering and pagination.

Security
OAuth2(Required scopes: orders:read)
Query
filterstring

Filters the collection items using space-separated field:value pairs.

Filterable fields: customerName, status, totalPrice, createdAt, id

Format: field1:value1 field2:value2

Supported operators:

  • field:value - Exact match
  • field:value1,value2 - Match any of the comma-separated values (OR)
  • Time ranges (on createdAt): Use 30d (30 days), 7d (7 days), 1h (1 hour), etc.

Examples:

  • status:placed - Filter by a single status.
  • status:placed,completed - Filter by multiple statuses.
  • createdAt:30d - Orders created in the last 30 days.
  • id:ord_01h1s5z6vf2mm1mz3hevnn9va7 - Filter by a specific order ID.
  • status:placed createdAt:7d - Combine multiple filters.
Examples:
Created in the last 7 days
filter=createdAt:7d
sortstring

Sorts the collection by a single field. Prefix with - for descending order (for example, -createdAt); omit the prefix for ascending order (createdAt).

Sortable fields: customerName, status, totalPrice, createdAt, updatedAt, id

Examples:
Newest first
sort=-createdAt
limitinteger, [ 1 .. 100 ]

Specify the number of results per page. If there is more data, use in combination with after to page through all results.

Default:10
Examples:
Default page size
limit=10
afterstring

Cursor of the next page. page.nextPage contains it as the after query parameter, so you can also request page.nextPage directly. The cursor is opaque, and its internal structure is subject to change.

beforestring

Cursor of the previous page. page.previousPage contains it as the before query parameter, so you can also request page.previousPage directly. The cursor is opaque, and its internal structure is subject to change.

searchstring

Performs a case-insensitive text search across the searchable fields, returning items where any of them contain the search term as a substring.

Searchable fields: customerName, id

Examples:
Search term
search=Latte
curl -i -X GET \
  'https://cafe.redocly.com/_mock/openapi/cafe/orders?filter=createdAt%3A7d&sort=-createdAt&limit=10&after=string&before=string&search=Latte' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Successful operation.

Bodyapplication/json
objectstringrequired

Entity name.

Value:"list"
pageobject(Page)required
itemsArray of objects(Order)required
Response
{ "object": "list", "page": { "nextPage": "/menu?limit=10&after=G0EAAIyUqm8V", "previousPage": "/menu?limit=10&before=G0EAAIyUqm8W", "limit": 10 }, "items": [ { … } ] }