Order history
Fetch and display orders for a customer or contact in your portal. The orders query returns orders for the authenticated user automatically based on the access token. You do not need to pass a user ID. For B2B portals, use the companyIds filter to show all orders placed by colleagues within the same company.
For order status transitions and the overall lifecycle, see Understanding the order lifecycle. For shipment details, see Shipment tracking.
Listing orders
Use the orders query with the fields you need for a list view. The query returns a paginated response with order summaries.
Query
query Orders($input: OrderSearchArguments) {
orders(input: $input) {
items {
id
uuid
status
type
createdAt
currency
reference
companyId
total {
gross
net
tax
}
}
itemsFound
offset
page
pages
start
end
}
}
Variables
{
"input": {
"page": 1,
"offset": 10
}
}
Response
{
"data": {
"orders": {
"items": [
{
"id": 277,
"uuid": "019cb812-4a03-7128-a1f7-6e2d3b8c9f01",
"status": "NEW",
"type": "dropshipment",
"createdAt": "2026-02-22T21:23:00.402Z",
"currency": "EUR",
"reference": null,
"companyId": null,
"total": {
"gross": 695.08,
"net": 841.05,
"tax": 145.97
}
},
{
"id": 244,
"uuid": "019c7543-8693-7954-bdc5-76acae4f8c92",
"status": "CONFIRMED",
"type": "dropshipment",
"createdAt": "2026-02-19T09:38:05.649Z",
"currency": "EUR",
"reference": null,
"companyId": 4,
"total": {
"gross": 3528.88,
"net": 4269.94,
"tax": 741.06
}
},
{
"id": 126,
"uuid": "019b9e01-c2d4-7e12-b5a3-1f8d4c6e2a09",
"status": "QUOTATION",
"type": "quotation",
"createdAt": "2026-02-04T09:12:02.172Z",
"currency": "EUR",
"reference": null,
"companyId": 5,
"total": {
"gross": 1667.00,
"net": 2017.07,
"tax": 350.07
}
}
],
"itemsFound": 236,
"offset": 10,
"page": 1,
"pages": 24,
"start": 1,
"end": 10
}
}
}
The total.gross field is the order total excluding tax. The total.net field is the order total including tax.
The
datefield on orders is deprecated. UsecreatedAtinstead.
Pagination fields
| Field | Type | Description |
|---|---|---|
itemsFound | Int! | Total number of orders matching the filters |
offset | Int! | Number of items per page |
page | Int! | Current page number |
pages | Int! | Total number of pages |
start | Int! | Start position of the current page |
end | Int! | End position of the current page |
Pagination
Control the page size with offset and navigate pages with page. The default offset is 12.
Query
query OrdersPaginated($input: OrderSearchArguments) {
orders(input: $input) {
items {
id
status
createdAt
total {
gross
net
}
}
itemsFound
page
pages
}
}
Variables
{
"input": {
"page": 2,
"offset": 5
}
}
Response
{
"data": {
"orders": {
"items": [
{
"id": 242,
"status": "CONFIRMED",
"createdAt": "2026-02-09T12:40:24.081Z",
"total": {
"gross": 583.67,
"net": 706.24
}
},
{
"id": 243,
"status": "NEW",
"createdAt": "2026-02-09T14:21:37.188Z",
"total": {
"gross": 412.30,
"net": 498.88
}
}
],
"itemsFound": 236,
"page": 2,
"pages": 48
}
}
}
Sorting orders
Use the sortInputs field to control the order of results. Each sort input takes a field and an order (ASC or DESC).
Query
query OrdersSorted($input: OrderSearchArguments) {
orders(input: $input) {
items {
id
status
createdAt
total {
gross
}
}
itemsFound
}
}
Variables
{
"input": {
"sortInputs": [{ "field": "CREATED_AT", "order": "DESC" }],
"page": 1,
"offset": 3
}
}
Response
{
"data": {
"orders": {
"items": [
{
"id": 277,
"status": "NEW",
"createdAt": "2026-02-22T21:23:00.402Z",
"total": {
"gross": 695.08
}
},
{
"id": 244,
"status": "CONFIRMED",
"createdAt": "2026-02-19T09:38:05.649Z",
"total": {
"gross": 3528.88
}
},
{
"id": 243,
"status": "NEW",
"createdAt": "2026-02-09T14:21:37.188Z",
"total": {
"gross": 412.30
}
}
],
"itemsFound": 236
}
}
}
Sort fields
| Field | Description |
|---|---|
ID | Sort by order ID |
CREATED_AT | Sort by creation date |
LAST_MODIFIED_AT | Sort by last modification date |
STATUS | Sort by status alphabetically |
COMPANY | Sort by company name |
TOTAL_GROSS | Sort by order total (excluding tax) |
VALID_UNTIL | Sort by validity expiration date |
Filtering orders
The OrderSearchArguments input supports multiple filters. You can combine them in a single query.
By status
Pass one or more status codes to filter orders by their current status. Status codes are strings like NEW, CONFIRMED, QUOTATION and ARCHIVED. For all available statuses and their meaning, see Understanding the order lifecycle.
Query
query OrdersByStatus($input: OrderSearchArguments) {
orders(input: $input) {
items {
id
status
type
createdAt
total {
gross
net
}
}
itemsFound
}
}
Variables
{
"input": {
"status": ["CONFIRMED"],
"sortInputs": [{ "field": "CREATED_AT", "order": "DESC" }],
"page": 1,
"offset": 3
}
}
Response
{
"data": {
"orders": {
"items": [
{
"id": 244,
"status": "CONFIRMED",
"type": "dropshipment",
"createdAt": "2026-02-19T09:38:05.649Z",
"total": {
"gross": 3528.88,
"net": 4269.94
}
},
{
"id": 242,
"status": "CONFIRMED",
"type": "dropshipment",
"createdAt": "2026-02-09T12:40:24.081Z",
"total": {
"gross": 583.67,
"net": 706.24
}
}
],
"itemsFound": 66
}
}
}
By date range
Use the createdAt field with greaterThan and lessThan to filter by date range. Both values are date strings.
Variables
{
"input": {
"createdAt": {
"greaterThan": "2026-02-01",
"lessThan": "2026-02-28"
}
}
}
You can also use lastModifiedAt with the same greaterThan and lessThan structure to filter by when orders were last updated.
By company (B2B)
For B2B portals where contacts can view orders placed by anyone in their company, filter by companyIds. In B2B, orders belong to the company, not the individual. A procurement manager needs to see all orders placed by any contact in the company to track spending across departments and follow up on deliveries. The companyIds filter enables this company-wide view. Without it, a contact only sees their own orders.
Variables
{
"input": {
"companyIds": [4],
"page": 1,
"offset": 3
}
}
Response
{
"data": {
"orders": {
"items": [
{
"id": 244,
"status": "CONFIRMED",
"createdAt": "2026-02-19T09:38:05.649Z",
"companyId": 4
},
{
"id": 243,
"status": "NEW",
"createdAt": "2026-02-09T14:21:37.188Z",
"companyId": 4
}
],
"itemsFound": 117
}
}
}
By order type
Filter by type to separate regular orders from quotations or other order types.
| Type | Description |
|---|---|
dropshipment | Standard order |
purchase | Purchase order |
quotation | Quotation or price request |
stock | Stock order |
Variables
{
"input": {
"type": ["quotation"]
}
}
By price range
Use the price field to filter orders by their total. The price input supports greaterThan, lessThan and equal.
Variables
{
"input": {
"price": {
"greaterThan": 500,
"lessThan": 5000
}
}
}
By channel
The orders query returns orders from all channels by default. In multi-channel setups where the same user may have orders across different storefronts, pass channelId as an input parameter to filter orders to a specific channel.
Searching orders
Use term with termFields to search across order data. The term performs a text search and termFields specifies which fields to match against. If termFields is omitted, the search runs across multiple fields.
Query
query SearchOrders($input: OrderSearchArguments) {
orders(input: $input) {
items {
id
status
createdAt
items {
name
sku
quantity
}
}
itemsFound
}
}
Variables
{
"input": {
"term": "EcoSpot",
"termFields": ["ITEM_NAME"]
}
}
Response
{
"data": {
"orders": {
"items": [
{
"id": 244,
"status": "CONFIRMED",
"createdAt": "2026-02-19T09:38:05.649Z",
"items": [
{
"name": "EcoSpot Recessed Downlight",
"sku": "EL-ESD1",
"quantity": 10
},
{
"name": "Eclipse Elite LED Desk Lamp",
"sku": "LL-EEDL01",
"quantity": 5
}
]
},
{
"id": 243,
"status": "NEW",
"createdAt": "2026-02-09T14:21:37.188Z",
"items": [
{
"name": "Hidden Glow Wall Washer",
"sku": "GT-HGW1",
"quantity": 1
},
{
"name": "EcoSpot Recessed Downlight",
"sku": "EL-ESD1",
"quantity": 1
}
]
}
],
"itemsFound": 21
}
}
}
Search fields
The most commonly used search fields for a customer portal:
| Field | Description |
|---|---|
ID | Order ID |
REFERENCE | Customer reference number |
ITEM_NAME | Product name on the order line |
ITEM_SKU | Product SKU on the order line |
RECIPIENT_FIRST_NAME | First name on the delivery address |
RECIPIENT_LAST_NAME | Last name on the delivery address |
RECIPIENT_COMPANY | Company name on the delivery address |
REMARKS | Order remarks |
Other available fields include INVOICE_ADDRESS_COMPANY, INVOICE_ADDRESS_FIRST_NAME, INVOICE_ADDRESS_LAST_NAME, RECIPIENT_EMAIL, ITEM_EAN_CODE, ITEM_MANUFACTURER, ITEM_SUPPLIER, ACCOUNTING_ID and DEBTOR_ID.
Fetching a single order
By order ID
Use the order query to fetch full details for a single order. This includes items, addresses, totals, shipping and payment data.
Query
query OrderDetail($orderId: Int!) {
order(orderId: $orderId) {
id
uuid
status
type
createdAt
lastModifiedAt
email
reference
remarks
currency
language
companyId
total {
gross
net
tax
discountType
discountValue
taxPercentages {
percentage
total
}
}
items {
id
class
productId
sku
name
quantity
price
priceNet
priceTotal
priceTotalNet
tax
taxPercentage
discount
originalPrice
notes
product {
productId
names {
value
language
}
sku
slugs {
value
language
}
}
}
deliveryAddress: addresses(type: delivery) {
firstName
middleName
lastName
company
street
number
numberExtension
postalCode
city
region
country
phone
email
}
invoiceAddress: addresses(type: invoice) {
firstName
middleName
lastName
company
street
number
numberExtension
postalCode
city
region
country
phone
email
}
postageData {
method
gross
net
tax
taxPercentage
carrier
partialDeliveryAllowed
requestDate
}
paymentData {
method
status
gross
net
tax
taxPercentage
}
}
}
Variables
{
"orderId": 244
}
Response
{
"data": {
"order": {
"id": 244,
"uuid": "019c7543-8693-7954-bdc5-76acae4f8c92",
"status": "CONFIRMED",
"type": "dropshipment",
"createdAt": "2026-02-19T09:38:05.649Z",
"lastModifiedAt": "2026-02-19T09:53:41.263Z",
"email": "lisa@brouwerindustrie.nl",
"reference": null,
"remarks": null,
"currency": "EUR",
"language": "NL",
"companyId": 4,
"total": {
"gross": 3528.88,
"net": 4269.94,
"tax": 741.06,
"discountType": "N",
"discountValue": 0,
"taxPercentages": [
{
"percentage": 21,
"total": 741.06
}
]
},
"items": [
{
"id": 26987,
"class": "product",
"productId": 44,
"sku": "EL-ESD1",
"name": "EcoSpot Recessed Downlight",
"quantity": 10,
"price": 309.14,
"priceNet": 374.06,
"priceTotal": 3091.42,
"priceTotalNet": 3740.62,
"tax": 649.20,
"taxPercentage": 21,
"discount": 33.40,
"originalPrice": 342.54,
"notes": "",
"product": {
"productId": 44,
"names": [
{
"value": "EcoSpot Recessed Downlight",
"language": "NL"
}
],
"sku": "EL-ESD1",
"slugs": [
{
"value": "ecospot-recessed-downlight",
"language": "NL"
}
]
}
},
{
"id": 26992,
"class": "product",
"productId": 12,
"sku": "LL-EEDL01",
"name": "Eclipse Elite LED Desk Lamp",
"quantity": 5,
"price": 85.49,
"priceNet": 103.44,
"priceTotal": 427.45,
"priceTotalNet": 517.22,
"tax": 89.77,
"taxPercentage": 21,
"discount": 4.50,
"originalPrice": 89.99,
"notes": "",
"product": {
"productId": 12,
"names": [
{
"value": "Eclipse Elite LED Desk Lamp",
"language": "NL"
}
],
"sku": "LL-EEDL01",
"slugs": [
{
"value": "eclipse-elite-led-desk-lamp",
"language": "NL"
}
]
}
}
],
"deliveryAddress": [
{
"firstName": "Lisa",
"middleName": null,
"lastName": "de Vries",
"company": "Brouwer Industrie",
"street": "Keizersgracht",
"number": "112",
"numberExtension": null,
"postalCode": "1016 GE",
"city": "Amsterdam",
"region": null,
"country": "NL",
"phone": "+31 20 123 4567",
"email": "lisa@brouwerindustrie.nl"
}
],
"invoiceAddress": [
{
"firstName": "Lisa",
"middleName": null,
"lastName": "de Vries",
"company": "Brouwer Industrie",
"street": "Keizersgracht",
"number": "112",
"numberExtension": null,
"postalCode": "1016 GE",
"city": "Amsterdam",
"region": null,
"country": "NL",
"phone": "+31 20 123 4567",
"email": "finance@brouwerindustrie.nl"
}
],
"postageData": {
"method": "REGULAR",
"gross": 10.00,
"net": 12.10,
"tax": 2.10,
"taxPercentage": 21,
"carrier": null,
"partialDeliveryAllowed": "N",
"requestDate": "2026-02-06T09:20:53.728Z"
},
"paymentData": {
"method": "ACCOUNT",
"status": "UNKNOWN",
"gross": 0,
"net": 0,
"tax": 0,
"taxPercentage": 21
}
}
}
}
By UUID
You can also fetch an order by its UUID using the orderUUID parameter. This is useful when you use UUIDs in your frontend URLs instead of numeric IDs.
query OrderByUUID($orderUUID: String!) {
order(orderUUID: $orderUUID) {
id
status
createdAt
}
}
{
"orderUUID": "019c7543-8693-7954-bdc5-76acae4f8c92"
}
Response
{
"data": {
"order": {
"id": 244,
"status": "CONFIRMED",
"createdAt": "2026-02-19T09:38:05.649Z"
}
}
}
The order query accepts either orderId or orderUUID. You do not need to provide both.
Order items
Each order contains an items array with all order lines. Items have a class field that indicates what type of line item it is.
| Class | Description |
|---|---|
product | A product the customer ordered |
incentive | A bonus or free item added by a promotion |
surcharge | An additional fee (handling, small order surcharge) |
When displaying items in a portal, you will typically show all items but may want to visually distinguish incentives and surcharges from regular products.
Item pricing
Each item carries both unit and total pricing, with and without tax.
| Field | Description |
|---|---|
price | Unit price excluding tax |
priceNet | Unit price including tax |
priceTotal | Total price excluding tax (price x quantity) |
priceTotalNet | Total price including tax |
tax | Total tax amount for this item |
taxPercentage | Tax percentage applied |
Discounts
If an item has a discount applied, the discount field contains the discount amount per unit and originalPrice contains the price before the discount was applied. When discount is null or 0, no discount was applied.
Linking to product pages
Use the product field on each item to get the product's slugs for building links to product detail pages. The product field returns null if the product has been deleted from the catalog since the order was placed.
Order totals
The total field provides the financial summary for the entire order.
| Field | Type | Description |
|---|---|---|
gross | Float! | Order total excluding tax |
net | Float! | Order total including tax |
tax | Float! | Total tax amount |
discountType | OrderDiscountType! | Discount type: N (none), P (percentage), A (absolute) |
discountValue | Float! | Discount value (percentage or absolute amount, depending on discountType) |
taxPercentages | [OrderTotalTaxPercentage!]! | Tax breakdown per rate |
The taxPercentages array lists each tax rate applied to the order with its total. This is useful for invoices where you need to show the tax breakdown by rate.
{
"taxPercentages": [
{
"percentage": 21,
"total": 741.06
}
]
}
Addresses
The addresses field on an order accepts a type argument to filter by address type: delivery, invoice or home. Use GraphQL aliases to fetch both delivery and invoice addresses in a single query.
deliveryAddress: addresses(type: delivery) {
firstName
middleName
lastName
company
street
number
numberExtension
postalCode
city
country
}
invoiceAddress: addresses(type: invoice) {
firstName
middleName
lastName
company
street
number
numberExtension
postalCode
city
country
}
The addresses field returns an array because an order can technically have multiple addresses of the same type. In most cases there is one delivery address and one invoice address.
If you need all addresses without filtering by type, use the
orderAddressesfield instead. This returns[OrderAddress!]!with atypefield on each address.
Shipping and payment summary
The postageData and paymentData fields contain the shipping and payment details set during checkout.
postageData fields
| Field | Type | Description |
|---|---|---|
method | String! | Shipping method name |
gross | Float! | Shipping cost excluding tax |
net | Float! | Shipping cost including tax |
tax | Float! | Tax on shipping costs |
taxPercentage | Float! | Tax percentage for shipping |
carrier | String | Selected carrier name |
requestDate | DateTime | Requested delivery date |
partialDeliveryAllowed | YesNo | Whether partial delivery is allowed (Y or N) |
paymentData fields
| Field | Type | Description |
|---|---|---|
method | String! | Payment method name |
status | String | Payment status |
gross | Float! | Transaction cost excluding tax |
net | Float! | Transaction cost including tax |
tax | Float! | Tax on transaction costs |
taxPercentage | Float! | Tax percentage for transaction costs |
For full payment tracking with individual transactions, see Payment integration. For shipment tracking with carrier details and tracking codes, see Shipment tracking.
Next steps
- Shipment tracking for tracking shipments and displaying carrier information
- Reordering to let customers reorder from previous orders
- Understanding the order lifecycle for order statuses and transitions
- Payment integration for payment processing and transaction tracking