Fulfill orders with DHL eCommerce
The DHL eCommerce Fulfillment Integration allows you to connect your Medusa store with DHL eCommerce shipping and fulfillment services. This integration enables you to manage shipments, track packages, and streamline your order fulfillment process.
With this plugin, you can integrate your Medusa store with DHL eCommerce to:
This simplifies the process of fulfilling and tracking orders using DHL services.
This module/plugin is compatible with versions >= 2.4.0 of .
To get started with the DHL eCommerce Fulfillment Integration:
To install the DHL eCommerce Fulfillment Integration, follow these steps:
npm install medusa-dhl-ecommerce-fulfillment
modules: [{resolve: '@medusajs/medusa/fulfillment',options: {providers: [{resolve: 'medusa-dhl-ecommerce-fulfillment/providers/dhl',id: 'dhl',options: {isEnabled: true, // Enable or disable integrationuserId: "<your-user-id>", // DHL User IDapiKey: "<your-api-key>", // DHL API KeyaccountId: "<your-account-id>", // DHL Account IDenableLogs: false, // Enable debug logging (optional)itemDimensionsUnit: "mm", // Unit for product dimensions: "mm" or "cm" (optional, default: "mm")itemWeightUnit: "g", // Unit for product weight: "g" or "kg" (optional, default: "g")webhookApiKey: "<your-webhook-api-key>", // DHL Track & Trace Pusher API key (optional)webhookApiKeyHeader: "Authorization", // Header name for webhook auth (optional, default: "Authorization")},},],},},],plugins: [{resolve: 'medusa-dhl-ecommerce-fulfillment', // This is used to enable custom admin widgets to see the tracking URLs and labelsoptions: {},},]
⚠️ Alternative:
Alternatively, you can set up your DHL API credentials directly in the Medusa Admin dashboard instead of the file.
Go to the Settings page in your Medusa Admin, and you will see DHL listed in the menu.
From there, you can enter your User ID, API Key, and Account ID securely via the UI.
How credentials are used:
The module will first check for credentials stored in the database (set via the Admin UI). If these exist, they will be used for all DHL API requests.
If no credentials are found in the database, the module will fall back to the credentials provided in your file.
After installing the integration, you need to configure the DHL shipping options in your Medusa Admin dashboard.
Decide which DHL shipping option and carrier you want to offer to your customers.
Tip: You can create multiple shipping options for different DHL services to give your customers more choices at checkout.
| Option | Type | Default | Description |
|---|---|---|---|
| Enable or disable the DHL integration | |||
| - | Your DHL User ID for API authentication | ||
| - | Your DHL API Key for authentication | ||
| - | Your DHL Account ID | ||
| Enable debug logging for DHL API requests | |||
| | | Unit of measurement for product dimensions in Medusa. DHL expects centimeters, so values are converted automatically. | ||
| | | Unit of measurement for product weight in Medusa. DHL expects grams, so values are converted automatically. | ||
| - | API key for authenticating incoming DHL Track & Trace Pusher webhooks | ||
| HTTP header name that DHL uses to send the webhook API key |
This integration supports receiving real-time shipment status updates from DHL via webhooks. When configured, DHL will push tracking events to your Medusa instance, automatically updating fulfillment statuses.
Configure the webhook API key either via or in the Medusa Admin (Settings → DHL).
Register your webhook endpoint with DHL. The endpoint URL is:
Provide the webhook API key to DHL when setting up the Track & Trace Pusher subscription.
Note: If no matching fulfillment is found for a tracking number, the webhook returns 404, signaling to DHL that the parcel is unknown.
When you create a shipment for an order in Medusa, the integration will automatically generate a DHL shipping label and tracking number.
We welcome contributions to the DHL eCommerce Fulfillment Integration! If you have suggestions, improvements, or bug fixes, please follow these steps:
Fork the Repository
Create a personal copy of the repository by forking it on GitHub.
Create a New Branch
Create a new branch for your changes:
git checkout -b my-feature-branch
Make Your Changes
Implement your changes in the codebase.
Test Your Changes
Ensure that your changes work as expected and do not break existing functionality.
Submit a Pull Request
Push your changes to your forked repository and submit a pull request to the main repository.
This project was a fork of igorppbr/medusa-fedex-fulfillment. If you need Fedex integration in Medusa, please check their original repo out.