DHL Parcel Poland Integration
The DHL module integrates WooCommerce with the DHL Parcel Poland REST API. Generate labels, track shipments and offer ServicePoint locations at checkout.
Configuration
Section titled “Configuration”Go to WooCommerce > Settings > Polski PRO > Shipping.
API authentication
Section titled “API authentication”| Setting | Description |
|---|---|
| DHL API key | Bearer token from the DHL Developer Portal |
| DHL account number | DHL Parcel Poland customer account number |
You can obtain the API key by registering at developer.dhl.com and creating an application with access to the DHL Parcel Poland API.
Enabling the module
Section titled “Enabling the module”- Go to Polski PRO > Modules
- Enable the DHL Parcel Poland module
- Fill in the API key and account number in the shipping settings
Generating labels
Section titled “Generating labels”You generate labels from the order editor:
- Open an order in WooCommerce > Orders
- In the Shipment Tracking section, select the DHL carrier
- Click Generate label
- The system creates a shipment through the DHL REST API and returns a tracking number plus a link to the PDF label
Service types
Section titled “Service types”| Type | Description |
|---|---|
| AH | Standard delivery to an address (default) |
| AP | Delivery to a DHL ServicePoint / parcel locker |
For AP (ServicePoint) services, you must provide the pickup point ID.
Shipment data
Section titled “Shipment data”The module automatically retrieves the recipient details and product weight from the order. Default parcel dimensions: 40x30x20 cm.
DHL ServicePoint
Section titled “DHL ServicePoint”The module lets you search for ServicePoint locations (DHL POPs and parcel lockers):
- Search by city
- Search by GPS coordinates (5 km radius)
- Returned data: name, address, type (POP/parcel locker), coordinates
Shipment tracking
Section titled “Shipment tracking”After a label is generated, the tracking number is saved automatically. The DHL tracking link is generated in the following format:
https://www.dhl.com/pl-pl/home/sledzenie-przesylek.html?tracking-id={number}The customer receives an email with the tracking number when the status changes to Shipped.
Error codes
Section titled “Error codes”| Code | Description | Solution |
|---|---|---|
| HTTP 401 | Invalid API key | Check the Bearer token in the settings |
| HTTP 400 | Invalid shipment data | Check the address, postal code and account number |
| HTTP 429 | API request limit | Wait a moment and try again |
Filters and actions
Section titled “Filters and actions”// Filter shipment data before sending it to DHLadd_filter('polski_pro/shipping/dhl/parcel_data', function (array $data, WC_Order $order): array { $data['service_type'] = 'AP'; // Force delivery to a ServicePoint $data['servicepoint_id'] = 'PL-12345'; return $data;}, 10, 2);