Skip to content

Orders API Overview

The Orders API lets you retrieve and manage orders. You can fetch a single order in full detail, list orders that a customer either placed or was sold to, check which actions are currently allowed on an order, and cancel an open order.

All request/response examples use placeholder values; field names and types match what the API returns.


https://<store-url>/public/orders/v1

<store-url> is the base URL issued to your store, per environment (sandbox / production). See Getting Started → Base URL for the full list of hosts. All paths below are relative to it.


Every request must be authenticated. You need two credentials on each call:

Header Value Purpose
Authorization Bearer <access_token> OAuth 2.0 JWT access token
Ocp-Apim-Subscription-Key <your-subscription-key> Identifies your subscription at the API gateway
  • The access token must carry the order:read scope. A token without it is rejected with 403 Forbidden.
  • The cancel endpoint additionally requires the order:write scope.
  • Tokens are short-lived (typically 30–60 minutes). Request a new token when the old one expires.
  • For details on obtaining a token, supported authorities, and the claims involved, see Getting Started → Authentication.

Beyond the scope check, per-order access control applies: you only see orders your account is entitled to (orders you own, placed, or have an explicit relationship with). Requesting an order you are not entitled to returns 403 Forbidden; in list responses such orders are silently omitted (see Pagination).


  • Format: JSON only (Accept: application/json). Field names are camelCase.
  • Enums are serialized as strings (e.g. "Completed", "PHYSICAL_ITEM"), never as numbers.
  • Timestamps are ISO 8601 with an explicit UTC offset, e.g. 2026-05-01T09:32:00+02:00.
  • Money (gross / net / vat) is expressed in the order’s currency. gross = net + vat.
  • Nullable fields are present in the payload with a null value when not applicable.
  • Each response carries an X-Trace-Id header. Quote it when contacting support — it lets us correlate your request with our logs.

Method Path Description
GET /orders/v1/{orderId} Retrieve one order in full detail
GET /orders/v1/{orderId}/allowed-actions Check which actions are currently allowed on an order
PATCH /orders/v1/{orderId}/cancel Cancel an open order
GET /orders/v1/list/placed-by/{placedByCustomerId} List orders placed by a customer (summaries)
GET /orders/v1/list/sold-to/{soldToCustomerId} List orders sold to a customer (summaries)

The two list endpoints return order summaries (OrderSearchResult), not full orders. They differ only in which party the path customerId refers to:

  • placed-by — the customer who created/submitted the order (the buyer acting),
  • sold-to — the customer the order was billed/sold to.

To get the full order, take an orderId from a list and call GET /orders/v1/{orderId}.


GET /orders/v1/{orderId}

Retrieves a single order, including its lines, deliveries, billing, and status timeline.

Path parameters

Name Type Required Description
orderId string yes The unique identifier of the order.

Responses

Status Meaning
200 OK Order found and you are entitled to see it. Body is a full order.
400 Bad Request orderId was empty/invalid.
401 Unauthorized Missing or invalid token.
403 Forbidden Token lacks order:read, or you are not entitled to this order.
404 Not Found No order exists with that id.
500 Internal Server Error Unexpected server error.

Example response (200 OK)

