Skip to content

DHL Express - Get Rates

This module queries the available shipping rates in DHL Express for a specific route and package. It receives the origin and destination coordinates (country, city, postal code) along with the weight and optionally the package dimensions. It makes a GET request to the /rates endpoint of DHL Express and processes the response to extract the product name, code, price, currency, estimated delivery date, and transit days. It also automatically identifies the cheapest rate among the available options.

ParameterTypeRequiredDescription
credentials_idcredentialsYesDHL Express credential (provider: dhl_express)
origin_countrytextYesOrigin country ISO code (default: ES)
origin_citytextYesOrigin city
origin_postaltextYesOrigin postal code
dest_countrytextYesDestination country ISO code
dest_citytextYesDestination city
dest_postaltextYesDestination postal code
weighttextYesPackage weight in kilograms
lengthtextNoPackage length in centimeters
widthtextNoPackage width in centimeters
heighttextNoPackage height in centimeters

A dhl_express type credential is required with the following fields:

  • api_key: DHL Express API Key
  • account_number: DHL Express account number

Credentials are obtained from the DHL developer portal (https://developer.dhl.com/).

{
"success": true,
"rates": [
{
"product_name": "EXPRESS WORLDWIDE",
"product_code": "P",
"local_product_code": "P",
"price": "45.50",
"currency": "EUR",
"delivery_date": "2026-03-25T23:59:00",
"transit_days": 2
}
],
"rates_count": 3,
"cheapest": {
"product_name": "EXPRESS WORLDWIDE",
"product_code": "P",
"price": "45.50",
"currency": "EUR"
},
"message": "3 tarifas DHL Express obtenidas"
}
{
"credentials_id": "mi_credencial_dhl",
"origin_country": "ES",
"origin_city": "Madrid",
"origin_postal": "28001",
"dest_country": "DE",
"dest_city": "Berlin",
"dest_postal": "10115",
"weight": "2.5"
}
  • Customs declaration is automatically determined by comparing the origin and destination countries
  • Dimensions are optional; if any dimension is provided, all are included with metric units
  • The cheapest field returns the cheapest rate by comparing prices numerically
  • Weight units are always metric (kg)