Authenticate via HTTP Basic Auth with your DHL Express API credentials to the MyDHL API base URL.
POST /shipments with a JSON body containing 'plannedShippingDateAndTime', 'pickup' object (with 'isRequested' boolean and 'closeTime'), 'productCode' (e.g., 'P' for Express Worldwide), 'accounts' array (with 'typeCode' and 'number'), 'shipper' and 'recipient' address objects, 'packages' array, and 'content' object.
Within 'content', include 'exportDeclaration' with 'lineItems' array (each with 'number', 'description', 'price', 'quantity', 'quantityType', 'commodityCodes' with HS code, 'exportReasonType', and 'weight'), 'invoice' details, 'exportReason', and 'incoterms'.
Set 'content.isCustomsDeclarable' to true to trigger customs document generation; the response includes 'documents' with Base64-encoded label and customs invoice PDFs.
Store the 'shipmentTrackingNumber' and 'dispatchConfirmationNumber' from the response for tracking and pickup confirmation.
Known gotchas
DHL Express requires 'plannedShippingDateAndTime' to be a future date/time in ISO 8601 format with timezone offset; past or improperly formatted timestamps return a validation error.
The 'accounts' array must reference a valid DHL account number of the correct type ('shipper', 'duties-taxes-paid', etc.); mismatched account types cause shipment rejection.
Commercial invoice data in 'exportDeclaration' is used to generate regulatory documents; inaccurate declared values or HS codes can trigger customs holds — validate data before submission.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp