.png)
DHL Integration Guide
Connect DHL shipping, rating, pickup, tracking, and document services with enterprise applications through REST APIs, selected tracking notifications, and Martini workflows.
DHL integration options at a glance
DHL provides product- and region-specific REST APIs for shipment creation, rates and quotes, pickup booking, tracking, delivery status, address validation where available, and shipping documents. Selected DHL products also support push-style tracking notifications, while older DHL Express services may expose legacy SOAP or XML interfaces. Authentication varies by API and can include API keys, subscription keys, HTTP Basic Authentication with an API key and secret, or product-specific OAuth 2.0. Martini can consume the applicable DHL API, receive supported tracking notifications, transform shipment and tracking data, orchestrate retries and validation, and pass labels or customs documents to downstream systems.
Common DHL integration patterns
Common DHL data objects used in integrations
Authentication and security considerations
Product-specific authentication
DHL authentication varies by business unit, API product, country, and account. Integrations may use API keys, subscription keys, HTTP Basic Authentication with an API key and secret, or product-specific OAuth 2.0. Configure the scheme documented for the selected DHL API rather than assuming one method applies across DHL services.
Secrets and account scope
Store DHL credentials, account identifiers, and subscription values in Martini secrets or environment configuration. Access may be constrained by the DHL customer account, subscribed API products, geography, and permitted operations such as shipment creation, rating, pickup booking, or tracking.
Inbound protection
Restrict Martini endpoints used for DHL tracking notifications and validate the request using the authentication or signature mechanism provided by the selected DHL product. Avoid logging credentials or full customs payloads containing sensitive information.
Operational considerations for DHL integrations
Rate limits and retries
Respect the limits associated with the selected DHL API. Use controlled scheduling, retry delays, and backoff for transient responses such as 429, 502, 503, and 504, while separating validation and authentication failures from recoverable service errors.
Pagination and checkpoints
Tracking or shipment searches may use cursors, pages, offsets, or date windows. Store the last successful checkpoint and design incremental retrieval so the same data is not repeatedly processed.
Idempotency and event ordering
Persist internal fulfillment references and DHL waybills before processing retries. Deduplicate tracking events using the waybill, event code, timestamp, location, and DHL event identifier where available. Support duplicate, delayed, and out-of-order notifications.
Documents and schemas
Preserve the MIME type, file name, encoding, and document type for labels, invoices, waybills, and customs documents. Keep DHL-specific mappings versioned because service codes, tracking events, document structures, and required customs fields can vary by product.
Testing and monitoring
Test shipment creation, rating, pickup, tracking, document handling, validation failures, rate limits, and ambiguous timeouts in the applicable DHL environment. Monitor workflow logs, response codes, correlation data, and reconciliation queues without exposing secrets.
Why use Martini instead of scripts or point-to-point integrations?
Reusable orchestration
Scripts often combine DHL authentication, request construction, response parsing, retries, and downstream updates in code that is difficult to reuse. Martini centralizes this orchestration in workflows and reusable integration assets.
Separation of contracts
Martini can expose normalized APIs to internal applications while isolating DHL product, regional, and schema variations behind mappings and business rules. This reduces the need for every application to understand DHL-specific request formats.
Operational reliability
Workflows can coordinate scheduled polling and supported notifications, checkpoints, deduplication, retry paths, document handling, and monitoring. This provides a maintainable foundation for shipment, tracking, rating, and pickup processes compared with multiple point-to-point implementations.