{
"order": {
"orderId": "1000001",
"checkoutId": "c0ffee00-0000-0000-0000-000000000001",
"currency": "NOK",
"events": {
"Placed": "2026-05-01T09:32:00+02:00",
"Completed": "2026-05-03T14:10:00+02:00"
},
"parties": {
"soldTo": "11111111-1111-1111-1111-111111111111",
"shipTo": "11111111-1111-1111-1111-111111111111",
"billTo": "11111111-1111-1111-1111-111111111111",
"contactTo": null,
"placedBy": "22222222-2222-2222-2222-222222222222"
},
"references": {
"billingReference": null,
"deliveryReference": null
},
"orderLines": [
{
"lineNumber": "10",
"name": "Acme 27\" Monitor",
"description": "27-inch 4K display",
"materialNumber": "MON-27-4K",
"quantity": { "total": 2, "fulfilled": 2, "cancelled": 0 },
"unitPrice": { "gross": 4999.0, "net": 3999.2, "vat": 999.8 },
"references": { "deliveryReference": "DLV-001" },
"categories": ["PHYSICAL_ITEM"],
"orderLines": []
}
],
"expectedDeliveries": [
{
"estimatedDeliveryDate": "2026-05-03T00:00:00+02:00",
"expectedLines": [
{
"orderLineNumber": "10",
"quantity": 2,
"references": null,
"status": "Available",
"availableAt": "2026-05-01T00:00:00+02:00"
}
],
"collectionPoint": null,
"deliveryAddress": {
"name": "Contoso AS",
"addressLine1": "Storgata 1",
"addressLine2": null,
"postCode": "0151",
"city": "Oslo",
"country": "NO",
"contactPersonName": "Ola Nordmann",
"phone": "+4722000000",
"mobilePhone": "+4790000000",
"email": "orders@contoso.example",
"globalLocationNumber": null
}
}
],
"deliveries": [
{
"deliveryId": "DLV-001",
"trackingNumber": "TRK123456789",
"events": {
"Created": "2026-05-02T08:00:00+02:00",
"Sent": "2026-05-02T17:00:00+02:00",
"Delivered": "2026-05-03T14:10:00+02:00"
},
"deliveryLines": [
{
"lineNumber": "1",
"quantity": 2,
"orderLineNumber": "10",
"serialNumbers": ["SN-A1", "SN-A2"]
}
],
"collectionPoint": null,
"deliveryAddress": {
"name": "Contoso AS",
"addressLine1": "Storgata 1",
"addressLine2": null,
"postCode": "0151",
"city": "Oslo",
"country": "NO",
"contactPersonName": "Ola Nordmann",
"phone": "+4722000000",
"mobilePhone": "+4790000000",
"email": "orders@contoso.example",
"globalLocationNumber": null
}
}
],
"billings": [
{
"billingId": "INV-55501",
"events": { "Billed": "2026-05-03T15:00:00+02:00" },
"type": "Invoice",
"billingLine": [
{
"lineNumber": "1",
"quantity": 2,
"orderLineNumber": "10",
"serialNumbers": ["SN-A1", "SN-A2"]
}
]
}
]
}
}

GET /orders/v1/{orderId}/allowed-actions

Returns which state-changing operations are currently permitted on the order. Use it to decide up front whether to offer an action to the user (e.g. show or hide a Cancel order button) instead of attempting the action and handling the failure.

Path parameters

Name Type Required Description
orderId string yes The unique identifier of the order.

Required scope: order:read

Responses

Status Meaning
200 OK Order found and you are entitled to see it. Body is an AllowedActions.
400 Bad Request orderId was empty/invalid.
401 Unauthorized Missing or invalid token.
403 Forbidden Token lacks order:read, or you are not entitled to this order.
404 Not Found No order exists with that id.
500 Internal Server Error Unexpected server error.

Example response (200 OK)

{
"canBeCancelled": true
}

The response is a point-in-time snapshot, not a reservation. The order may progress between this call and a subsequent action (e.g. a delivery is created), so the action can still be rejected with 422 Unprocessable Entity. Always handle that response on the action itself.

Eligibility is evaluated at a finer grain than the summarized status field — an order showing status: "Open" may still have canBeCancelled: false. Use this endpoint rather than inferring eligibility from status.


PATCH /orders/v1/{orderId}/cancel

Requests cancellation of an order. The operation is state-guarded and idempotent:

Outcome Behaviour
Order can be cancelled Cancellation is submitted. Returns 204 No Content.
Order already cancelled No action taken. Returns 204 No Content.
Order not eligible Cannot be cancelled in its current state. Returns 422 Unprocessable Entity.

Eligibility is decided server-side and is not derivable from the status field alone — an order showing status: "Open" may still be rejected. To check eligibility up front, call Get allowed actions and inspect canBeCancelled. Either way, act on the cancel response: 204 means it is (or will be) cancelled, 422 means it is not eligible.

