DHL Logistics Services Integration into Mobile Application
DHL provides advanced API ecosystem via developer.dhl.com. Unlike many logistics operators, documentation is quality, sandbox environment available immediately after registration, APIs follow REST conventions. Doesn't mean integration is trivial—DHL has its specifics.
DHL API Suite
DHL Group combines several divisions, each with its API:
| Division | API | Purpose |
|---|---|---|
| DHL Express | Express API | International express delivery, shipment creation, labels |
| DHL Parcel | Parcel DE/NL/BE API | Intra-regional delivery in Europe |
| DHL eCommerce | Global Forwarding API | Cross-border e-commerce delivery |
| DHL Supply Chain | — | Warehouse operations (corporate segment) |
For most e-commerce mobile apps, need DHL Express API (international shipments) or DHL Parcel (delivery across Germany/Europe). Different base URLs, different request formats, different tokens.
Authorization
DHL Express API uses Basic Auth with DHL account credentials. Production requires real DHL Express account with API access enabled—sandbox and production use different credentials.
DHL Parcel (new API) works via OAuth 2.0 Client Credentials Flow. Get access_token via POST /oauth/token and use in each request. Token lives 3600 seconds—cache and refresh automatically.
Tariff Calculation
Endpoint for DHL Express cost calculation:
GET /rates?accountNumber={account}&originCountryCode=RU
&originCityName=Moscow&destinationCountryCode=DE
&destinationCityName=Berlin&weight=2.5&length=30
&width=20&height=15&plannedShippingDateAndTime=2024-01-15T09:00:00
Returns list of products (EXPRESS WORLDWIDE, EXPRESS 12:00, etc.) with prices and delivery times. In mobile app show user comparison of options in list—don't hide behind radio buttons.
Critical moment: weight and dimensions. DHL calculates volumetric weight: (length × width × height) / 5000. Takes maximum of actual and volumetric weight. App should explain to user why final weight exceeds entered.
Creating Shipment and Label
POST /shipments creates shipment and returns track number and label URL in PDF or ZPL format (for thermal printers). Generate label in app on iOS use WKWebView for PDF rendering or UIPrintInteractionController for direct printing. Android—PdfRenderer or print intent via PrintManager.
Real-time Tracking
DHL Shipment Tracking API (GET /tracking/shipments?trackingNumber=...) returns full event history with codes and descriptions. Refresh frequency: every 30 minutes sufficient for most scenarios. API limits in sandbox—250 requests/day.
For push notifications on status: DHL Tracking Webhook (available for enterprise accounts) sends events in real time to your webhook URL. Alternative—polling via WorkManager / BGAppRefreshTask.
Timeline: tracking and tariff calculation integration—1-2 weeks. Full shipment creation cycle with labels and webhooks—3-4 weeks.







