Tutorial: Track a Shipment
How to track a previously created shipment.
API Version: v2
This tutorial shows how to track a previously created shipment. The getTracking
operation provides tracking information for packages shipped with Amazon, including the most recent status and package status history.
Note: This operation only returns a response for packages shipped with Amazon, and is unavailable for Direct Fulfillment shipments. To track Amazon orders shipped with another carrier, please call the respective carrier's tracking API directly. For packages shipped with Amazon, you can retrieve tracking details for up to 45 days after the shipment creation date. After this period, only the last tracking status is returned.
Prerequisites
To complete this tutorial, you will need:
- Enrollment in an eligible program.
- A selling-partner account if you are an Amazon seller or are working with an Amazon seller to create and manage shipments.
- Authorization from the selling-partner for whom you are making calls. Refer to Authorizing Selling Partner API applications for more information.
Step 1. Track a shipment
To get the tracking status and package status history:
Call the getTracking
operation for a shipment, passing the following parameters:
Request query parameters
Name | Description | Required |
---|---|---|
carrierID |
A carrier identifier originally returned by the getRates operation for the selected rate.
Type: string |
Yes |
trackingID |
A carrier-generated tracking identifier originally returned by the purchaseShipment operation.
Type: string |
Yes |
Request header parameters
Name | Description | Required |
---|---|---|
x-amzn-shipping-business-id |
Amazon shipping business to assume for this request. The default is AmazonShipping_UK .
Type:
enum ( |
No |
x-amzn-access-token |
Amazon shipping request token | Yes |
Response
A successful response includes the following:
Name | Description | Schema |
---|---|---|
payload | The payload for the getTracking operation. | GetTrackingResult |
Sample API Request
GET https://sellingpartnerapi-eu.amazon.com/shipping/v2/tracking?carrierId=AMZN_UK&trackingId=UK0123456789
x-amzn-shipping-business-id: [x-amzn-shipping-business-id](https://developer-docs.amazon.com/amazon-shipping/docs/frequently-asked-questions#which-x-amzn-shipping-business-id-to-use-as-request-header-while-calling-shipping-v2-api)
x-amz-access-token: Atza|IwEBIGorlXXX
API Response example
{
"payload": {
"alternateLegTrackingId": "UK0000313459",
"eventHistory": [
{
"eventCode": "ReadyForReceive",
"eventTime": "2023-12-11T04:11:31Z",
"shipmentType": "FORWARD", //[New] Identifier for what leg of the shipment journey the event occurred
"location": {}
},
{
"eventCode": "PickupDone",
"eventTime": "2023-12-11T17:01:39Z",
"shipmentType": "FORWARD",
"location": {
"city": "Coalville",
"countryCode": "GB",
"postalCode": "LE67 1PB",
"stateOrRegion": "Leicestershire"
}
},
{
"eventCode": "Rejected",
"eventTime": "2023-12-11T17:03:30Z",
"shipmentType": "FORWARD",
"location": {
"city": "Coalville",
"countryCode": "GB",
"postalCode": "LE67 1PB",
"stateOrRegion": "Leicestershire"
}
},
{
"eventCode": "ReturnInitiated", //[New] type of tracking event
"eventTime": "2023-12-11T17:03:30Z",
"shipmentType": "RETURNS", // [New] Field that indicates that the event was related to a packages reverse journey
"location": {
"city": "Coalville",
"countryCode": "GB",
"postalCode": "LE67 1PB",
"stateOrRegion": "Leicestershire"
}
},
{
"eventCode": "Undeliverable",
"eventTime": "2023-12-11T17:03:30Z",
"shipmentType": "RETURNS",
"location": {
"city": "Coalville",
"countryCode": "GB",
"postalCode": "LE67 1PB",
"stateOrRegion": "Leicestershire"
}
}
],
"promisedDeliveryDate": "2023-12-14T20:00:00Z",
"summary": {
"status": "InTransit",
"trackingDetailCodes": // [New] This provides additional details about a shipment.
{
"forward": [
"Rejected",
" NotRequired"
], //[New] These are some of the additional details available, in this example it means the package was rejected by the recipient due to it no longer being required
"returns": [
"Undeliverable",
"Damaged"
] //[New] The forward and return leg are separated to distinguish which leg of the journey the status code is applicable to
}
},
"trackingId": "UK0123456789"
}
}
Note: Please find the announcement for additional information to provide finer level of details about tracking a package Launch announcement for tracking APIs.
Important: Amazon Shipping also supports Push Notifications feature which helps shippers/ integrators to automatically receive shipment tracking updates for a package as they become available, without the need to make any external API calls. Please refer track-a-shipment-via-push-notifications for more details.
Updated 6 months ago