DHL Express Shipping - DHL REST API Integration
Modern DHL REST API integration for global express shipping
The DHL Express Shipping module integrates with DHL REST API to automatically calculate shipping rates based on weight and address, create DHL shipments directly from delivery orders, print shipping labels in PDF or thermal format, track shipment status via tracking number, and generate return labels for customers.
The module supports customs declaration for international goods, automatic shipping insurance calculation, and various DHL Express products.
Key Features
Key points
• Modern DHL REST API integration with high performance
• Automatic shipping rate calculation based on weight and address
• Create DHL shipments directly from delivery orders
• Print shipping labels in PDF or thermal format (8x4, 6x4)
• Track shipment status via tracking number
• Generate return labels for customers (automatic or manual)
• Support customs declaration for international goods
• Automatic shipping insurance calculation
User Groups
User Permissions
| Group | Main Role |
|---|---|
| Warehouse Staff | Create shipping labels, print labels, pack goods |
| Sales Staff | Calculate rates, add shipping fees to orders |
| Logistics Manager | Configure shipping methods, manage DHL account |
EN/VI Terminology Reference
| Fields | Trường dữ liệu | Description |
|---|---|---|
| DHL API Key | Mã khóa API DHL | API key from DHL Developer Portal |
| DHL API Secret | Mã bí mật API DHL | Secret from DHL Developer Portal |
| DHL Account Number | Số tài khoản DHL | DHL Express account number |
| Region | Khu vực | Asia Pacific, America, Europe |
| DHL Product | Sản phẩm DHL | D - Express Worldwide, P - Express Worldwide, U - Express Worldwide |
| DHLxw Package Type | Loại kiện hàng DHLxw | DHL Box, Customer Provided |
| Unit System | Hệ thống đơn vị | Metric (kg, cm) or Imperial (lb, in) |
| Label Image Format | Định dạng hình ảnh nhãn | PDF, ZPL, EPL |
| Label Template | Nhãn mẫu | 8X4_A4_PDF, 6X4_A4_PDF, thermal |
| Dutiable Material | Nguyên liệu tính thuế | Taxable goods |
| Duties paid by | Người trả thuế quan | Sender, Recipient, Carrier |
| Tracking Number | Số theo dõi | DHL tracking code |
Configure DHL Shipping Method
Detailed configuration steps:
Steps
1. Go to Inventory → Configuration → Delivery → Shipping Methods
2. Click New and fill: Shipping Method (name), Provider (DHL), Delivery Product
3. DHL Configuration tab - Authentication: DHL API Key, DHL API Secret, DHL Account Number
4. Configure region: Region (AP for Vietnam, AM for Americas, EU for Europe)
5. Select DHL Product: D - Express Worldwide (most common)
6. Configure package: DHLxw Package Type (DHL Box), Unit System (Metric for kg/cm)
7. Configure labels: Label Image Format (PDF), Label Template (8X4_A4_PDF)
8. Options: Dutiable Material (international goods), Duties paid by, Return label on delivery
Calculate Shipping Rates
Process for calculating rates from order:
Key points
• Factors affecting rate: Total weight, sender/receiver address, DHL product type, customs declaration, insurance
• Note: Products must have weight > 0, complete address (street, city, zip, country, phone)
Steps
1. Create new order: Sales → Orders → New
2. Add products to order
3. Select delivery address (Delivery Address)
4. Click Add Shipping
5. Select DHL method
6. Click Get Rate → system automatically calculates rate
Create DHL Shipment
Shipment creation process:
Key points
• Info sent to DHL: Sender (warehouse), receiver (customer), package list, weight/dimensions, goods value, customs declaration
• Result: Tracking number, shipping label PDF, customs documents (if applicable)
Steps
1. Confirm order → creates delivery order (Delivery Order)
2. Open delivery order
3. Check: Complete delivery address, accurate weight, Carrier = DHL
4. Click Validate to confirm shipment
5. System automatically: Calls DHL API, creates tracking number, downloads label, attaches to chatter
Print Shipping Label
Steps to print label:
Steps
1. Open validated delivery order
2. Go to Chatter tab (below form)
3. Find attachment: LabelShipping-DHL-[tracking_number].pdf
4. Click file to view or download
5. Print label on A4 paper or thermal printer
Label Formats
| Template | Size | Use For |
|---|---|---|
| 8X4_A4_PDF | 8x4 inch on A4 | Laser/inkjet printer |
| 8X4_thermal | 8x4 inch | Thermal printer |
| 6X4_A4_PDF | 6x4 inch on A4 | Laser/inkjet printer |
| 6X4_thermal | 6x4 inch | Thermal printer |
Track Shipment
Tracking number and DHL tracking:
Key points
• View tracking: Tracking Reference field on Delivery Order, Delivery tab of Sales Order
• Track online: Click Tracking button or visit http://www.dhl.com/en/express/tracking.html?AWB=[tracking_number]
• Status: Shipment information received, Picked up, In transit, Out for delivery, Delivered, Exception
Create Return Label
Two ways to create return labels:
Key points
• Automatic: Enable Return label on delivery in configuration, label auto-created when validating delivery order
• Manual: Create return picking from order, select DHL as carrier, validate return picking
• Label file: LabelReturn-DHL-[tracking_number].pdf
• Note: Return label has service code PV (Proof of Value), no automatic pickup, customer brings to DHL location
Cancel Shipment
Limitations and handling:
Key points
• DHL REST API does not support complete shipment cancellation
• When clicking Cancel: Tracking number removed from Odoo, carrier price reset to 0
• How to handle: Contact DHL directly via hotline/portal, provide tracking number, request cancel pickup/void shipment
• After DHL confirms, remove tracking number in Odoo
Practical Tips
Key points
• Preparation: Check accurate weight, update package type dimensions, complete address, contact phone
• Cost optimization: Choose correct DHL product (Express 12:00 cheaper than Express 9:00), pack compactly, appropriate package type, insurance only for high-value goods
• International goods: Enable Dutiable Material, fill complete HS Code, choose appropriate Incoterm, check customs documents
• Label management: Save template suitable for printer, test print before actual shipping, backup PDF files, thermal printer for high volume
Common Error Handling
Errors and Solutions
| Error | Cause | Solution |
|---|---|---|
| DHL API key is missing | API not configured | Fill complete API Key, API Secret, Account Number |
| Address missing or wrong | Missing address info | Check Street, City, ZIP, Country, Phone |
| Weight is missing | Product has no weight | Update Weight in Product → General Information |
| Total weight is 0.0 | Total weight = 0 | Check weight of each product or enter in package |
| Insurance not available | Insurance not supported | Disable shipping insurance or choose different DHL product |
| Planned date must be future | Scheduled Date in past | Change Scheduled Date to future date |
| No price available | DHL does not support route | Try different DHL product or check address |