Skip to main content

Connect DHL Global Forwarding to AfterShip Shipping

Get your DHL Global Forwarding API credentials and account number, then create road freight shipments through the AfterShip Shipping API.

Written by Harneet Kaur

Plan: Pro, Enterprise | Platform: AfterShip Shipping API

Overview

Learn how to connect DHL Global Forwarding (DGF) to AfterShip Shipping and book freight shipments through the API. This guide walks you through getting your DGF API credentials, getting your DGF account number, and creating your first Shipment. Once connected, you can book supported DGF road freight shipments alongside your other carriers.

Before you begin

Requirements

  • An active DHL Global Forwarding contract

  • An account on the DHL API Developer Portal

  • A DGF account number issued under your contract

  • DGF API credentials for the environment you connect to (sandbox or production)

  • Access to the AfterShip Shipping API

Limitations

  • You create DGF shipments through the AfterShip Shipping API only. DGF shipments can't be created in the AfterShip Shipping web app.

  • DGF is a freight forwarding shipping API. It confirms your shipment and doesn't return a label file, so you print and apply your own labels.

  • Only forward shipments are supported. Return shipments aren't supported for this carrier.

  • Only the service types listed in Step 3 are available today.

Connection steps

Step 1: Get your DGF API credentials

Your DHL app supplies the credentials that authenticate every shipment request.

  1. Go to the DHL Developer Portal and log into your account or create a new one.

  2. Navigate to the Shipment Booking API section for Global Forwarding. Click Get access.

  3. Fill out the online form to complete the required customer verification process.


  4. Submit the form to automatically create a new app under your My Apps section.

  5. Wait for the DHL Customer IT Solutions (CIS) team to review your details and contact you if they have any questions.

  6. Look for an email notification confirming whether your application has been approved or rejected.

  7. Once approved, use your assigned credentials to access the API.

  8. Copy the API Key and API Secret.

Important: The developer portal issues separate credentials for the sandbox (testing) and production environments. Use the credentials that match the environment you're connecting.

How to View Your Credentials After Approval

  1. Log into the DHL Developer Portal.

  2. Click on your profile icon and select My Apps.

  3. Click on the name of the approved application you created.

  4. Under the Credentials section, click the Show link beneath the asterisks to reveal your keys.

Step 2: Get your DGF account number

DGF assigns your account number under your contract, and every shipment request requires it.

  1. Contact your DGF account manager to get your account number.

  2. Confirm the account number covers the lane and service you plan to book.

  3. Store the account number with your API credentials.

You now have all three values a shipment needs: API Key and API Secret, and account number.

Step 3: Book a shipment through the AfterShip Shipping API

Send your credentials and a supported service type in the shipment request. AfterShip Shipping returns the DGF shipment confirmation in the API response.

  1. Authenticate with your API key and API Secret.

  2. Include your Account number in the shipment request.

  3. Set service_type to a supported value from the table below.

  4. Send the request to the AfterShip Shipping API and check the response for the shipment confirmation.

Supported DHL Global Forwarding services

service_type

service_name

Mode

ship_from.country

ship_to.country

dhl-global-forwarding_dd2

DHL Global Forwarding Door to Door 2 days

Road Freight

SGP

SGP

DHL Global Forwarding offers many contract-based services and transport modes. Only the service in the table is available through AfterShip Shipping today. If your DGF contract covers a different service, contact your AfterShip point of contact (POC) to request it.

What your users will experience

After completing these steps:

  • You authenticate with DGF through the AfterShip Shipping API.

  • You create DGF road freight bookings programmatically, alongside your other carriers.

  • You receive a DGF shipment confirmation in the API response.

  • You print your own labels and hand the shipment to DGF.

Troubleshooting

Problem

Cause

Solution

Shipment requests fail with an authentication error

The credentials don't match the environment you're calling

Use the sandbox credentials for testing and the production credentials for live shipments

Shipment requests fail with a missing account error

The account number isn't included in the request

Add your DGF account number to every shipment request

Shipment requests fail with an unsupported service error

The service_type isn't available through AfterShip Shipping

Use a service_type from the Supported DHL Global Forwarding services table

No label file is returned after a successful shipment

DGF confirms shipment and doesn't generate labels

Print and apply your own labels

FAQ

1. Can I book DHL Global Forwarding shipments in the AfterShip Shipping web app?

No. DGF shipments are created through the AfterShip Shipping API only.

2. Does DHL Global Forwarding return a shipping label?

No. DGF confirms your shipment and doesn't return a label file. You print and apply your own labels.

3. Can I create return shipments with DHL Global Forwarding?

No. Only forward shipments are supported for this carrier.

4. Can I use my sandbox credentials for live shipments?

No. The DHL API Developer Portal issues separate credentials for sandbox and production. Use the set that matches the environment you're calling.

5. Where do I get my DGF account number?

Your account number is assigned under your DHL Global Forwarding contract. Contact your DGF account manager to get it.

6. Can I add another DHL Global Forwarding service or transport mode?

Yes. Contact your AfterShip point of contact (POC) with the service and lane your DGF contract covers.

DHL Global Forwarding Developer Resources

Did this answer your question?