Best for:
Managing (Create,List,Get,Update and Delete) webhooks for pickup customer accounts in DHL.
The DHL eCommerce Americas Tracking Webhook Management API allows clients to register webhook endpoints for specific pickup customer accounts and/or tracking ids, and receive real-time shipping events sent to their configured callback endpoints.
Scope
The following operations are allowed in the Tracking Webhook Management API:
Operation | Type | Path |
---|---|---|
Create Webhook | POST | /account/v4/webhooks |
List Webhooks | GET | /account/v4/webhooks |
Get Webhook | GET | /account/v4/webhooks/ |
Update Webhook | PUT | /account/v4/webhooks/ |
Delete Webhook | DELETE | /account/v4/webhooks/ |
Webhook Subscriptions
Tracking Webhook callbacks will contain information about a single package and include the complete track event history of that package, using the same payload format used by the traditional Tracking API responses.
To successfully consume webhook callbacks, the receiving system must use a valid SSL certificate and reply to the event POST request with a HTTP 200 response within 5 seconds. If either of these requirements is not met, the system will retry delivery in 1 hour. If the second delivery fails, the system will retry delivery 6 hours after the second delivery attempt. If the third delivery fails, the system will not try to send the event again.
If event delivery fails 10,000 times consecutively for a specific webhook, that webhook will be automatically deactivated, and the technical contact associated with the corresponding pickup customer account will be notified of the deactivation via email.
There are two types of webhook subscriptions -
- Pickup Account hooks
- Tracking ID hooks
Pickup Account hooks
This creates a hook at the pickup account level, and all packages that are created under that pickup account are eligible for the hooks. Clients may only create one webhook registration per pickup account. This subscription is permanent, and they will continue to generate and deliver hooks for all packages under the pickup account until the subscription is deleted.
Tracking ID hooks
This creates a hook for a specific package (trackingId) only. For trackingId based webhook subscriptions, we highly encourage clients to provide a pickup value also when creating the hook to guarantee that the hook is created for the correct package. We also recommend that clients perform a compare and match of the hook payload against the package metadata such as consignee city, state and country fields before consuming the events in the hook. This will ensure that you are not accidentally applying events from a hook to the incorrect package. This subscription is ephemeral and it will be deleted 7 days after a Delivered event has been sent or 60 days after the hook has been created (whichever comes first).
For both types of webhook subscriptions, before the webhook is created, the webhook URL will be checked for validity by sending a HTTP GET request; the server must reply with a HTTP 200 response in order to indicate that the endpoint is valid and active. For each webhook created, the response will contain a unique hookId
identifying the webhook registration.
Request Description
M - Mandatory O - Optional C - Conditional N - Not Applicable
Node | Data Type | Required | Length | Description | Example Values |
pickup | string | C | 4:10 | DHL eCommerce pickup account number. This is not the same as the Sold To Account number. | 5320037 |
trackingId | string | C | 1:30 | Accepts the following package identifiers - packageId, dhlPackageId, deliveryConfirmationNumber, and trackingId. We recommend using the deliveryConfirmationNumber in combination with the pickup to guarantee uniqueness. | 9261290234835400877745 |
hookType | string | M | The type of webhook. Currently the only valid hookType is TRACK_EVENTS. | TRACK_EVENTS | |
url | string | M | 1:255 | The URL to send events to. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | https://testing.free.beeceptor.com |
username | string | O | 0:50 | HTTP Basic Authentication username to use when connecting to the URL. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | abc123 |
password | string | O | 0:50 | HTTP Basic Authentication password to use when connecting to the URL. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | password |
active | boolean | M | Whether or not the webhook is active. Webhooks may be automatically deactivated if event delivery fails too often. | true |
Response Description
M - Mandatory O - Optional C - Conditional N - Not Applicable
Node | Data Type | Required | Length | Description | Example Values |
hookId | string | M | 36 | Unique webhook identifier. | b14e4557-accb-a829-b829-c21234175467 |
pickup | string | M | 4:10 | DHL eCommerce pickup account number. This is not the same as the Sold To Account number. | 5320037 |
trackingId | string | C | 1:30 | Accepts the following package identifiers - packageId, dhlPackageId, deliveryConfirmationNumber, and trackingId. We recommend using the deliveryConfirmationNumber in combination with the pickup to guarantee uniqueness. | 9261290234835400877745 |
hookType | string | M | The type of webhook. Currently the only valid hookType is TRACK_EVENTS. | TRACK_EVENTS | |
url | string | M | 1:255 | The URL to send events to. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | https://testing.free.beeceptor.com |
username | string | O | 0:50 | HTTP Basic Authentication username to use when connecting to the URL. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | abc123 |
password | string | O | 0:50 | HTTP Basic Authentication password to use when connecting to the URL. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | password |
active | boolean | M | Whether or not the webhook is active. Webhooks may be automatically deactivated if event delivery fails too often. | true |
Body raw (json)
{ "pickup": "5351244", "hookType": "TRACK_EVENTS", "url": "https://webhooktest.free.beeceptor.com", "username": "abc123", "password": "password", "active": true }
This endpoint allows you to retrieve a list of all webhooks owned by the current API credentials.
Response Description
M - Mandatory O - Optional C - Conditional N - Not Applicable
Node | Data Type | Required | Length | Description | Example Values |
---|---|---|---|---|---|
webhooks | array | M | The webhooks owned by the current user. | ||
hookId | string | M | 36 | Unique webhook identifier. | b14e4557-accb-a829-b829-c21234175467 |
pickup | string | M | 4:10 | DHL eCommerce pickup account number. This is not the same as the Sold To Account number. | 5320037 |
hookType | string | M | The type of webhook. Currently the only valid hookType is TRACK_EVENTS. | TRACK_EVENTS | |
url | string | M | 1:255 | The URL to send events to. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | https://testing.free.beeceptor.com/ |
username | string | O | 0:50 | HTTP Basic Authentication username to use when connecting to the URL. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | abc123 |
password | string | O | 0:50 | HTTP Basic Authentication password to use when connecting to the URL. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | password |
active | boolean | M | true, false | Whether or not the webhook is active. Webhooks may be automatically deactivated if event delivery fails too often. | true |
Response Description
M - Mandatory O - Optional C - Conditional N - Not Applicable
Node | Data Type | Required | Length | Description | Example Values |
---|---|---|---|---|---|
hookId | string | M | 36 | Unique webhook identifier. | b14e4557-accb-a829-b829-c21234175467 |
pickup | string | M | 4:10 | DHL eCommerce pickup account number. This is not the same as the Sold To Account number. | 5320037 |
hookType | string | M | The type of webhook. Currently the only valid hookType is TRACK_EVENTS. | TRACK_EVENTS | |
url | string | M | 1:255 | The URL to send events to. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | https://testing.free.beeceptor.com/ |
username | string | O | 0:50 | HTTP Basic Authentication username to use when connecting to the URL. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | abc123 |
password | string | O | 0:50 | HTTP Basic Authentication password to use when connecting to the URL. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | password |
active | boolean | M | true, false | Whether or not the webhook is active. Webhooks may be automatically deactivated if event delivery fails too often. | true |
Request Description
M - Mandatory O - Optional C - Conditional N - Not Applicable
Node | Data Type | Required | Length | Description | Example Values |
---|---|---|---|---|---|
pickup | string | M | 4:10 | DHL eCommerce pickup account number. This is not the same as the Sold To Account number. | 5320037 |
hookType | string | M | The type of webhook. Currently the only valid hookType is TRACK_EVENTS. | TRACK_EVENTS | |
url | string | M | 1:255 | The URL to send events to. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | https://testing.free.beeceptor.com/ |
username | string | O | 0:50 | HTTP Basic Authentication username to use when connecting to the URL. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | abc123 |
password | string | O | 0:50 | HTTP Basic Authentication password to use when connecting to the URL. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | password |
active | boolean | M | true, false | Whether or not the webhook is active. Webhooks may be automatically deactivated if event delivery fails too often. | true |
Body raw (json)
{ "pickup": "5351244",
"hookType": "TRACK_EVENTS",
"url": "https://webhooktest.free.beeceptor.com",
"username": "abc321",
"password": "password",
"active": true
}
Response Description
M - Mandatory O - Optional C - Conditional N - Not Applicable
Node | Data Type | Required | Length | Description | Example Values |
---|---|---|---|---|---|
hookId | string | M | 36 | Unique webhook identifier. | b14e4557-accb-a829-b829-c21234175467 |
pickup | string | M | 4:10 | DHL eCommerce pickup account number. This is not the same as the Sold To Account number. | 5320037 |
hookType | string | M | The type of webhook. Currently the only valid hookType is TRACK_EVENTS. | TRACK_EVENTS | |
url | string | M | 1:255 | The URL to send events to. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | https://testing.free.beeceptor.com/ |
username | string | O | 0:50 | HTTP Basic Authentication username to use when connecting to the URL. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | abc123 |
password | string | O | 0:50 | HTTP Basic Authentication password to use when connecting to the URL. It is recommended (but not required) that the webhook URL be secured using HTTP Basic Authentication. | password |
active | boolean | M | true, false | Whether or not the webhook is active. Webhooks may be automatically deactivated if event delivery fails too often. | true |
Body raw (json)
{
"pickup": "5351244",
"hookType": "TRACK_EVENTS",
"url": "https://webhooktest.free.beeceptor.com",
"username": "abc321",
"password": "password",
"active": true
}
Response Description
A response code of 200 indicates the DELETE request has been completed successfully.