Cancellation is processed asynchronously. A 204 response means the request was accepted, not that the order has already reached the Cancelled state. Poll GET /orders/v1/{orderId} until events.Cancelled appears if you need to confirm completion.

Path parameters

Name Type Required Description
orderId string yes The unique identifier of the order to cancel.

Required scope: order:write (in addition to order:read)

Responses

Status Meaning
204 No Content Cancellation accepted, or order was already cancelled. No body.
400 Bad Request orderId was empty/invalid.
401 Unauthorized Missing or invalid token.
403 Forbidden Token lacks required scope, or you are not entitled to this order.
404 Not Found No order exists with that id.
422 Unprocessable Entity Order is not currently eligible for cancellation (see the state table above).

GET /orders/v1/list/placed-by/{placedByCustomerId}

Lists summaries of orders placed by the given customer, newest first by default.

Path parameters

Name Type Required Description
placedByCustomerId string (GUID) yes Customer who placed the orders.

Supports filtering, sorting and paging via query string.


GET /orders/v1/list/sold-to/{soldToCustomerId}

Lists summaries of orders sold to the given customer, newest first by default.

Path parameters

Name Type Required Description
soldToCustomerId string (GUID) yes Customer the orders were sold to.

Supports filtering, sorting and paging via query string.

Responses (both list endpoints)

Status Meaning
200 OK Body is a paged list of summaries. May be empty.
400 Bad Request A query parameter failed validation (see Errors).
401 Unauthorized Missing or invalid token.
403 Forbidden Token lacks order:read.
500 Internal Server Error Unexpected server error.

Example response (200 OK)

{
"orders": [
{
"orderId": "1000001",
"checkoutId": "c0ffee00-0000-0000-0000-000000000001",
"placedAt": "2026-05-01T09:32:00+02:00",
"status": "Completed",
"soldTo": "11111111-1111-1111-1111-111111111111",
"placedBy": "22222222-2222-2222-2222-222222222222",
"productNames": ["Acme 27\" Monitor", "USB-C Cable"],
"references": {
"billingReference": null,
"deliveryReference": null
}
}
],
"continuationToken": "eyJwYWdlIjogMn0="
}

All parameters are optional. With none supplied you get the first page, newest first.

Parameter Type Default Description
status string enum (all) Return only orders in this status. Omit for all statuses.
from timestamp (open) Only orders placed at or after this instant. Must not be earlier than 2023-10-14 (no order data exists before then).
to timestamp (open) Only orders placed at or before this instant. Must not be earlier than from.
sortBy PlacedAt | OrderId PlacedAt Field to sort by.
sortDir Asc | Desc Desc Sort direction.
pageSize integer server default Page size, 1–50.
continuationToken string (none) Opaque token from a previous response, used to fetch the next page.

Validation errors (400) are returned when: from is earlier than 2023-10-14, from is later than to, or pageSize is outside 1–50.

Example

GET /orders/v1/list/sold-to/11111111-1111-1111-1111-111111111111?status=Completed&from=2026-01-01T00:00:00Z&pageSize=25&sortDir=Desc

List endpoints are cursor-based, not page-numbered. Read these rules carefully — they affect correctness:

  1. A response includes a continuationToken when more results may be available, or null when you have reached the end.
  2. To fetch the next page, repeat the same request and pass the token back as the continuationToken query parameter.
  3. There is no total count. Do not rely on result counts to decide when to stop.
  4. Per-order access control is applied after paging. Because of this, a page may contain fewer items than pageSize, or even be empty, while still returning a non-null continuationToken. An empty page does not mean you are done.
  5. Keep following continuationToken until it is null. That — and only that — signals the end of the result set.
GET .../list/sold-to/{soldToCustomerId} → { "orders": [...], "continuationToken": "abc" }
GET .../list/sold-to/{soldToCustomerId}?continuationToken=abc → { "orders": [], "continuationToken": "def" } // not finished!
GET .../list/sold-to/{soldToCustomerId}?continuationToken=def → { "orders": [...], "continuationToken": null } // finished

