Skip to main content
GET
Search shipments
Look up shipments for the authenticated shop by order name or tracking code.
The shop is taken from the access token. A successful search returns the order and its packages. Call this endpoint from your server. The access token is a secret, and a token placed in a URL is rejected.

Authentication

Send the access token on every request:
Create the token in the app under Settings → Integrations → Access Tokens. The token is shown once, when you create it. Use HTTPS. Send the token in the header above. If the token appears anywhere in the URL, the API responds with 400 and this body:
Rotate any token that has been sent in a URL.

Search term

searchTerm is one path segment. Percent-encode reserved characters. An order name usually starts with #, which is %23 in the path:
The term is matched without regard to case.
  • An order name matches with or without the leading #. #1001 and 1001 find the same order.
  • A tracking code matches the code on the tracked shipment.
  • When the term matches an order name, the response is that order. A tracking code that happens to equal an order name does not override the order match.
  • A term that ends in a period and a digit from 1 to 9 is matched without those two characters. #1001.1 is searched as #1001. This accepts a fulfillment name such as #1001.1.
  • Fulfillments with nothing to ship are excluded. Fulfillments must have at least one shippable line item to appear.
  • Fulfillments that share a tracking code are returned as one shipment. Line items from each of those fulfillments are combined on that shipment.
The terms preview, preview-<status>, and #9999 return sample tracking-page data. You can omit the path segment when the t parameter includes query. See Customer verification.

Customer verification

All shops require the customer’s email or phone before a search returns an order. Send the customer’s email or phone in the t query parameter. t is the standard Base64 encoding of a JSON object: If both email and phone are present, either one matching the order is enough.
The API rejects a search that does not match the customer. The response is 401:
That same message is returned when the email or phone does not match. An order that does not exist is different: it returns 200 with an empty body. See No match.

Response

A found order is 200 with Content-Type: application/json.
statusDetails is the latest event in events. Each event copies the shipment’s trackingUrl onto the scan. The event eta is the estimate as stored on the shipment, which can be a different format from the ISO-8601 eta on the shipment itself.

Order

Shipment

Tracking events

Each event in events, and statusDetails when it is present, has these fields: Events older than eight months are omitted. Carriers reuse tracking numbers, and older scans belong to a previous shipment. statusDetails is the newest event that remains.

Line items

Pending line items

Items in pendingLineItems use a different id field from packed line items.

Order received, no tracking yet

An order that exists, and has no tracking code yet, returns one placeholder shipment:
date on this placeholder is the time of the response, not a carrier scan. substatus here is order_received, which is only used on this placeholder.

Pickup orders

A pickup order with no carrier tracking code returns the pickup in place of the placeholder shipment. shipments is empty.
When an order has several pickups, the response describes the one that is still waiting. After every pickup is collected, the response describes the last one. pickupStatus is picked_up when pickedUpAt is set, ready when readyAt is set and the order is not picked up, and awaiting_pickup otherwise.

No match

A search that finds no order returns 200 with an empty body. The body is empty, so parse JSON only after checking that the body has content.

Side effect

A search that finds an order records a tracking page view for the shop. The view is attributed using the request Origin and Referer headers when those headers are present.

Errors

The 500 message describes the failure and is not a stable contract. Retry the request. When the shop’s subscription cannot be confirmed, the search is allowed through and returns a normal 200.