Integrating DHL Logistics Services Into a Mobile App
A typical scenario: an online store processing 5,000 orders per month spends up to 20 hours per week manually creating shipping labels and checking statuses. Errors in volumetric weight calculation cause overpayments of 30–50%, and selecting the wrong DHL API blocks shipments for certain regions. We solve these problems by integrating the DHL API—from choosing the right endpoints to publishing in app stores. Automated rate calculation allows clients to save up to 20% on shipping by selecting the optimal DHL product, translating to typical monthly savings of $500–$2,000 depending on volume.
DHL Group comprises several divisions, each with its own API. Choosing the wrong one leads to non-functional features or unexpected authentication errors.
| Division | API | Purpose |
|---|---|---|
| DHL Express | Express API | International express shipping, 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) |
Which DHL API Should You Choose for Your Mobile App?
For most e-commerce apps, you need the DHL Express API (international shipments) or DHL Parcel (delivery within Germany/Europe). DHL Express uses Basic Auth, while DHL Parcel uses OAuth 2.0. We will recommend the best option for your business model. Manual label creation takes 5 minutes per shipment; automated creation via our integration takes under 2 seconds—that's 150 times faster.
How Does DHL Calculate Volumetric Weight?
Endpoint for DHL Express rate calculation:
GET /rates?accountNumber={account}&originCountryCode=RU &originCityName=Moscow&destinationCountryCode=DE &destinationCityName=Berlin&weight=2.5&length=30 &width=20&height=15&plannedShippingDateAndTime=YYYY-MM-DDTHH:MM:SS Returns a list of products (EXPRESS WORLDWIDE, EXPRESS 12:00, etc.) with prices and delivery times. In the mobile app, display the comparison as a list.
Critical point: weight and dimensions. DHL calculates volumetric weight: (length × width × height) / 5000. The chargeable weight is the maximum of actual and volumetric weight. According to DHL official documentation, inaccurate dimension input can increase the cost by 30–50%. The app must explain the reason for the final weight to the user.Source: Wikipedia: Volumetric weight
Authentication with DHL API
DHL Express API uses Basic Auth with DHL account credentials. In production, you need a 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. Obtain an access_token via POST /oauth/token and include it in every request. The token expires after 3600 seconds—cache it and refresh automatically. For error handling, implement retry logic with exponential backoff for HTTP 429 rate limits and 5xx server errors.
Creating a Shipment and Label
POST /shipments creates a shipment and returns a tracking number and label URL in PDF or ZPL format (for thermal printers). For in-app label generation on iOS, use WKWebView to render PDF or UIPrintInteractionController for direct printing. On Android—PdfRenderer or a print intent via PrintManager. Webhooks are about 2x more efficient in server load compared to polling, making them the better choice for high-load apps.
Real-Time Tracking Options
DHL Shipment Tracking API (GET /tracking/shipments?trackingNumber=...) returns the full event history with codes and descriptions. A poll interval of 30 minutes is sufficient for most scenarios. API limits in sandbox: 250 requests per day.
For push notifications on status: DHL Tracking Webhook (available for enterprise accounts) sends events in real time. Alternative—polling via WorkManager / BGAppRefreshTask.
Included Deliverables
- Selection of the appropriate DHL API (Express, Parcel, eCommerce).
- Implementation of authentication (Basic Auth or OAuth 2.0).
- Integration of rate calculation and order creation.
- Label generation (PDF/ZPL) and printing.
- Tracking with real-time notifications.
- Testing in sandbox and production.
- Documentation prep and team training.
Timeline and Investment
- Analysis—clarify requirements, select API, design architecture (2–3 days).
- Integration—implement authentication, calculation, shipment creation (1–2 weeks).
- Tracking—add polling or webhooks, push notifications (1 week).
- Testing—cover edge cases, load testing (3–5 days).
- Publishing—upload to App Store / Google Play, update configurations (2–4 days).
Estimated timelines: from 2 weeks for basic tracking and calculation to 4 weeks for a full cycle with labels and webhooks. For a full-cycle integration, clients typically invest $8,000–$12,000, which is recouped within 3–6 months due to operational savings. Cost is calculated individually after audit. Contact us for an accurate estimate of your project.
Comparison of Delivery Status Retrieval Methods
| Method | Delay | Server Load | Implementation Complexity |
|---|---|---|---|
| Polling every 30 min | up to 30 min | medium | low |
| Webhook | real-time | low | medium |
Conclusion: webhook is the best choice for high-load mobile apps.
Get a consultation on integrating DHL into your mobile app—our expertise and quality assurance ensure stable operation. With 5+ years of hands-on experience and over 20 successful DHL integrations, we guarantee reliable and efficient solutions. Operating cost savings can reach 15–20% from optimal tariff selection and automation. The integration pays for itself within 3–6 months.
Real Case: From Manual to Automated
On a recent project for a European e-commerce platform handling 3,000 shipments per month, we integrated DHL Express API. Previously, they manually created shipments in the DHL web interface, taking up to 5 minutes per shipment—about 250 hours per month. With our integration, shipment creation via the app now takes under 2 seconds, reducing handling time by 98%—that's 50 times faster. Additionally, volumetric weight errors dropped from 30% of shipments to under 5%, because the app auto-calculates and validates dimensions before submission. The client now saves €4,000 per month in operational costs.
Common Pitfalls to Avoid
- Using sandbox credentials in production—both environments require separate accounts and keys.
- Ignoring dimensional weight: always request and validate length, width, and height from the user.
- Not caching OAuth tokens for DHL Parcel—each API call would require a new token, increasing latency and hitting rate limits.
- Assuming all DHL APIs use the same authentication—Express uses Basic Auth, Parcel uses OAuth 2.0, and eCommerce uses API keys.
Avoid these mistakes by partnering with experienced developers who have handled multiple DHL integrations.







