Fetch order history with status filtering
Query past orders for the logged-in contact, filtered by status with pagination.
Query
query GetOrders($status: [String!], $page: Int, $offset: Int) {
orders(input: { status: $status, page: $page, offset: $offset }) {
items {
id
status
createdAt
reference
total {
gross
net
tax
}
items {
id
productId
name
quantity
}
}
itemsFound
page
pages
}
}
Variables
{
"status": ["NEW", "CONFIRMED"],
"page": 1,
"offset": 10
}
Response
{
"data": {
"orders": {
"items": [
{
"id": "ord-12345",
"status": "CONFIRMED",
"createdAt": "2025-01-15T10:30:00.000Z",
"reference": "PO-2025-0042",
"total": { "gross": 1250.00, "net": 1512.50, "tax": 262.50 },
"items": [
{ "id": "item-1", "productId": 1895, "name": "HP ProBook 450 G10 i5", "quantity": 1 }
]
}
],
"itemsFound": 24,
"page": 1,
"pages": 3
}
}
}
How it works
Available filters: status, createdAt, price, userId, companyIds, type (e.g., dropshipment, purchase, quotation). You can filter by date range with createdAt: { greaterThan: "2024-01-01", lessThan: "2024-12-31" } or by company with companyIds: [678] for B2B use cases.
See also
- Order history — full guide on order history, details and filtering