0% found this document useful (0 votes)
271 views6 pages

Sample API Callouts for Shipping Tracking

The document provides examples of API calls and responses for tracking shipments and packages from several carriers including DHL, FedEx, UPS, and USPS. A request is made to each carrier's tracking API with parameters like the tracking number. The response returns shipment details like status, location, and events for the given tracking number.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
271 views6 pages

Sample API Callouts for Shipping Tracking

The document provides examples of API calls and responses for tracking shipments and packages from several carriers including DHL, FedEx, UPS, and USPS. A request is made to each carrier's tracking API with parameters like the tracking number. The response returns shipment details like status, location, and events for the given tracking number.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Sample API Callouts

DHL

Request:

[Link]

Headers:

DHL-API-Key: 9qioA8vJc51DSvchQX461UnZzNWTxxxx

Response:

{
"shipments": [
{
"id": "7777777770",
"service": "express",
"origin": {
"address": {
"addressLocality": "MILAN - PESCHIERA BORROMEO - ITALY"
}
},
"destination": {
"address": {
"addressLocality": "ZURICH - UNTERENGSTRINGEN - SWITZERLAND"
}
},
"status": {
"timestamp": "2020-12-07T[Link]",
"location": {
"address": {
"addressLocality": "MILAN - ITALY"
}
},
"description": "Please contact DHL"
},
"details": {
"proofOfDelivery": {
"signatureUrl": "[Link]
%3D%3D&pudate=jiNPeY6aSw7abZB9N5hG3w%3D%3D&appuid=NeQLZmL2WBPaKWVDPTi1%2FA%3D
%3D&language=en&country=G0",
"documentUrl": "[Link]
%3D%3D&pudate=jiNPeY6aSw7abZB9N5hG3w%3D%3D&appuid=NeQLZmL2WBPaKWVDPTi1%2FA%3D
%3D&language=en&country=G0"
},
"totalNumberOfPieces": 1
},
"events": [
{
"timestamp": "2020-12-07T[Link]",
"location": {
"address": {
"addressLocality": "MILAN - ITALY"
}
},
"description": "Please contact DHL"
},
{
"timestamp": "2020-12-07T[Link]",
"location": {
"address": {
"addressLocality": "MILAN - ITALY"
}
},
"description": "Shipper has generated a shipment label, but the shipment has not yet been handed over
to DHL"
}
]
}
],
"possibleAdditionalShipmentsUrl": [
"/track/shipments?trackingNumber=7777777770&service=freight",
"/track/shipments?trackingNumber=7777777770&service=dgf",
"/track/shipments?trackingNumber=7777777770&service=ecommerce",
"/track/shipments?trackingNumber=7777777770&service=parcel-de",
"/track/shipments?trackingNumber=7777777770&service=parcel-nl",
"/track/shipments?trackingNumber=7777777770&service=parcel-pl"
]
}
FedEx

Request:

Response:
UPS

Request:

[Link]

Headers:

transactionSrc: A_Test
AccessLicenseNumber: 2D916189F6E5xxxx
Content-Type: application/json
Accept: application/json

Response:

{
"trackResponse": {
"shipment": [
{
"package": [
{
"trackingNumber": "1Z5338FF0107231059",
"activity": [
{
"location": {
"address": {
"city": "BALDWIN",
"stateProvince": "MD",
"postalCode": "",
"country": "US"
}
},
"status": {
"type": "X",
"description": "DeliveryAttempted",
"code": "48"
},
"date": "20191121",
"time": "140400"
},
{
"location": {
"address": {
"city": "Sparks",
"stateProvince": "MD",
"postalCode": "",
"country": "US"
}
},
"status": {
"type": "X",
"description":
"[Link]'llmakeasecondattemptthenextbusinessday.",
"code": "48"
},
"date": "20191121",
"time": "135800"
},
{
"location": {
"address": {
"city": "",
"stateProvince": "",
"postalCode": "",
"country": "US"
}
},
"status": {
"type": "M",
"description": "OrderProcessed:ReadyforUPS",
"code": "MP"
},
"date": "20191119",
"time": "132642"
}
]
}
]
}
]
}
}
USPS

Request:

[Link]
USERID="863OKTANxxxx"><TrackID ID="9505511755661034338575"/></TrackRequest>

Response:

<?xml version="1.0" encoding="UTF-8"?>


<TrackResponse>
<TrackInfo ID="9505511755661034338575">
<TrackSummary>Your item was delivered at the front door or porch at 1:47 pm on February 5, 2021 in CASA
GRANDE, AZ 85122.</TrackSummary>
<TrackDetail>Out for Delivery, 02/05/2021, 7:38 am, CASA GRANDE, AZ 85122</TrackDetail>
<TrackDetail>Arrived at Post Office, February 5, 2021, 7:27 am, CASA GRANDE, AZ 85122</TrackDetail>
<TrackDetail>Departed USPS Regional Facility, 02/05/2021, 5:00 am, PHOENIX AZ DISTRIBUTION CENTER
ANNEX</TrackDetail>
<TrackDetail>Arrived at USPS Regional Destination Facility, 02/05/2021, 1:33 am, PHOENIX AZ
DISTRIBUTION CENTER ANNEX</TrackDetail>
<TrackDetail>Departed USPS Regional Facility, February 4, 2021, 4:19 am, CHARLESTON WV PROCESSING
CENTER</TrackDetail>
<TrackDetail>Arrived at USPS Regional Origin Facility, 02/03/2021, 8:13 pm, CHARLESTON WV PROCESSING
CENTER</TrackDetail>
<TrackDetail>Departed Post Office, February 3, 2021, 5:04 pm, WINFIELD, WV 25213</TrackDetail>
<TrackDetail>USPS in possession of item, February 3, 2021, 4:01 pm, WINFIELD, WV 25213</TrackDetail>
</TrackInfo>
</TrackResponse>

You might also like