DHL Track & Trace

Uses DG paid account API credentials

The action is used to get the tracking information from DHL.

Inputs

NameTypeDescription
Tracking NumberStringDHL tracking number
API KeyStringDHL API KEY generated in the DHL developer portal

If you don't have yet a DHL developer account, to generate the DHL API Key, you will need first to register into DHL Developer Portal..

Once registered, you will need to create an app:

The API that you need to select is Shipment Tracking - Unified:

Now, wait until the APP status is approved:

Open the App and in the Credential Section you will find the API Key:

Outputs

NameTypeDescription
Found Tracking?BooleanWhether the tracking information was found
True / False
StatusStringTracking status:
Ready for Shipment,
Delivered,
In Transit,
Problem with Delivery,
Returning to Sender,
Ready for Pickup
Status DescriptionStringDetailed description of the tracking status
Shipped DateStringThe date of the shipment.
Format:
YYYY-MM-DDThh:mm:ss
Is null when the status is Ready for Shipment
Last Event DateStringThe date of the last tracking event.
Format:
YYYY-MM-DDThh:mm:ss
Estimate Delivery DateStringEstimated delivery date.
Format:
YYYY-MM-DDThh:mm:ss
Very rarely present
Activity HistoryListList of all the tracking events.
See the example below

Sample Response
Activity History

[
    {
        "timestamp": "2021-05-21T14:48:00",
        "location": {
            "address": {
                "addressLocality": "Germany"
            }
        },
        "statusCode": "delivered",
        "status": "The shipment has been successfully delivered",
        "description": "The shipment has been successfully delivered"
    },
    {
        "timestamp": "2021-05-21T09:16:00",
        "statusCode": "transit",
        "status": "The shipment has been loaded onto the delivery vehicle",
        "description": "The shipment has been loaded onto the delivery vehicle"
    },
    {
        "timestamp": "2021-05-21T06:35:00",
        "location": {
            "address": {
                "addressLocality": "Frechen MechZB, Germany"
            }
        },
        "statusCode": "transit",
        "status": "The shipment has been processed in the delivery base.",
        "description": "The shipment has been processed in the delivery base."
    },
    {
        "timestamp": "2021-05-21T03:09:00",
        "location": {
            "address": {
                "addressLocality": "Köln, Germany"
            }
        },
        "statusCode": "transit",
        "status": "The shipment arrived in the region of recipient and will be transported to the delivery base in the next step.",
        "description": "The shipment arrived in the region of recipient and will be transported to the delivery base in the next step."
    },
    {
        "timestamp": "2021-05-20T19:11:00",
        "location": {
            "address": {
                "addressLocality": "Greven, Germany"
            }
        },
        "statusCode": "transit",
        "status": "The shipment has been processed in the parcel center of origin",
        "description": "The shipment has been processed in the parcel center of origin"
    },
    {
        "timestamp": "2021-05-17T13:49:00",
        "statusCode": "pre-transit",
        "status": "The instruction data for this shipment have been provided by the sender to DHL electronically",
        "description": "The instruction data for this shipment have been provided by the sender to DHL electronically"
    }
]

📘

Tracking Status

DHL API returns a status code for each tracking event. DG maps this status code to one of the predefined statuses. E.g. pre-tansit - Ready for Shipment.

Because the status code doesn't describe all the tracking statuses, DG uses the event description and maps it to one of the predefined statuses. E.g. returned to shipper - Returning to Sender.

Statuses mapping

pre-transit - Ready for Shipment
delivered - Delivered
transit - In Transit
failure - Problem with Delivery
unknown - null

Status descriptions treated as Returning to Sender:

return to sender
returned to shipper
returned to sender
has been delivered directly from the parcel center to the business customer