Tracker
A Tracker
object contains all of the tracking information for a package.
A Tracker
is created automatically whenever you buy a Shipment
through EasyPost;
if you don't use EasyPost to purchase your shipping labels, you can still track packages through our API by creating a Tracker
object directly.
Each Tracker
is continually updated in the background as the package moves through its life cycle, regardless of whether or not the label was purchased through EasyPost.
After creation, a Tracker
object will be updated periodically based on when the carrier provides EasyPost with new tracking information.
This information can be consumed by using our webhooks infrastructure.
Every time a Tracker
is updated, a webhook Event
will be sent.
The Tracker
object contains both the current information about the package as well as previous updates.
All of the previous updates are stored in the tracking_details
array. Each TrackingDetail
object contains the status, the message from the carrier, and a TrackingLocation
.
The TrackingLocation
contains city, state, country, and zip information about the location where the package was scanned. The information each carrier provides is different, so some carriers may not make use of all of these fields.
Some Tracker
objects may also contain a CarrierDetail
, which stores some additional information about the Tracker
that the carrier has made available to EasyPost.
The CarrierDetail
object contains the service
and container_type
of the package.
Additionally, it also stores the est_delivery_date_local
and est_delivery_time_local
, which provide information about the local delivery time.
It's worth noting that tracking_codes
are not globally unique.
Each carrier promises uniqueness for a given tracking_code
for a certain period of time, but the length of time varies greatly based on the specific carrier and service level.
The carriers do eventually recycle tracking codes, and for this reason enforcing uniqueness on the tracking_code
field is not recommended.
EasyPost does, however, prevent the creation of duplicate Trackers
based on tracking_code
and carrier
;
duplicate requests by the same User
will simply return the original Tracker
.
The current status of the package. Possible values:
- "unknown"
- "pre_transit"
- "in_transit"
- "out_for_delivery"
- "delivered"
- "available_for_pickup"
- "return_to_sender"
- "failure"
- "cancelled"
- "error"
Additional details about the current status. Possible values:
- "address_correction"
- "arrived_at_destination"
- "arrived_at_facility"
- "arrived_at_pickup_location"
- "awaiting_information"
- "cancelled"
- "damaged"
- "delayed"
- "delivery_exception"
- "departed_facility"
- "departed_origin_facility"
- "expired"
- "failure"
- "held"
- "in_transit"
- "label_created"
- "lost"
- "missorted"
- "out_for_delivery"
- "received_at_destination_facility"
- "received_at_origin_facility"
- "refused"
- "return"
- "status_update"
- "transferred_to_destination_carrier"
- "transit_exception"
- "unknown"
- "weather_delay"
TrackingDetail
objectsCarrierDetail
object (if available)Tracker
was createdTracker
was last updated{
"id": "trk_3898303eff624097a516ab324bb133f3",
"object": "Tracker",
"mode": "test",
"tracking_code": "9405500207552011812894",
"status": "pre_transit",
"status_detail": "status_update",
"created_at": "2024-01-24T00:07:43Z",
"updated_at": "2024-01-24T00:07:43Z",
"signed_by": null,
"weight": null,
"est_delivery_date": "2024-01-24T00:07:43Z",
"shipment_id": "shp_82d5637d74404d1595eacdc7e5ca9273",
"carrier": "USPS",
"tracking_details": [
{
"object": "TrackingDetail",
"message": "Pre-Shipment Info Sent to USPS",
"description": "",
"status": "pre_transit",
"status_detail": "status_update",
"datetime": "2023-12-24T00:07:43Z",
"source": "USPS",
"carrier_code": "",
"tracking_location": {
"object": "TrackingLocation",
"city": null,
"state": null,
"country": null,
"zip": null
}
},
{
"object": "TrackingDetail",
"message": "Shipping Label Created",
"description": "",
"status": "pre_transit",
"status_detail": "status_update",
"datetime": "2023-12-24T12:44:43Z",
"source": "USPS",
"carrier_code": "",
"tracking_location": {
"object": "TrackingLocation",
"city": "HOUSTON",
"state": "TX",
"country": null,
"zip": "77063"
}
}
],
"fees": [],
"carrier_detail": {
"object": "CarrierDetail",
"service": "First-Class Package Service",
"container_type": null,
"est_delivery_date_local": null,
"est_delivery_time_local": null,
"origin_location": "HOUSTON TX, 77001",
"origin_tracking_location": {
"object": "TrackingLocation",
"city": "HOUSTON",
"state": "TX",
"country": null,
"zip": "77063"
},
"destination_location": "CHARLESTON SC, 29401",
"destination_tracking_location": null,
"guaranteed_delivery_date": null,
"alternate_identifier": null,
"initial_delivery_attempt": null
},
"public_url": "https://track.easypost.com/djE6dHJrXzM4OTgzMDNlZmY2MjQwOTdhNTE2YWIzMjRiYjEzM2Yz"
}
Status of the package at the time of the scan event. Possible values:
- "unknown"
- "pre_transit"
- "in_transit"
- "out_for_delivery"
- "delivered"
- "available_for_pickup"
- "return_to_sender"
- "failure"
- "cancelled"
- "error"
Additional details about the current status. Possible values:
- "address_correction"
- "arrived_at_destination"
- "arrived_at_facility"
- "arrived_at_pickup_location"
- "awaiting_information"
- "cancelled"
- "damaged"
- "delayed"
- "delivery_exception"
- "departed_facility"
- "departed_origin_facility"
- "expired"
- "failure"
- "held"
- "in_transit"
- "label_created"
- "lost"
- "missorted"
- "out_for_delivery"
- "received_at_destination_facility"
- "received_at_origin_facility"
- "refused"
- "return"
- "status_update"
- "transferred_to_destination_carrier"
- "transit_exception"
- "unknown"
- "weather_delay"
{
"object": "TrackingDetail",
"message": "Pre-Shipment Info Sent to USPS",
"description": "",
"status": "pre_transit",
"status_detail": "status_update",
"datetime": "2023-12-24T00:07:43Z",
"source": "USPS",
"carrier_code": "",
"tracking_location": {
"object": "TrackingLocation",
"city": null,
"state": null,
"country": null,
"zip": null
}
}
{
"object": "TrackingLocation",
"city": null,
"state": null,
"country": null,
"zip": null
}
{
"object": "CarrierDetail",
"service": "First-Class Package Service",
"container_type": null,
"est_delivery_date_local": null,
"est_delivery_time_local": null,
"origin_location": "HOUSTON TX, 77001",
"origin_tracking_location": {
"object": "TrackingLocation",
"city": "HOUSTON",
"state": "TX",
"country": null,
"zip": "77063"
},
"destination_location": "CHARLESTON SC, 29401",
"destination_tracking_location": null,
"guaranteed_delivery_date": null,
"alternate_identifier": null,
"initial_delivery_attempt": null
}
Sometimes you may want to simulate specific tracking statuses (e.g. "out_for_delivery") within your application to test how your application responds.
EasyPost has a set of test tracking_codes
that, when sent to the API, respond with specific tracking statuses and send a webhook Event
to your test mode URL.
The tracking updates that are sent by these tracking_codes
will contain canned information, but it will be similar in form to the information normally provided by the carrier you selected.
A Tracker
can be created with only a tracking_code
.
Optionally, you can provide the carrier
parameter, which indicates the carrier the package was shipped with.
If no carrier
is provided, EasyPost will attempt to determine the carrier based on the tracking_code
provided.
Providing a carrier
parameter is recommended, since some tracking codes are ambiguous and may match with more than one carrier.
In addition, not having to auto-match the carrier will significantly speed up the response time.
In an effort to reduce wasted resources, EasyPost prevents the creation of duplicate Trackers
.
A Tracker
is considered to be a duplicate if another Tracker
with the same tracking_code
and carrier
was created by the same User
in the last three months.
In the case where a duplicate request is submitted, the original Tracker
will be returned.
A Tracker object is immutable once created. All information must be provided during creation; it cannot be modified later.
Request Parameters
1curl -X POST https://api.easypost.com/v2/trackers \
2 -u "EASYPOST_API_KEY": \
3 -H 'Content-Type: application/json' \
4 -d '{
5 "tracker": {
6 "tracking_code": "EZ1000000001",
7 "carrier": "USPS"
8 }
9 }'
1{
2 "id": "trk_a45db88bb5194557879246abd110606c",
3 "object": "Tracker",
4 "mode": "test",
5 "tracking_code": "EZ1000000001",
6 "status": "pre_transit",
7 "status_detail": "status_update",
8 "created_at": "2024-01-23T23:58:57Z",
9 "updated_at": "2024-01-23T23:58:57Z",
10 "signed_by": null,
11 "weight": null,
12 "est_delivery_date": "2024-01-23T23:58:57Z",
13 "shipment_id": null,
14 "carrier": "USPS",
15 "tracking_details": [
16 {
17 "object": "TrackingDetail",
18 "message": "Pre-Shipment Info Sent to USPS",
19 "description": "",
20 "status": "pre_transit",
21 "status_detail": "status_update",
22 "datetime": "2023-12-23T23:58:57Z",
23 "source": "USPS",
24 "carrier_code": "",
25 "tracking_location": {
26 "object": "TrackingLocation",
27 "city": null,
28 "state": null,
29 "country": null,
30 "zip": null
31 }
32 },
33 {
34 "object": "TrackingDetail",
35 "message": "Shipping Label Created",
36 "description": "",
37 "status": "pre_transit",
38 "status_detail": "status_update",
39 "datetime": "2023-12-24T12:35:57Z",
40 "source": "USPS",
41 "carrier_code": "",
42 "tracking_location": {
43 "object": "TrackingLocation",
44 "city": "HOUSTON",
45 "state": "TX",
46 "country": null,
47 "zip": "77063"
48 }
49 }
50 ],
51 "carrier_detail": {
52 "object": "CarrierDetail",
53 "service": "First-Class Package Service",
54 "container_type": null,
55 "est_delivery_date_local": null,
56 "est_delivery_time_local": null,
57 "origin_location": "HOUSTON TX, 77001",
58 "origin_tracking_location": {
59 "object": "TrackingLocation",
60 "city": "HOUSTON",
61 "state": "TX",
62 "country": null,
63 "zip": "77063"
64 },
65 "destination_location": "CHARLESTON SC, 29401",
66 "destination_tracking_location": null,
67 "guaranteed_delivery_date": null,
68 "alternate_identifier": null,
69 "initial_delivery_attempt": null
70 },
71 "finalized": true,
72 "is_return": false,
73 "public_url": "https://track.easypost.com/djE6dHJrX2E0NWRiODhiYjUxOTQ1NTc4NzkyNDZhYmQxMTA2MDZj"
74}
A list of all Tracker
objects associated with the given API Key
can also be retrieved.
See the Pagination section of our docs for more details on retrieving all records when multiple pages are available.
Using the Tracker
List endpoint is the recommended way of retrieving a Tracker
by tracking_code
or carrier
.
Unlike the retrieving a Tracker
using the retrieve endpoint, which accepts an id
, this endpoint accepts the tracking_code
as the search parameter.
Normally, you'll only have one Tracker
with a given tracking_code
, but it is also possible to further filter those results by including the carrier
parameter in your request.
Request Parameters
after_id
.before_id
.end_datetime
.start_datetime
.Trackers
with the given tracking codes. Useful for retrieving Trackers
by tracking_code
rather than by their ids.Trackers
with the given carrier.1curl -X GET "https://api.easypost.com/v2/trackers?page_size=5" \
2 -u "EASYPOST_API_KEY":
1{
2 "trackers": [
3 {
4 "id": "trk_3898303eff624097a516ab324bb133f3",
5 "object": "Tracker",
6 "mode": "test",
7 "tracking_code": "9405500207552011812894",
8 "status": "pre_transit",
9 "status_detail": "status_update",
10 "created_at": "2024-01-24T00:07:43Z",
11 "updated_at": "2024-01-24T00:07:43Z",
12 "signed_by": null,
13 "weight": null,
14 "est_delivery_date": "2024-01-24T00:07:43Z",
15 "shipment_id": "shp_82d5637d74404d1595eacdc7e5ca9273",
16 "carrier": "USPS",
17 "tracking_details": [
18 {
19 "object": "TrackingDetail",
20 "message": "Pre-Shipment Info Sent to USPS",
21 "description": "",
22 "status": "pre_transit",
23 "status_detail": "status_update",
24 "datetime": "2023-12-24T00:07:43Z",
25 "source": "USPS",
26 "carrier_code": "",
27 "tracking_location": {
28 "object": "TrackingLocation",
29 "city": null,
30 "state": null,
31 "country": null,
32 "zip": null
33 }
34 },
35 {
36 "object": "TrackingDetail",
37 "message": "Shipping Label Created",
38 "description": "",
39 "status": "pre_transit",
40 "status_detail": "status_update",
41 "datetime": "2023-12-24T12:44:43Z",
42 "source": "USPS",
43 "carrier_code": "",
44 "tracking_location": {
45 "object": "TrackingLocation",
46 "city": "HOUSTON",
47 "state": "TX",
48 "country": null,
49 "zip": "77063"
50 }
51 }
52 ],
53 "fees": [],
54 "carrier_detail": {
55 "object": "CarrierDetail",
56 "service": "First-Class Package Service",
57 "container_type": null,
58 "est_delivery_date_local": null,
59 "est_delivery_time_local": null,
60 "origin_location": "HOUSTON TX, 77001",
61 "origin_tracking_location": {
62 "object": "TrackingLocation",
63 "city": "HOUSTON",
64 "state": "TX",
65 "country": null,
66 "zip": "77063"
67 },
68 "destination_location": "CHARLESTON SC, 29401",
69 "destination_tracking_location": null,
70 "guaranteed_delivery_date": null,
71 "alternate_identifier": null,
72 "initial_delivery_attempt": null
73 },
74 "public_url": "https://track.easypost.com/djE6dHJrXzM4OTgzMDNlZmY2MjQwOTdhNTE2YWIzMjRiYjEzM2Yz"
75 }
76 ],
77 "has_more": true
78}
Retrieve a Tracker
by its id
.
1curl -X GET https://api.easypost.com/v2/trackers/trk_... \
2 -u "EASYPOST_API_KEY":
1{
2 "id": "trk_3898303eff624097a516ab324bb133f3",
3 "object": "Tracker",
4 "mode": "test",
5 "tracking_code": "9405500207552011812894",
6 "status": "pre_transit",
7 "status_detail": "status_update",
8 "created_at": "2024-01-24T00:07:43Z",
9 "updated_at": "2024-01-24T00:07:43Z",
10 "signed_by": null,
11 "weight": null,
12 "est_delivery_date": "2024-01-24T00:07:43Z",
13 "shipment_id": "shp_82d5637d74404d1595eacdc7e5ca9273",
14 "carrier": "USPS",
15 "tracking_details": [
16 {
17 "object": "TrackingDetail",
18 "message": "Pre-Shipment Info Sent to USPS",
19 "description": "",
20 "status": "pre_transit",
21 "status_detail": "status_update",
22 "datetime": "2023-12-24T00:07:43Z",
23 "source": "USPS",
24 "carrier_code": "",
25 "tracking_location": {
26 "object": "TrackingLocation",
27 "city": null,
28 "state": null,
29 "country": null,
30 "zip": null
31 }
32 },
33 {
34 "object": "TrackingDetail",
35 "message": "Shipping Label Created",
36 "description": "",
37 "status": "pre_transit",
38 "status_detail": "status_update",
39 "datetime": "2023-12-24T12:44:43Z",
40 "source": "USPS",
41 "carrier_code": "",
42 "tracking_location": {
43 "object": "TrackingLocation",
44 "city": "HOUSTON",
45 "state": "TX",
46 "country": null,
47 "zip": "77063"
48 }
49 }
50 ],
51 "fees": [],
52 "carrier_detail": {
53 "object": "CarrierDetail",
54 "service": "First-Class Package Service",
55 "container_type": null,
56 "est_delivery_date_local": null,
57 "est_delivery_time_local": null,
58 "origin_location": "HOUSTON TX, 77001",
59 "origin_tracking_location": {
60 "object": "TrackingLocation",
61 "city": "HOUSTON",
62 "state": "TX",
63 "country": null,
64 "zip": "77063"
65 },
66 "destination_location": "CHARLESTON SC, 29401",
67 "destination_tracking_location": null,
68 "guaranteed_delivery_date": null,
69 "alternate_identifier": null,
70 "initial_delivery_attempt": null
71 },
72 "public_url": "https://track.easypost.com/djE6dHJrXzM4OTgzMDNlZmY2MjQwOTdhNTE2YWIzMjRiYjEzM2Yz"
73}