DHL Express API (MyDHL API)

Complete reference guide for integrating with DHL Express MyDHL REST API. Covers shipment creation, tracking, rate calculation, and pickup services.

Overview

AspectDetails
API TypeREST (JSON)
Version3.1.1
AuthenticationHTTP Basic Auth
Production URLhttps://express.api.dhl.com/mydhlapi
Test URLhttps://express.api.dhl.com/mydhlapi/test

Available Services

ServiceEndpointsDescription
Rating/rates, /landed-costGet shipping rates and duty/tax calculations
Shipment/shipmentsCreate shipments with labels
Pickup/pickupsSchedule, update, cancel pickups
Tracking/trackingTrack shipments by AWB
Address/address-validateValidate pickup/delivery capabilities
Products/productsGet available DHL Express products

Authentication

DHL Express API uses HTTP Basic Authentication with your API credentials.

Request Headers

Required Credentials

CredentialDescription
apiKeyYour DHL API key
apiSecretYour DHL API secret
accountNumberYour DHL shipper account number

Common Data Types

PostalAddress

FieldTypeRequiredDescription
addressLine1stringYesStreet address line 1
addressLine2stringNoStreet address line 2
cityNamestringYesCity name
postalCodestringYesPostal/ZIP code
countryCodestringYesISO 2-letter country code
provinceCodestringNoState/province code

ContactInformation

FieldTypeRequiredDescription
fullNamestringYesContact person full name
companyNamestringNoCompany name
phonestringYesPhone number
emailstringNoEmail address

Package

FieldTypeDescription
weightnumberPackage weight (kg or lb)
dimensions.lengthnumberLength (cm or in)
dimensions.widthnumberWidth (cm or in)
dimensions.heightnumberHeight (cm or in)
typeCodestring"BOX", "DOCUMENT", "PALLET", "ENVELOPE"

Account

FieldTypeDescription
typeCodestring"shipper", "payer", "receiver", "duties-taxes"
numberstringDHL account number

1. Rating API

GET/rates

Get shipping rates for a single piece shipment.

Query Parameters
ParameterTypeRequiredDescription
accountNumberstringYesDHL account number
originCountryCodestringYesOrigin country (ISO 2-letter)
originPostalCodestringYesOrigin postal code
originCityNamestringYesOrigin city name
destinationCountryCodestringYesDestination country
destinationPostalCodestringYesDestination postal code
destinationCityNamestringYesDestination city name
weightnumberYesPackage weight
lengthnumberYesPackage length
widthnumberYesPackage width
heightnumberYesPackage height
plannedShippingDatestringYesYYYY-MM-DD format
isCustomsDeclarablebooleanYesRequires customs declaration
unitOfMeasurementstringYes"metric" or "imperial"
Response: Product Object
FieldTypeDescription
productNamestringProduct display name
productCodestringDHL product code (P, D, Y, etc.)
totalPricearrayPrice breakdown by currency type
deliveryCapabilitiesobjectEstimated delivery date and transit days

POST/rates

Get shipping rates for multi-piece shipments.

Request Body
FieldTypeRequiredDescription
customerDetails.shipperDetailsRateAddressYesShipper address
customerDetails.receiverDetailsRateAddressYesReceiver address
plannedShippingDateAndTimestringYesISO 8601 datetime
unitOfMeasurementstringYes"metric" or "imperial"
isCustomsDeclarablebooleanYesRequires customs
packagesPackage[]YesArray of packages
accountsAccount[]YesBilling accounts

POST/landed-cost

Calculate duty, tax, and total shipping charges (landed cost).

2. Shipment API

POST/shipments

Create a DHL Express shipment and get labels.

