Skip to main content

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_ORDER or READ_WRITE_ORDER

Query Parameters​

ParameterTypeDescription
pageNumberPage number to return. Default is 1.
limitNumberNumber of orders per page. Default is 10.
entityIdStringFilter by order number.
entityId:inStringFilter by several order numbers, separated by commas.
idStringFilter by order ID.
id:inStringFilter by several order IDs, separated by commas.
orderStatusStringFilter by order status, for example pending.
orderStatus:inStringFilter by several order statuses, separated by commas.
paymentStatus:inStringFilter by one or more payment statuses, separated by commas, for example paid,partially paid.
approvedBooleantrue for approved orders, false for orders awaiting approval.
companyStringFilter by company ID.
company:inStringFilter by several company IDs, separated by commas.
customerStringFilter by customer ID.
customer:inStringFilter by several customer IDs, separated by commas.
date_created:minStringOrders created on or after this date.
date_created:maxStringOrders created on or before this date.
date_modified:minStringOrders updated on or after this date.
date_modified:maxStringOrders updated on or before this date.
metafields:<code>StringOrders whose metafield <code> has this value, for example metafields:erpOrderId=SO-88213.
metafields-in:<code>StringOrders 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​

FieldTypeDescription
pageNumberCurrent page number.
totalNumberTotal number of orders that match the filters.
countNumberNumber of orders on this page.

Notes​

  • Dates can be sent as YYYY-MM-DD or as a full ISO 8601 date and time.
  • Order and payment status values are listed in Get Order.