Skip to content

Polling pattern implementation guide

The polling API offers an alternative to the webhook API for retrieving order or shipment updates. Both approaches have different advantages and considerations:

The polling pattern consists of three essential steps:

  1. Fetch - Retrieve orders or shipments changed since the last poll.
  2. Process - Handle the retrieved new or updated data.
  3. Persist - Store the latest timestamp for the next polling cycle.

Set up a scheduled process to fetch all orders or shipments that have been created or changed since your last poll.

  • Use a consistent polling interval (typically 5 minutes)
  • Include the lastUpdatedAt timestamp from previous poll response as the lastUpdatedAfter filter.
    • Do not use the system clock time for lastUpdatedAfter – clock skew or availability issues can cause you to miss updates.
  • Set limit=100 (the maximum allowed value) to control response size.
  • Handle pagination when needed:
    • If response contains total > 100, not all updates were returned.
    • Either decrease the polling period (recommended) or use the offset parameter for paging.
Data Type Endpoint Use Case
Orders (delivery schedule) Poll orders For orders using delivery schedule feature
Orders (single delivery) Poll single delivery orders For orders using single delivery per line
Shipments Poll shipments For shipment updates
GET /v2/order-search/poll
{
"filters": {
"lastUpdatedAfter": "2025-04-23T10:01:53.812Z"
},
"limit": 100
}

Optionally, the buyer can filter on Confirmed orders and ignore orders with other statuses.

GET /v2/order-search/poll
{
"filters": {
"status": {
"processStatus": ["Confirmed"]
},
"lastUpdatedAfter": "2025-04-23T10:01:53.812Z"
},
"limit": 100
}
  • The Confirmed process status is set at order level only when every order line has been confirmed by the supplier.
  • An order with even one unconfirmed line will not appear in these results yet.
  • Individual order lines can still have a different status (for example, Cancelled or Completed). Your integration must filter client-side: only process lines where data.lines.status.processStatus equals Confirmed.

Buyer: receive confirmed lines as soon as possible

Section titled “Buyer: receive confirmed lines as soon as possible”

To process confirmed order lines without waiting for the entire order to reach Confirmed, filter on both Confirmed and InProgress:

GET /v2/order-search/poll
{
"filters": {
"status": {
"processStatus": ["Confirmed", "InProgress"]
},
"lastUpdatedAfter": "2025-04-23T10:01:53.812Z"
},
"limit": 100
}
  • An order moves to InProgress as soon as the supplier confirms the first line, before all lines are confirmed.
  • Confirmed lines therefore become available in your poll results earlier, you do not have to wait for the full order to be confirmed.
  • These orders will also contain lines that are not yet confirmed. Your integration must filter client-side: only process lines where data.lines.status.processStatus equals Confirmed.

Optionally, the supplier can filter on Issued orders and ignore orders with other statuses.

GET /v2/order-search/poll
{
"filters": {
"status": {
"processStatus": ["Issued"]
},
"lastUpdatedAfter": "2025-04-23T10:01:53.812Z"
},
"limit": 100
}
  • The supplier may still receive Issued orders that have been updated by the buyer.
  • If you are a supplier, check if the purchase order already exists in your ERP system and either ignore the update or update the existing order.

Implement logic to handle the fetched new or updated orders or shipments.

{
"data": [
{
"supplierAccountNumber": "SUPPLIER12345",
"purchaseOrderNumber": "PO123456789",
"lines": [
{
"deliverySchedule" ...
"prices" ...
"status": {
"processStatus": "Issued",
"logisticsStatus": "Open"
},
"lastUpdatedAt": "2025-04-23T10:01:53.812Z"
}
],
"status": {
"processStatus": "Issued",
"logisticsStatus": "Open"
},
"lastUpdatedAt": "2025-04-23T10:01:53.812Z"
}
],
"total": 10,
"lastUpdatedAt": "2025-04-23T10:01:53.812Z"
}

When working with order endpoints:

  • The supplier must check whether the purchase order already exists in their ERP system and either ignore the update or update the existing order.
  • Use data.lines.lastUpdatedAt to identify which specific lines have changed since the lastUpdatedAfter time you provided.
  • Filter by order- and line-level status using data.status and data.lines.status fields. See Order and line status for the complete list of values:
    • processStatus
    • inProgressStatus
    • logisticsStatus
    • deliveryLineStatus

When working with the shipment endpoint:

  • Use data.lines.meta.lastUpdatedAt to identify changed shipment lines since the lastUpdatedAfter time you provided.
  • Filter by data.status to focus on relevant shipment statuses

Store the lastUpdatedAt value to use as lastUpdatedAfter in subsequent requests.

When the poll response is empty, keep using the same timestamp until you get results.

  • The timestamp has format YYYY-MM-DDThh:mm:ss.SSSZ (ISO 8601). Persist the full timestamp, including the Z timezone indicator, and send it back with the next polling request.
  • Persist the complete timestamp string to prevent timezone conversion issues.
  • Store it in durable storage (database or file system).
  • Your storage solution must survive application restarts or crashes.
  • If the response contains no data, reuse the current lastUpdatedAfter value.
  • For first-time polling, use a well-chosen historical date to retrieve or skip existing orders.