Returned by get-by-id under the top-level order property.

Note: the full order has no single status field. Its lifecycle is conveyed by the events timeline. The summarized status value is available on list results.

Order

Field Type Description
orderId string | null Unique order identifier.
checkoutId string | null Identifier of the checkout the order originated from.
currency string | null ISO currency code for all monetary amounts on the order.
events map<string, timestamp> Order lifecycle timeline. See the events map.
parties Parties The customers involved.
references References | null Customer/business references.
orderLines OrderLine[] The ordered items.
expectedDeliveries ExpectedDelivery[] Planned deliveries with estimated dates and addresses.
deliveries Delivery[] Actual deliveries/shipments.
billings Billing[] Invoices and credit notes.

Parties

Field Type Description
soldTo string Customer the order was sold to.
shipTo string Customer/destination the order ships to.
billTo string Customer billed for the order.
contactTo string | null Contact party, if any.
placedBy string | null Customer who placed the order.

References (used on the order and on list summaries)

Field Type Description
billingReference string | null Billing reference.
deliveryReference string | null Delivery reference.

OrderLine

Field Type Description
lineNumber string Identifier of the line within the order.
name string Product name.
description string | null Product description.
materialNumber string Material/SKU number.
quantity Quantity Ordered/fulfilled/cancelled counts.
unitPrice Price Price per unit, in the order currency.
references LineReferences | null Line-level references.
categories string[] One or more line categories.
orderLines OrderLine[] Nested/child lines (e.g. components of a bundle). Empty when none.

Quantity

Field Type Description
total integer Quantity ordered on the line.
fulfilled integer Quantity invoiced/fulfilled so far.
cancelled integer Quantity cancelled (equals total when the whole line is cancelled).

Price

Field Type Description
gross decimal Amount including VAT.
net decimal Amount excluding VAT.
vat decimal VAT amount. (gross = net + vat)

LineReferences — { "deliveryReference": string | null }

ExpectedDelivery

Field Type Description
estimatedDeliveryDate timestamp | null Estimated delivery date for the whole planned delivery. Rolled up from the per-item status / availableAt of its expectedLines — see Availability status values.
expectedLines ExpectedDeliveryLine[] Which order lines and quantities are planned for this delivery, each with its own availability.
collectionPoint CollectionPoint | null Pickup point, for collection deliveries.
deliveryAddress DeliveryAddress | null Home/business delivery address.

ExpectedDeliveryLine

Field Type Description
orderLineNumber string The order line this planned delivery relates to.
quantity integer Quantity planned on this line for this delivery.
references LineReferences | null Line-level references.
status string enum Per-item availability status — also tells you how firm availableAt is.
availableAt timestamp | null When this specific item is (or is expected to be) ready to ship. Confidence depends on status.

Delivery

Field Type Description
deliveryId string Identifier of the delivery/shipment.
trackingNumber string | null Carrier tracking number.
events map<string, timestamp> Delivery timeline. See the events map.
deliveryLines DeliveryLine[] Items included in this delivery.
collectionPoint CollectionPoint | null Pickup point, for collection deliveries.
deliveryAddress DeliveryAddress | null Destination address.

DeliveryLine — { "lineNumber": string, "quantity": integer, "orderLineNumber": string, "serialNumbers": string[] }

Billing

Field Type Description
billingId string Invoice / credit-note identifier.
events map<string, timestamp> Billing timeline (key Billed).
type Invoice | CreditNote Document type.
billingLine BillingLine[] Billed lines.

BillingLine — { "lineNumber": string, "quantity": integer, "orderLineNumber": string | null, "serialNumbers": string[] }

DeliveryAddress

Field Type Description
name string Recipient name.
addressLine1 string Street address.
addressLine2 string | null Additional address line.
postCode string Postal code.
city string City.
country string Country.
contactPersonName string | null Contact person.
phone string Phone number.
mobilePhone string Mobile number.
email string Email address.
globalLocationNumber string | null GLN, if applicable.

