List orders#
Use the orders query to fetch a paginated list of orders from your Afosto account. Requires a valid API key — see Authentication.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
first | Int | Optional | Number of orders to return.Default: 10 |
after | String | Optional | Cursor for forward pagination — use `endCursor` from the previous page. |
before | String | Optional | Cursor for backward pagination. |
email | String | Optional | Filter by customer email address. |
number | NumberFilter▾ | Optional | Filter by one or more order numbers. |
id | IdFilter▾ | Optional | Filter by one or more order IDs. |
progress | OrderProgressFilter▾ | Optional | Filter by order progress state. |
created_at | InequalityFilter▾ | Optional | Filter by creation date. |
Returns: Order
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
number | String! | Required | Order number |
total | Money!▾ | Required | Total value |
currency | Currency!▾ | Required | Currency code |
Example#
Notes#
Moneyvalues are returned as integers in cents — use thecurrencyfield andformattedsub-field for display.DateTimevalues are Unix timestamps in milliseconds — divide by 1000 for a standard Unix timestamp.- Use
endCursorfrompageInfoas theafterargument on your next request to fetch the next page. - To filter by order number, pass
number: { values: ["ORD-1234", "ORD-1235"] }as an argument.