Trackers
Karrio exposes API endpoints that forwards tracking requests to the carrier's API.
Trackers Management APIs
The trackers management APIs offer a set of endpoints around the karrio unified tracking details object.
Create a tracker
POST
/v1/trackers
You can use this endpoint to create a tracker object in the karrio system and get the latest tracking details of the shipment.
The karrio tracker is periodically updated by the karrio worker to stay up to date with the package throughout it's journey.
- Request
- Response
curl --request POST \
--url 'https://api.karrio.io/v1/trackers' \
--header 'Authorization: Token [API_KEY]' \
--data '{
"tracking_number": "397538144353",
"carrier_name": "fedex"
}'
{
"id": "trk_26e12fc85d04425e81bbf39622b7b68f",
"carrier_name": "fedex",
"carrier_id": "FEDX",
"tracking_number": "397538144353",
"info": {
"carrier_tracking_link": "https://www.fedex.com/fedextrack/?trknbr=397538144353",
"customer_name": null,
"expected_delivery": null,
"note": null,
"order_date": null,
"order_id": null,
"package_weight": "0.8",
"package_weight_unit": "LB",
"shipment_package_count": null,
"shipment_pickup_date": null,
"shipment_delivery_date": null,
"shipment_service": "FedEx Ground",
"shipment_origin_country": "US",
"shipment_origin_postal_code": null,
"shipment_destination_country": "US",
"shipment_destination_postal_code": null,
"shipping_date": null,
"signed_by": null,
"source": "api"
},
"events": [
{
"date": "2023-05-01",
"description": "Delivered",
"location": "Logansport, IN, 46947, US",
"code": "DL",
"time": "10:39",
"latitude": null,
"longitude": null
},
{
"date": "2023-05-01",
"description": "On FedEx vehicle for delivery",
"location": "KOKOMO, IN, 46901, US",
"code": "OD",
"time": "05:27",
"latitude": null,
"longitude": null
},
{
"date": "2023-05-01",
"description": "At local FedEx facility",
"location": "KOKOMO, IN, 46901, US",
"code": "AR",
"time": "05:01",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-29",
"description": "At local FedEx facility",
"location": "KOKOMO, IN, 46901, US",
"code": "AR",
"time": "05:52",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-29",
"description": "Departed FedEx location",
"location": "INDEPENDENCE, KY, 41051, US",
"code": "DP",
"time": "01:03",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-28",
"description": "Arrived at FedEx location",
"location": "INDEPENDENCE, KY, 41051, US",
"code": "AR",
"time": "13:49",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-28",
"description": "In transit",
"location": "INDEPENDENCE, KY, 41051, US",
"code": "IT",
"time": "10:58",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-27",
"description": "In transit",
"location": "GOODLETTSVILLE, TN, 37072, US",
"code": "IT",
"time": "18:32",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-27",
"description": "Departed FedEx location",
"location": "HUTCHINS, TX, 75141, US",
"code": "DP",
"time": "06:24",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-27",
"description": "Arrived at FedEx location",
"location": "HUTCHINS, TX, 75141, US",
"code": "AR",
"time": "02:23",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-26",
"description": "Left FedEx origin facility",
"location": "IRVING, TX, 75062, US",
"code": "DP",
"time": "22:50",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-26",
"description": "Shipment arriving On-Time",
"location": "IRVING, TX, 75062, US",
"code": "AO",
"time": "20:33",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-26",
"description": "Arrived at FedEx location",
"location": "IRVING, TX, 75062, US",
"code": "AR",
"time": "20:32",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-26",
"description": "Picked up",
"location": "IRVING, TX, 75062, US",
"code": "PU",
"time": "17:05",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-26",
"description": "In FedEx possession",
"location": "DALLAS, TX, 75234, US",
"code": "IP",
"time": "16:50",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-26",
"description": "Shipment information sent to FedEx",
"location": "CUSTOMER",
"code": "OC",
"time": "16:42",
"latitude": null,
"longitude": null
}
],
"delivered": true,
"test_mode": false,
"status": "delivered",
"estimated_delivery": "2023-05-01",
"meta": {
"ext": "fedex",
"carrier": "fedex"
},
"object_type": "tracker",
"metadata": {},
"messages": []
}
Proxy Request API
The proxy APIs allow you to send tracking requests to carriers without creating any objects in karrio.
In that schenario, karrio is just a proxy that forward requests.
Get tracking details
POST
/v1/proxy/tracking
You can use this endpoint to retrieve tracking details from the issuing carrier.
- Request
- Response
curl --request POST \
--url 'https://api.karrio.io/v1/proxy/tracking' \
--header 'Authorization: Token [API_KEY]' \
--data '{
"tracking_number": "397538144353",
"carrier_name": "fedex"
}'
{
"messages": [],
"tracking": {
"id": "trk_a1af28807b1d4f8e8fa41111806d8c53",
"carrier_name": "fedex",
"carrier_id": "FEDX",
"tracking_number": "397538144353",
"info": {
"carrier_tracking_link": "https://www.fedex.com/fedextrack/?trknbr=397538144353",
"customer_name": null,
"expected_delivery": null,
"note": null,
"order_date": null,
"order_id": null,
"package_weight": "0.8",
"package_weight_unit": "LB",
"shipment_package_count": null,
"shipment_pickup_date": null,
"shipment_delivery_date": null,
"shipment_service": "FedEx Ground",
"shipment_origin_country": "US",
"shipment_origin_postal_code": null,
"shipment_destination_country": "US",
"shipment_destination_postal_code": null,
"shipping_date": null,
"signed_by": null,
"source": "api"
},
"events": [
{
"date": "2023-05-01",
"description": "Delivered",
"location": "Logansport, IN, 46947, US",
"code": "DL",
"time": "10:39",
"latitude": null,
"longitude": null
},
{
"date": "2023-05-01",
"description": "On FedEx vehicle for delivery",
"location": "KOKOMO, IN, 46901, US",
"code": "OD",
"time": "05:27",
"latitude": null,
"longitude": null
},
{
"date": "2023-05-01",
"description": "At local FedEx facility",
"location": "KOKOMO, IN, 46901, US",
"code": "AR",
"time": "05:01",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-29",
"description": "At local FedEx facility",
"location": "KOKOMO, IN, 46901, US",
"code": "AR",
"time": "05:52",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-29",
"description": "Departed FedEx location",
"location": "INDEPENDENCE, KY, 41051, US",
"code": "DP",
"time": "01:03",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-28",
"description": "Arrived at FedEx location",
"location": "INDEPENDENCE, KY, 41051, US",
"code": "AR",
"time": "13:49",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-28",
"description": "In transit",
"location": "INDEPENDENCE, KY, 41051, US",
"code": "IT",
"time": "10:58",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-27",
"description": "In transit",
"location": "GOODLETTSVILLE, TN, 37072, US",
"code": "IT",
"time": "18:32",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-27",
"description": "Departed FedEx location",
"location": "HUTCHINS, TX, 75141, US",
"code": "DP",
"time": "06:24",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-27",
"description": "Arrived at FedEx location",
"location": "HUTCHINS, TX, 75141, US",
"code": "AR",
"time": "02:23",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-26",
"description": "Left FedEx origin facility",
"location": "IRVING, TX, 75062, US",
"code": "DP",
"time": "22:50",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-26",
"description": "Shipment arriving On-Time",
"location": "IRVING, TX, 75062, US",
"code": "AO",
"time": "20:33",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-26",
"description": "Arrived at FedEx location",
"location": "IRVING, TX, 75062, US",
"code": "AR",
"time": "20:32",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-26",
"description": "Picked up",
"location": "IRVING, TX, 75062, US",
"code": "PU",
"time": "17:05",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-26",
"description": "In FedEx possession",
"location": "DALLAS, TX, 75234, US",
"code": "IP",
"time": "16:50",
"latitude": null,
"longitude": null
},
{
"date": "2023-04-26",
"description": "Shipment information sent to FedEx",
"location": "CUSTOMER",
"code": "OC",
"time": "16:42",
"latitude": null,
"longitude": null
}
],
"delivered": true,
"test_mode": false,
"status": "delivered",
"estimated_delivery": "2023-05-01",
"meta": {
"ext": "fedex",
"carrier": "fedex"
},
"object_type": "tracker",
"metadata": {},
"messages": []
}
}
Tracking & Webhooks
Karrio provides a simple way to track packages and get notified of changes. You can use our Tracking API to track packages and get notified via Webhooks when the status of a package changes.
- To leverage that combination, create a webhook and subscribe to tracker related events
- Request
- Response
curl --request POST \
--url 'https://api.karrio.io/v1/webhooks' \
--header 'Authorization: Token [API_KEY]' \
--data '{
"url": "http://example.com",
"description": "tracking events webhook",
"enabled_events": [
"tracker_created",
"tracker_updated"
]
}'
{
"id": "weh_1d8e9ae5d85f471d9b55ff67d5e9f8d9",
"url": "http://example.com",
"description": "tracking events webhook",
"enabled_events": [
"tracker_created",
"tracker_updated"
],
"disabled": false,
"object_type": "webhook",
"last_event_at": null,
"secret": "whsec_626bb46d31cf4d0b802b660e84ddf1c8",
"test_mode": false
}
- Process the events sent to your webhook
The following events samples illustrate the typical payload you will receive.
You can determine your code's behavior based on the event.type
, event.data.status
.
Note that the event will only be sent when there is a data change (e.g. status change and new milestone event).
- Tracker created event
- Tracker updated event
{
"id": "evt_f31270d74fb94e3cb534bdfbf904ccb1",
"type": "tracker_created",
"data": {
"carrier_id": "FEDX",
"carrier_name": "fedex",
"delivered": false,
"events": [
{
"code": "CREATED",
"date": "2023-05-25",
"description": "Label created and ready for shipment",
"time": "16:44"
}
],
"id": "trk_d34e7d3759ee4a2e8694c5affb90c62f",
"info": {
"carrier_tracking_link": "https://www.fedex.com/fedextrack/?trknbr=398779539840",
"customer_name": "DCO MOTORS EAGLE ADI, LLC",
"shipment_destination_country": "US",
"shipment_destination_postal_code": "11901-2051",
"shipment_origin_country": "CA",
"shipment_origin_postal_code": "T1H5H3",
"shipment_package_count": "2",
"shipment_service": "FEDEX INTERNATIONAL ECONOMY",
"shipping_date": "2023-05-25",
"source": "api"
},
"meta": {
"carrier": "fedex"
},
"metadata": {},
"object_type": "tracker",
"status": "pending",
"test_mode": false,
"tracking_number": "398779539840"
},
"test_mode": false,
"pending_webhooks": 0,
"created_at": "2023-05-25T16:44:18.307063+00:00"
}
{
"id": "evt_0dc49c331f5640678908b17596a80584",
"type": "tracker_updated",
"data": {
"carrier_id": "FEDX",
"carrier_name": "fedex",
"delivered": true,
"estimated_delivery": "2023-05-25",
"events": [
{
"code": "DL",
"date": "2023-05-25",
"description": "Delivered",
"location": "ARVADA, CO, 80004, US",
"time": "15:21"
},
{
"code": "OD",
"date": "2023-05-25",
"description": "On FedEx vehicle for delivery",
"location": "LOUISVILLE, CO, 80027, US",
"time": "07:53"
},
{
"code": "AR",
"date": "2023-05-25",
"description": "At local FedEx facility",
"location": "LOUISVILLE, CO, 80027, US",
"time": "07:37"
},
{
"code": "AR",
"date": "2023-05-24",
"description": "At destination sort facility",
"location": "DENVER, CO, 80249, US",
"time": "17:09"
},
{
"code": "DP",
"date": "2023-05-24",
"description": "Departed FedEx hub",
"location": "MEMPHIS, TN, 38118, US",
"time": "15:35"
},
{
"code": "CC",
"date": "2023-05-24",
"description": "International shipment release - Import",
"location": "MEMPHIS, TN, 38194, US",
"time": "13:12"
},
{
"code": "CC",
"date": "2023-05-24",
"description": "International shipment release - Import",
"location": "MEMPHIS, TN, 38194, US",
"time": "11:11"
},
{
"code": "IT",
"date": "2023-05-24",
"description": "In transit",
"location": "MEMPHIS, TN, 38118, US",
"time": "03:50"
},
{
"code": "AR",
"date": "2023-05-24",
"description": "Arrived at FedEx hub",
"location": "MEMPHIS, TN, 38118, US",
"time": "00:02"
},
{
"code": "IT",
"date": "2023-05-23",
"description": "In transit",
"location": "CALGARY, AB, T2E8Z9, CA",
"time": "19:36"
},
{
"code": "IT",
"date": "2023-05-23",
"description": "In transit",
"location": "CALGARY, AB, T2E8Z9, CA",
"time": "18:30"
},
{
"code": "DP",
"date": "2023-05-23",
"description": "Left FedEx origin facility",
"location": "CALGARY, AB, T2E8Z9, CA",
"time": "18:30"
},
{
"code": "AO",
"date": "2023-05-23",
"description": "Shipment arriving On-Time",
"location": "LETHBRIDGE, AB, T1H5K9, CA",
"time": "14:26"
},
{
"code": "PU",
"date": "2023-05-23",
"description": "Picked up",
"location": "LETHBRIDGE, AB, T1H5K9, CA",
"time": "14:15"
},
{
"code": "OC",
"date": "2023-05-23",
"description": "Shipment information sent to FedEx",
"location": "CUSTOMER",
"time": "12:34"
}
],
"id": "trk_6792cdaef07a46a88b944044333c6af3",
"info": {
"carrier_tracking_link": "https://www.fedex.com/fedextrack/?trknbr=398678121664",
"customer_name": "BEAR MOUNTAIN ACCESSORIES INC",
"package_weight": "19.0",
"package_weight_unit": "LB",
"shipment_destination_country": "CA",
"shipment_destination_postal_code": "80004-2286",
"shipment_origin_country": "US",
"shipment_origin_postal_code": "T1H5H3",
"shipment_package_count": "1",
"shipment_service": "FedEx International Economy",
"shipping_date": "2023-05-23",
"source": "api"
},
"meta": {},
"metadata": {},
"object_type": "tracker",
"status": "delivered",
"test_mode": false,
"tracking_number": "398678121664"
},
"test_mode": false,
"pending_webhooks": 0,
"created_at": "2023-05-25T22:01:06.063460+00:00"
}
Learn more about the supported tracking statuses
`pending` - pending
`unknown` - unknown
`delivered` - delivered
`on_hold` - on_hold
`in_transit` - in_transit
`delivery_delayed` - delivery_delayed
`out_for_delivery` - out_for_delivery
`ready_for_pickup` - ready_for_pickup
`delivery_failed` - delivery_failed
For more advanced use cases, you can access the carrier's events details and raw event code.
...
{
"code": "OD",
"date": "2023-05-25",
"description": "On FedEx vehicle for delivery",
"location": "LOUISVILLE, CO, 80027, US",
"time": "07:53"
},
...
Next steps
- To start integrating, Checkout the Tracking Reference.
- Got a question? Ask here.