DOCS

Connect via API

Connect DHL Carrier Account

Securely connect your DHL carrier account to access negotiated shipping rates and create labels directly through Zonos.

Get started 

The DHL carrier account connection process validates your credentials and ensures your account is properly configured to retrieve rates and generate shipping labels. When you connect your DHL account, Zonos performs a test rating call to verify the connection is working correctly before storing your credentials.

To register with DHL Express or set up through your Zonos Dashboard, follow the steps in this guide.

How DHL carrier account connection works 

Connecting your DHL carrier account:

  • Validates that you've provided the correct credential types for DHL
  • Makes a live rating call to the DHL API to confirm the credentials are valid
  • Stores your connected account in Zonos for future shipment rating and label creation
  • Returns the connected account details, including your DHL account information and rate type

Once connected, your DHL carrier account can be used to get real-time shipping rates based on your negotiated rates (if applicable) and create DHL shipping labels.

Connect your DHL account 

Use the carrierAccountConnect mutation to connect your DHL carrier account with your credentials.

Mutation

Use this mutation to connect your DHL carrier account and validate your credentials.

MUTATION

GraphQL

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
mutation CarrierAccountConnect($input: CarrierAccountConnectInput!) {
  carrierAccountConnect(input: $input) {
    errors
    carrierAccount {
      credentialProvider
      id
      integrationType
      organization
      rateType
      carrier {
        id
        code
        name
      }
      credentials {
        type
        value
      }
    }
  }
}

Variables

The mutation requires the DHL carrier code, rate type, and your DHL account credentials.

VARIABLES

json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
  "input": {
    "carrierCode": "DHL",
    "rateType": "NEGOTIATED",
    "credentials": [
      {
        "type": "API_KEY",
        "value": "actual_api_key_value"
      },
      {
        "type": "API_PASSWORD",
        "value": "actual_api_password_value"
      },
      {
        "type": "ACCOUNT_NUMBER",
        "value": "actual_account_number_value"
      }
    ]
  }
}

DHL requires the following credential types:

  • API_KEY - Your DHL API key
  • API_PASSWORD - Your DHL API password
  • ACCOUNT_NUMBER - Your DHL account number

You can find these credentials in your DHL account portal or by contacting your DHL account representative.

Response examples

Successful connection

When credentials are valid and DHL returns rates successfully:

RESPONSE

json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{
  "data": {
    "carrierAccountConnect": {
      "errors": [],
      "carrierAccount": {
        "credentialProvider": "ORGANIZATION",
        "id": "carrier_account_123",
        "integrationType": "REST",
        "organization": "organization_id",
        "rateType": "NEGOTIATED",
        "carrier": {
          "id": "carrier_123",
          "code": "dhl",
          "name": "DHL"
        },
        "credentials": [
          {
            "type": "API_KEY",
            "value": "actual_api_key_value"
          },
          {
            "type": "API_PASSWORD",
            "value": "actual_api_password_value"
          },
          {
            "type": "ACCOUNT_NUMBER",
            "value": "actual_account_number_value"
          }
        ]
      }
    }
  }
}

Error: Unsupported credential type

If you provide a credential type that DHL doesn't support:

ERROR

json

1
2
3
4
5
6
7
8
{
  "data": {
    "carrierAccountConnect": {
      "errors": ["Credential type SITE_ID is not supported by carrier DHL"],
      "carrierAccount": null
    }
  }
}

Error: Invalid credentials

If the credentials are valid types but don't authenticate successfully with DHL:

ERROR

json

1
2
3
4
5
6
7
8
{
  "data": {
    "carrierAccountConnect": {
      "errors": ["Failed to get rating from DHL API"],
      "carrierAccount": null
    }
  }
}

What happens after connection

Once your DHL carrier account is successfully connected:

  • The account is stored in your organization and linked to your credentials
  • You can retrieve DHL shipping rates using your negotiated rates (when applicable)
  • You can create DHL shipping labels through the Zonos API
  • The carrier account can be used across multiple shipments without reconnecting

Next steps 

After connecting your DHL carrier account:

Was this page helpful?