Get All Orders
Retrieves a list of orders, page by page. You can filter by order number, status, customer, company, approval, dates and metafield values.
HTTP Request
- URL:
/orders - Method:
GET - Headers:
accessToken: Required. Your API access token.
- Required scope:
READ_ORDERorREAD_WRITE_ORDER
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | Number | Page number to return. Default is 1. |
limit | Number | Number of orders per page. Default is 10. |
entityId | String | Filter by order number. |
entityId:in | String | Filter by several order numbers, separated by commas. |
id | String | Filter by order ID. |
id:in | String | Filter by several order IDs, separated by commas. |
orderStatus | String | Filter by order status, for example pending. |
orderStatus:in | String | Filter by several order statuses, separated by commas. |
paymentStatus:in | String | Filter by one or more payment statuses, separated by commas, for example paid,partially paid. |
approved | Boolean | true for approved orders, false for orders awaiting approval. |
company | String | Filter by company ID. |
company:in | String | Filter by several company IDs, separated by commas. |
customer | String | Filter by customer ID. |
customer:in | String | Filter by several customer IDs, separated by commas. |
date_created:min | String | Orders created on or after this date. |
date_created:max | String | Orders created on or before this date. |
date_modified:min | String | Orders updated on or after this date. |
date_modified:max | String | Orders updated on or before this date. |
metafields:<code> | String | Orders whose metafield <code> has this value, for example metafields:erpOrderId=SO-88213. |
metafields-in:<code> | String | Orders whose metafield <code> has any of these comma-separated values. |
cURL Example
curl --location '<BASE_URL>/orders?page=1&limit=20&orderStatus:in=pending,processing&date_modified:min=2024-05-01' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The list of orders was returned successfully.
- 400 Bad Request: The access token is missing or invalid, or a filter value is not valid.
Sample JSON Response
{
"success": true,
"data": [
{
"id": "664f2310d5775459152d6dd8",
"entityId": "ORD-1042",
"company": "664dec6cd5775459152d4922",
"customer": "664dec6cd5775459152d4926",
"customerDetails": {
"firstName": "Maria",
"lastName": "Lopez",
"email": "maria.lopez@northwindsupply.com",
"phoneNumber": "512-555-0142"
},
"orderedAt": "2024-05-23T11:05:52.545Z",
"lineItems": [
{
"id": "664f2310d5775459152d6ddb",
"productId": "663a0cbe516313e5bc94ab30",
"name": "Safety Glasses",
"sku": "SFTY-4006",
"quantity": 12,
"price": 45,
"extendedTotalPrice": 540,
"fulfilledQuantity": 0,
"returned": false
}
],
"currency": { "currency": "USD", "symbol": "$" },
"payments": [],
"fulfilledItems": [],
"paymentStatus": "unpaid",
"orderStatus": "pending",
"shippingCost": 12,
"taxAmount": 0,
"subTotal": 540,
"total": 552,
"approved": true,
"metaFields": [],
"createdAt": "2024-05-23T11:05:52.550Z",
"updatedAt": "2024-05-23T11:05:52.550Z"
}
],
"pagination": {
"page": 1,
"total": 37,
"count": 1
}
}
Response Details
Order Data
Each item in data is an order. See Get Order for the full list of order fields.
Pagination Details
| Field | Type | Description |
|---|---|---|
page | Number | Current page number. |
total | Number | Total number of orders that match the filters. |
count | Number | Number of orders on this page. |
Notes
- Dates can be sent as
YYYY-MM-DDor as a full ISO 8601 date and time. - Order and payment status values are listed in Get Order.