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.
Go to the DHL Developer Portal and log into your account or create a new one.
Navigate to the Shipment Booking API section for Global Forwarding. Click Get access.
Fill out the online form to complete the required customer verification process.
Submit the form to automatically create a new app under your My Apps section.
Wait for the DHL Customer IT Solutions (CIS) team to review your details and contact you if they have any questions.
Look for an email notification confirming whether your application has been approved or rejected.
Once approved, use your assigned credentials to access the API.
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
Log into the DHL Developer Portal.
Click on your profile icon and select My Apps.
Click on the name of the approved application you created.
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.
Contact your DGF account manager to get your account number.
Confirm the account number covers the lane and service you plan to book.
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.
Authenticate with your
API keyandAPI Secret.Include your
Account numberin the shipment request.Set
service_typeto a supported value from the table below.Send the request to the AfterShip Shipping API and check the response for the shipment confirmation.
Supported DHL Global Forwarding services
|
| Mode |
|
|
| DHL Global Forwarding Door to Door 2 days | Road Freight |
|
|
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 | Use a |
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
Supported DHL Global Forwarding service types: See Supported DHL Global Forwarding services above.
AfterShip Shipping DHL Global Forwarding technical support:
[email protected]


