Get Shipment Tracking
Returns the latest tracking status and tracking events for a shipment on an order.
HTTP Request
- URL:
/orders/shipments/tracking - Method:
POST - Headers:
accessToken: Required. Your API access token.Content-Type:application/json
- Required scope:
READ_ORDERorREAD_WRITE_ORDER
Request Body
The request body is a JSON object with the order and the tracking number.
| Field | Type | Required | Description |
|---|---|---|---|
orderId | String | Yes | ID of the order. |
trackingNumber | String | Yes | Tracking number to look up. |
carrierCode | String | No | Carrier code. Defaults to the carrier of the shipment with this tracking number. |
cURL Example
curl --location '<BASE_URL>/orders/shipments/tracking' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"orderId": "664f2310d5775459152d6dd8",
"trackingNumber": "1Z999AA10123456784",
"carrierCode": "ups"
}'
Response
- 200 OK: The tracking information was returned. Check
data.availableto see whether tracking was found. - 400 Bad Request: The order ID or tracking number is missing or not valid.
- 404 Not Found: No order exists with this ID.
Sample JSON Response
{
"success": true,
"data": {
"available": true,
"trackingNumber": "1Z999AA10123456784",
"carrierCode": "ups",
"carrierId": "se-140286",
"status": "IT",
"statusCode": "IT",
"statusDescription": "In Transit",
"estimatedDelivery": "2024-05-28T00:00:00Z",
"actualDelivery": null,
"trackingUrl": "https://www.ups.com/track?tracknum=1Z999AA10123456784",
"source": "customShipping",
"events": [
{
"occurredAt": "2024-05-25T09:41:00Z",
"description": "Departed from facility",
"statusCode": "IT",
"statusDescription": "In Transit",
"cityLocality": "Dallas",
"stateProvince": "TX",
"postalCode": "75261",
"countryCode": "US"
}
],
"error": null
}
}
Response Details
Tracking Data
| Field | Type | Description |
|---|---|---|
available | Boolean | Whether tracking information was found. |
trackingNumber | String | Tracking number. |
carrierCode | String | Carrier code. |
carrierId | String | Carrier account ID. |
status | String | Current status code. |
statusCode | String | Current status code. |
statusDescription | String | Current status in words. |
estimatedDelivery | String | Estimated delivery date. |
actualDelivery | String | Delivery date, once delivered. |
trackingUrl | String | Carrier tracking page. |
source | String | Shipping integration that provided the data. |
events | Array | Tracking events. See Event Object. |
error | String | Reason tracking is not available, when available is false. |
Event Object
| Field | Type | Description |
|---|---|---|
occurredAt | String | Date and time of the event. |
description | String | Event description. |
statusCode | String | Status code at this event. |
statusDescription | String | Status in words. |
cityLocality | String | City. |
stateProvince | String | State or province. |
postalCode | String | Postal code. |
countryCode | String | Country code. |
Notes
- When tracking cannot be found,
availableisfalse,eventsis empty anderrorexplains why. - Tracking is available for shipments sent through the store's custom shipping integration.