Skip to main content

DHL Express Shipping

Configures plg_easycommerce_dhl, which talks to the DHL Express MyDHL API (the global DHL Express REST API). This plugin covers DHL Express worldwide (US, Europe, intra-region, domestic). It is not the DHL Parcel Benelux integration; the older Parcel implementation has been replaced.

Prerequisites

  1. A DHL developer account at developer.dhl.com.
  2. A subscription to DHL Express, MyDHL API.
  3. An active DHL Express account number (used as the shipper account for rating and shipment creation).

Getting API Credentials

Step 1: Register

  1. Go to developer.dhl.com and create a developer account.
  2. Verify your email and complete the profile.

Step 2: Subscribe to MyDHL API

  1. Open the DHL Express product family.
  2. Subscribe to MyDHL API.
  3. DHL issues a sandbox API key + secret immediately. Production credentials require approval and tie to a specific DHL Express account.

Step 3: Capture Credentials

CredentialDescription
API KeyUsed as the username portion of HTTP Basic auth.
API SecretUsed as the password portion of HTTP Basic auth.
Account NumberDHL Express shipper account; required for rate requests.

Authentication Model

The plugin uses HTTP Basic authentication on every request. There is no OAuth, no bearer token, no JWT, and nothing to refresh:

Authorization: Basic base64(api_key:api_secret)

If the key or secret is missing for the active mode the service throws a RuntimeException before issuing the request.

Every request also carries:

HeaderValue
AuthorizationBasic {base64}
Content-Typeapplication/json
Acceptapplication/json
Message-ReferencePer-call RFC 4122 v4 UUID. MyDHL requires at least 28 chars; DHL support correlates against this.
Message-Reference-DateGMT timestamp matching the request.
x-version3.2.2 (MyDHL API spec version).
Plugin-NameEasyCommerce-DHL
Plugin-VersionReported plugin version.
Shipping-System-Platform-NameJoomla
Webstore-Platform-NameEasyCommerce

Endpoints

Base URLs (relative paths join with the configured mode's base):

ModeBase URL
Testhttps://express.api.dhl.com/mydhlapi/test
Productionhttps://express.api.dhl.com/mydhlapi
OperationMethodPath
Rate quotePOST/rates
Create shipment / labelPOST/shipments
Track shipmentGET/shipments/{trackingNumber}/tracking
Validate addressGET/address-validate
Cancel pickupDELETE/pickups/{dispatchConfirmationNumber}

Rate requests use the structured POST /rates form (not the GET variant) so multi-package and customs data can travel in a single call.

Shipment creation returns label image references that are pulled from the documents[] collection where typeCode == 'label'.

Tracking Status

The plugin reads the last event's typeCode from the tracking response as the canonical status. The top-level shipment.status field is the API call result ("Success"), not the parcel state. Events are read from events[] and the most recent entry (the array's end) provides the live status code.

Configuration

Configure button

The Configure button on the Shipping settings tab is disabled until the plugin is enabled in System, Manage, Plugins.

Credentials

SettingDescription
Modetest (sandbox) or live (production).
Test API KeySandbox API key. Shown when mode is test.
Test API SecretSandbox API secret. Encrypted at rest.
Live API KeyProduction API key. Shown when mode is live.
Live API SecretProduction API secret. Encrypted at rest.
Account NumberDHL Express shipper account; required.

Shipper

Name, company, address (lines 1 and 2), city, province, postal code, country (defaults to US), email, phone. The country must be a valid ISO 3166-1 alpha-2 code.

Services

DHL Express service codes are single characters. Default enabled service is P (Express Worldwide).

CodeService
PExpress Worldwide, non-document, 1 to 3 business days
DExpress Worldwide Doc, document only, 1 to 3 business days
TExpress 12:00, next business day by 12:00
YExpress 12:00 Doc, document, next business day by 12:00
UExpress Worldwide EU, intra-Europe
KExpress 9:00, next business day by 09:00
LExpress 10:30, next business day by 10:30
QMedical Express, temperature-controlled
NDomestic Express, same-country next business day
1Domestic Express 12:00, same-country next business day by 12:00
GDomestic Economy Select, same-country economy

Only enabled services are surfaced at checkout.

Options

SettingValuesDefault
Unit of Measurementmetric (kg, cm), imperial (lb, in)metric
Package Type3BX, 2BC, 2BP, EE, OD, YP3BX
Default Length / Width / HeightFallbacks when product dimensions are missing20 / 15 / 10
Pickup RequestedAsk DHL to schedule a pickupNo
IncotermDAP, DDP, EXW, FCADAP
Enable InsuranceYes / NoNo
Insurance ThresholdMinimum order value to insure; shown only if insurance enabled100
Enable SignatureRequire signature on deliveryNo
Get All Value-Added ServicesReturn the full VAS catalogue with each rateNo

Advanced

SettingDescriptionDefault
API TimeoutcURL response timeout, clamped to 5 to 60 seconds. Connect timeout is fixed at 5s.15
Enable LoggingLog API events at info levelYes
Debug ModeLog full request/response bodies and the Message-ReferenceNo

International Shipping

DHL Express is built for cross-border movement:

  • Customs documentation flows through the /shipments payload.
  • The Incoterm field drives who pays duties: DDP charges the merchant, DAP charges the recipient.
  • declaredValue (carried as a chargeable item on the rate request) sets the customs value used for duties and insurance.

Testing

  1. Set Mode to test. The plugin hits https://express.api.dhl.com/mydhlapi/test.
  2. Enter sandbox API key and secret (issued immediately on subscription).
  3. Run a quote between two countries DHL Express serves (DE to US is a reliable sandbox pair).
  4. If rates do not return, enable Debug Mode and check the log for the detail / title / additionalDetails fields DHL returns; they contain the precise validation error.

Going Live

  1. Switch Mode to live. Base URL becomes https://express.api.dhl.com/mydhlapi.
  2. Enter production API key and secret (these are different from sandbox and only issued after DHL approves your subscription).
  3. Confirm the Account Number matches the live account DHL approved.
  4. Place a real low-value test shipment, verify the label PDF, and confirm tracking events flow back.

Troubleshooting

SymptomLikely Cause
DHL Express credentials are not configured for the selected modeThe key or secret field for the active mode is empty.
401 UnauthorizedWrong key/secret pair, or sandbox credentials used in live mode. There is no token to clear; fix the credentials.
403 ForbiddenThe account is not authorized for the requested service (e.g., asking for U from a non-EU origin).
Empty rates with HTTP 200All requested services are ineligible for the lane. Check additionalDetails in the response.
Missing customs fields errorDHL requires harmonized codes and declared values on cross-border shipments. Configure them on the product.
Label generation succeeds but no PDFThe documents[] collection contains entries other than typeCode == 'label'. The plugin filters for label only.

Every error message bubbles up with the HTTP code and the Message-Reference UUID. Share that reference with DHL support to retrieve their server-side log.