Note — phone / mobilePhone asymmetry with Checkout. On this response contract both phone and mobilePhone are always present (non-null). On the Checkout API request the same two fields are optional / nullable. This asymmetry is deliberate: you may create a checkout without a phone number, but an order that comes back always carries one.

CollectionPoint — { "id": string, "name": string, "addressLine": string, "postCode": string, "city": string, "country": string }


Returned by get-allowed-actions. One boolean per state-changing operation; true means the operation is permitted on the order right now.

AllowedActions

Field Type Description
canBeCancelled boolean Whether Cancel order would currently be accepted. false for orders already cancelled, in progress, or completed.

New fields may be added to this object as further actions become available. Ignore fields you do not recognise.


Returned by the list endpoints, one per item in orders.

OrderSearchResult

Field Type Description
orderId string Unique order identifier. Use it with get-by-id for full detail.
checkoutId string | null Originating checkout identifier.
placedAt timestamp When the order was placed.
status string enum High-level status.
soldTo string Customer the order was sold to.
placedBy string | null Customer who placed the order.
productNames string[] Names of products on the order (for quick display).
references References | null Order references (see References).

List response wrapper

Field Type Description
orders OrderSearchResult[] The page of summaries (possibly empty).
continuationToken string | null Cursor for the next page; null at the end. See Pagination.

Used by the status query parameter and the status field on summaries.

Value Meaning
Open Order received and awaiting processing (includes submitted / credit-check states).
InProgress Order is being processed/fulfilled.
Completed Order fully fulfilled.
Cancelled Order cancelled.

When filtering by status=Open, all “open-equivalent” internal states are included, so the filter matches what you see in the status field.

Note that not every Open order is immediately cancellable — use Get allowed actions to check, and see Cancel order for the finer-grained eligibility rules.

The categories array on an order line contains one or more of:

Value Meaning
PHYSICAL_ITEM A physical product.
SERVICE A service (e.g. extended warranty, insurance, fee, license, enrollment).
DELIVERY A delivery/shipping line.
VIRTUAL_ITEM A virtual/grouping item (e.g. a bundle or sales set).

The status field on an ExpectedDeliveryLine describes that item’s current availability. Read the two fields together: availableAt is when the item is expected to be ready to ship, and status is how certain that date is. The further the item still has to travel through the supply chain before it reaches the warehouse it ships from, the lower the confidence.

Listed from most to least certain:

Value Where the item is Confidence in availableAt
Available Physically in the warehouse it ships from. Near-certain. Nothing upstream can move it; only picking and carrier lead time remain.
ConfirmedRestock Not in the shipping warehouse yet, but the supplier has confirmed a delivery date. Good. The date can still slip if the inbound shipment is delayed in transit.
UnconfirmedRestock Not in the shipping warehouse; a restock is expected but the supplier has not confirmed the date. Low. The date is a best estimate and may change once the supplier confirms.
Unavailable Not in the shipping warehouse and no restock is planned or known. None. availableAt is null.
Unknown Availability has not been assessed yet (e.g. the order was just placed). None. availableAt is null; expect it to move to one of the statuses above shortly.

availableAt carries a date whenever one is known: the (unconfirmed or confirmed) restock date for UnconfirmedRestock/ConfirmedRestock, and the date the item became available for Available. It is null only for Unknown and Unavailable.

A line normally moves up this ladder over time (Unknown → UnconfirmedRestock → ConfirmedRestock → Available), and availableAt gets firmer with each step. When showing the date to a customer, use status to decide how strongly to word it — “ships 19 June” for Available, “expected 19 June” for ConfirmedRestock, “estimated 19 June, to be confirmed” for UnconfirmedRestock.

How item availability relates to estimatedDeliveryDate