Request Body
FieldTypeRequiredDescription
plannedShippingDateAndTimestringYesISO 8601 datetime
pickupobjectYesPickup configuration
productCodestringYesDHL product code
accountsAccount[]YesBilling accounts
customerDetails.shipperDetailsPartyYesShipper info
customerDetails.receiverDetailsPartyYesReceiver info
contentobjectYesPackage/customs details
outputImagePropertiesobjectNoLabel format options
Content Object
FieldTypeRequiredDescription
packagesPackage[]YesPackage details
isCustomsDeclarablebooleanYesRequires customs
descriptionstringYesContents description
incotermstringNo"DAP", "DDP", "DDU", "EXW", "FCA"
unitOfMeasurementstringYes"metric" or "imperial"
exportDeclarationobjectNoCustoms details
Output Image Properties
FieldDescription
encodingFormat"pdf", "png", "zpl", "epl"
imageOptions.typeCode"waybillDoc", "label", "invoice", "receipt", "qr-code"
Response
FieldTypeDescription
shipmentTrackingNumberstringMaster AWB number
trackingUrlstringDHL tracking URL
dispatchConfirmationNumberstringPickup confirmation
packagesarrayPackage tracking numbers
documentsarrayLabels/documents (base64)

Product Codes

CodeNameType
PEXPRESS WORLDWIDEInternational
DEXPRESS WORLDWIDE (Non-Doc)International
YEXPRESS 12:00International
TEXPRESS 12:00 (Non-Doc)International
KEXPRESS 9:00International
WECONOMY SELECTInternational
XEXPRESS ENVELOPEInternational
NDOMESTIC EXPRESSDomestic
1DOMESTIC EXPRESS 12:00Domestic

3. Pickup API

POST/pickups

Create a pickup request.

Request Body
FieldTypeRequiredDescription
plannedPickupDateAndTimestringYesPickup date/time
closeTimestringYesLocation closing time
locationstringNoPickup location description
locationTypestringNo"business" or "residence"
accountsAccount[]YesAccount details
customerDetails.shipperDetailsPartyYesShipper info
shipmentDetailsarrayYesShipment summary
Response
FieldTypeDescription
dispatchConfirmationNumbersstring[]Pickup confirmation IDs
readyByTimestringPickup ready time

Update & Cancel Pickup

PATCH/pickups/{dispatchConfirmationNumber}

Update an existing pickup request. Request body same as POST /pickups.

DELETE/pickups/{dispatchConfirmationNumber}

Cancel a pickup request.

Query ParameterRequiredDescription
requestorNameYesName of person canceling
reasonYesCancellation reason

4. Tracking API

GET/shipments/{shipmentTrackingNumber}/tracking

Track a single shipment by AWB number.

Query Parameters
ParameterDescription
trackingView"shipment-details-only", "all-checkpoints", "last-checkpoint"
levelOfDetail"shipment" or "piece"
Tracking Event Type Codes
CodeDescription
PUPicked up
PLProcessed at facility
AFArrived at DHL facility
DFDeparted DHL facility
ARArrived at destination
WCWith delivery courier
OKDelivered
CCCustoms clearance

5. Address Validation

GET/address-validate

Validate DHL pickup/delivery capabilities at an address.

Query Parameters
ParameterRequiredDescription
typeYes"pickup" or "delivery"
countryCodeYesISO 2-letter country code
postalCodeYesPostal code
cityNameNoCity name

6. Products API

GET/products

Get available DHL Express products for a route. Query parameters same as GET /rates.

Response includes product availability, delivery capabilities, and pickup cutoff times.

Error Handling

Error Response Format

HTTP Status Codes

StatusDescription
200Success
201Created (shipment, pickup)
400Bad Request - Invalid parameters
401Unauthorized - Invalid credentials
404Not Found - Resource not found
422Unprocessable Entity - Validation error
500Internal Server Error

Environments

EnvironmentBase URL
Productionhttps://express.api.dhl.com/mydhlapi
Test/Sandboxhttps://express.api.dhl.com/mydhlapi/test

Test Tracking Numbers

NBOX Logistics Logo

Your comprehensive platform for managing logistics, communications, and business operations.


© 2026 NBOX Logistics. All rights reserved.