Tracking API
The tracking API returns the status history of an order. It works on a pull model—each request returns the tracking information as it stands. For a push model, where Shippit sends you each status change as it happens, subscribe to the tracking webhook instead.
Endpoints
- GET/orders/{tracking_number}/trackingRetrieve the status history of an order
The tracking object
tracking_numberstringOptional- Tracking number of the Order
tracking_urlstringOptional- URL presenting tracking info for the Order. This can be shown to the recipient to give them status updates on the Order.
successbooleanOptional- Whether or not this tracking request was successful - should always be
trueas tracking errors are returned at the top-level response. errorstringOptional- Errors associated with the tracking request - should always be
nullas tracking errors are returned at the top-level response. trackarray of objectsOptional- A list of historical tracking statuses for the Order. At minimum, this lists the order status, along with the date and time when it changed, and who was responsible for the status change.
At minimum this lists the order status, when it changed, and who changed it.
Show child attributesHide child attributes
datestring(date)Required- The
ISO-8601date asYYYY-MM-DDwhen the event happened. status_ownerstringRequired- The party responsible for the status change.
timestampstringRequired- The time in
HH:MM:SSthat the tracking event happened. statusstringRequired- The status of the order
Retrieve tracking for an order
GET/orders/{tracking_number}/tracking
This sends a tracking request to the API to retrieve the status of an order.
This operation does not require authentication.
A successful request returns the order's status history.
Parameters
tracking_numberstringpathRequired- The tracking number of the Order
Response codes
| Status | Meaning | Description |
|---|---|---|
| 200 | OK | Returns tracking info related to the Order |
| 400 | Bad Request | Returns an error if the provided tracking number does not exist |
The error object
A 400 returns an error object rather than a tracking object.
errorobjectRequired- A Hash of error codes returned by tracking response. Each error code is returned as a key, with an array of strings for each instance of the error.
order_idarrayRequired- Indicates an order that cannot be found.
successbooleanOptional- Returns
false error_descriptionstringOptional- Human-readable description of error encountered.
JSON
{
"response": {
"tracking_number": "PP39TBECV7QSSPK",
"tracking_url": "http://app.shippit.com/tracking/pp39tbecv7qsspk",
"success": true,
"track": [
{
"status": "Completed",
"date": "2015-04-03T00:00:00.000Z",
"timestamp": 58985,
"status_owner": "Bonds Couriers"
},
{
"status": "With Driver",
"date": "2015-04-03T00:00:00.000Z",
"timestamp": 55385,
"status_owner": "Bonds Couriers"
},
{
"status": "In Transit",
"date": "2015-04-03T00:00:00.000Z",
"timestamp": 55325,
"status_owner": "Bonds Couriers"
},
{
"status": "Ready For Pick Up",
"date": "2015-04-03T00:00:00.000Z",
"timestamp": 49400,
"status_owner": "Harold's Harpoons"
},
{
"status": "Despatch In Progress",
"date": "2015-04-03T00:00:00.000Z",
"timestamp": 36603,
"status_owner": "Harold's Harpoons"
},
{
"status": "Order Placed",
"date": "2015-04-03T00:00:00.000Z",
"timestamp": "07:23:32",
"status_owner": "Harold's Harpoons"
}
]
}
}JSON
{
"error": {
"order_id": [
"Sorry, the tracking number you entered does not exist."
]
},
"error_description": "The data given to this server does not meet our criteria.",
"success": false
}