status and availableAt are the item-level view; estimatedDeliveryDate on the enclosing ExpectedDelivery is the delivery-level roll-up of them. A planned delivery ships once every item in it is available, so its estimate is driven by the line that becomes available last:

  • All lines Available → the delivery can ship now; estimatedDeliveryDate is the nearest delivery date.
  • One or more lines ConfirmedRestock / UnconfirmedRestock → the delivery waits for those items; estimatedDeliveryDate moves out to (at least) the latest availableAt. Treat an estimate built on UnconfirmedRestock as tentative.
  • Any line Unknown / Unavailable → no reliable estimate; estimatedDeliveryDate is null.

Use estimatedDeliveryDate when you only need “when will this shipment arrive”. Use expectedLines[] when you need to tell the customer which item is holding the shipment back and why.

Compatibility note. status and availableAt are new, additive fields on ExpectedDeliveryLine — existing integrations that don’t read them are unaffected.


Several objects (order, each delivery, each billing) expose an events object instead of fixed timestamp fields. It is a map of event name → timestamp:

  • A key is present only if that event has occurred. Absent keys mean the event hasn’t happened.
  • Entries are ordered ascending by time, so you can read the map as a chronological timeline.

Possible keys

Object Possible event keys
Order Placed, Cancelled, Completed
Delivery Created, Picked, Cancelled, Sent, Delivered, ReadyToCollect
Billing Billed

Sample responses for each state are in the companion example docs:

  • Order detail examples — single-order responses across lifecycle, delivery, billing and line-type scenarios.
  • Order list examples — paginated summary responses, with filtering, sorting and pagination samples.
  • Cancel order examples — per-state behaviour, idempotency, and error responses for the cancel endpoint.

All errors use the RFC 9457 / RFC 7807 Problem Details JSON format.

Problem Details

Field Type Description
type string (URI) Identifies the error category.
title string Short, human-readable summary of the category.
detail string Human-readable explanation specific to this occurrence.
status integer HTTP status code.
instance string The request path that produced the error.
code string Stable machine-readable error code (see table below).
traceId string Correlation id; also returned in the X-Trace-Id header. Quote it to support.

Validation errors (400) include an additional errors array, one entry per invalid field:

{
"type": "...",
"title": "Validation Failed",
"detail": "Some fields have validation errors",
"status": 400,
"instance": "/orders/v1/list/sold-to/11111111-1111-1111-1111-111111111111",
"code": "ERR_VALIDATION_0001",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"errors": [
{ "fieldName": "PageSize", "message": "PageSize must be between 1 and 50." }
]
}

Status / code reference

HTTP status code When it happens
400 Bad Request ERR_VALIDATION_0001 A path or query parameter failed validation. See errors[].
401 Unauthorized — Missing, malformed, or expired token / wrong auth scheme.
403 Forbidden ERR_ACCESS Token lacks order:read, or you are not entitled to the requested order.
404 Not Found ERR_NOTFOUND No order exists with the given id.
422 Unprocessable Entity ERR_PROCESSING The request was understood but could not be processed.
500 Internal Server Error InternalServerError Unexpected server error. Retry later; quote the trace id if it persists.

Terminal window
# 1. Fetch a page of orders sold to a customer
curl -s "https://<store-url>/public/orders/v1/list/sold-to/11111111-1111-1111-1111-111111111111?pageSize=25" \
-H "Authorization: Bearer <access_token>" \
-H "Ocp-Apim-Subscription-Key: <subscription_key>" \
-H "Accept: application/json"
# 2. Take an orderId from the list and fetch the full order
curl -s "https://<store-url>/public/orders/v1/1000001" \
-H "Authorization: Bearer <access_token>" \
-H "Ocp-Apim-Subscription-Key: <subscription_key>" \
-H "Accept: application/json"
# 3. Check whether the order can be cancelled before offering the action
curl -s "https://<store-url>/public/orders/v1/1000001/allowed-actions" \
-H "Authorization: Bearer <access_token>" \
-H "Ocp-Apim-Subscription-Key: <subscription_key>" \
-H "Accept: application/json"

To page through all results, repeat the list call with continuationToken from each response until it comes back null.