Skip to main content
HomeBlogGuidesHow to Get a DHL API Key for Unified Shipment Tracking

How to Get a DHL API Key for Unified Shipment Tracking

17TRACK

To get a DHL API key for shipment tracking, create an account on the DHL Developer Portal, find the tracking API for the DHL service that carries your shipments, and follow that API’s access instructions. Then test the credentials against its documented tracking request. A DHL key gives you access to a specific DHL API; it does not, by itself, create a unified tracking feed for other carriers.

How to Get a DHL API Key for Unified Shipment

If your application tracks both DHL and non-DHL shipments, make the architecture decision before you build: integrate the relevant carrier APIs individually, or use a multi-carrier tracking API to handle supported carriers through one integration. The right credential, request format, and approval process depend on the API you choose.

First, identify which DHL tracking API you need

“DHL” is not a sufficiently precise API requirement. DHL offers multiple shipping services, and a shipment’s tracking number does not tell a developer which API product, account permissions, or event fields will be available. Start with the DHL service used to ship the parcels you need to track, then check the corresponding product listing and documentation in the DHL Developer Portal.

Before requesting access, collect a small set of real-world requirements:

  • Shipment origin: Which DHL service generated the labels and tracking numbers? Are shipments created under your own shipping account, a merchant’s account, or another party’s account?
  • Tracking scope: Do you need to look up individual shipments, monitor an ongoing batch of shipments, or both?
  • Data needs: Is the latest status sufficient, or do you need event history, timestamps, locations, delivery details, or proof-of-delivery information where available?
  • Coverage: Will the same system also ingest shipments from other carriers?
  • Operating model: Will you query tracking on demand, run scheduled updates, or use event notifications if the selected API offers them?

These questions prevent a common mistake: obtaining credentials for an API without confirming that its shipment scope and response data match the application. A tracking number is an input to a tracking request, not an API key. A shipping account number, portal login, and API credential may also serve different purposes. Follow the authentication instructions for the specific API product rather than treating those identifiers as interchangeable.

How to request and test DHL API access

  1. Register or sign in to the DHL Developer Portal. Use an account that your organization can maintain. Keep access under appropriate team ownership so a staff change does not leave a production integration dependent on one person’s login.
  2. Locate the relevant tracking product. Read its overview, supported use cases, authentication instructions, and access requirements. Confirm that it applies to the DHL service behind your tracking numbers; do not select an API solely because its name includes “tracking.”
  3. Follow that product’s access process. The portal and API documentation are the authority on whether you must create an application, request access, associate an account, or complete another step before receiving usable credentials. Do not assume that registering for the portal automatically grants production access.
  4. Store the issued credential securely. Keep keys or secrets in server-side configuration or a secrets manager. Never put them in a public repository, browser-side script, or a customer-facing tracking URL.
  5. Make a documented test request. Use the API’s current documentation for its endpoint, authentication header, request parameters, and environment. Test with a tracking number known to belong to the service you selected. Avoid copying an endpoint or header from instructions written for a different DHL API.
  6. Check the response, not just the HTTP result. Confirm that the returned shipment matches the expected parcel and that its event timestamps, status descriptions, and identifiers are useful for your application. A successful request is not proof that every shipment you plan to track is covered.

If an access request is pending or a test fails, return to the selected product’s documentation before changing code. Check whether the credential is valid for the environment being called, whether the application has the required access, whether the tracking number belongs to the expected DHL service, and whether the request uses the documented authentication format. For account-specific access questions, use the support route identified by DHL for that API.

Turn a DHL integration into a unified tracking workflow

A DHL API integration can be the right solution when the shipment population is limited to a supported DHL service and your team wants to work directly with that service’s data. The integration becomes more involved when an order management system, support desk, or customer tracking page must also display shipments from other carriers. In that case, the application needs a shared model for shipments and events, regardless of how tracking data is obtained.

One approach is to integrate each relevant carrier API directly. That gives your team control over each carrier-specific request and the way its responses are interpreted. It also makes your team responsible for managing separate credentials, carrier selection, request rules, error handling, and event mapping. If you choose this route, determine which system records the actual carrier and service when a label is created. Guessing the carrier from a tracking-number pattern alone can lead to incorrect lookups.

The other approach is to evaluate a multi-carrier tracking API. 17TRACK’s Tracking API is a relevant option for teams building shipment visibility across carriers; its API documentation is the place to check the current integration flow and supported operations. This is a different credential path from obtaining a DHL API key: signing up for a third-party tracking API does not issue a DHL developer credential. Before selecting it, verify that it supports the DHL services and other carriers in your actual shipment mix, and compare its returned events with what your workflow requires.

Neither architecture eliminates the need to design your own shipment record. At minimum, retain the order or shipment reference, tracking number, identified carrier or service when known, last successful update, latest status, and the underlying events you need for support or customer communications. Keep raw carrier descriptions where useful, even if you also map events into a smaller set of internal statuses. This helps staff investigate cases in which a broad label such as “in transit” hides a more specific event.

What to verify before going live

Run a short pilot using shipments that reflect your real traffic rather than a single successful test number. Include an active parcel, a delivered parcel, a recently created label with no visible movement, and shipments from each DHL service you expect to use. If the system is meant to be multi-carrier, include representative non-DHL shipments as well. Record what each request returns and how your application displays it.

  • Carrier and service fit: Can the chosen API retrieve the specific shipments you ship, including those generated by merchants or partners where relevant? Do not infer coverage from a generic carrier name.
  • Event quality: Are timestamps, locations, status descriptions, and delivery events present in a form your users can understand? Treat optional fields as optional in your code.
  • Status mapping: Does your internal status accurately reflect the underlying event? Avoid treating a label-created event as evidence that the carrier has physically received the parcel.
  • Refresh behavior: How will the system obtain later updates, and what does the selected API’s documentation say about permitted request patterns or available notifications? Design to those published rules rather than assuming an update is available immediately after every scan.
  • Failure handling: Distinguish an authentication error from an unknown number, a shipment that has not yet produced a tracking event, and a temporary service failure. Each requires a different operational response.
  • Credential management: Who can access the credential, how will it be changed when necessary, and how will the team detect failed requests after a change?

For a customer-facing tracking page, also check the wording shown when no new event appears. “No update available” is more accurate than “lost” when the API has returned no evidence of a loss. For an internal support tool, keep the original event text accessible so an agent can distinguish an actual delivery exception from a general delay.

Choose the credential path that matches the job

If the requirement is to retrieve tracking events directly from a particular DHL service, begin with that service’s product in the DHL Developer Portal and obtain access through its documented process. If the requirement is a single shipment view spanning DHL and other carriers, evaluate the integration as a multi-carrier problem first. A direct DHL key may still have a role, but it will not supply events from carriers outside its scope.

For businesses already using a multi-carrier tracking API, check whether a separate DHL developer key is needed for their chosen implementation before requesting one. For businesses building their own carrier connections, establish a source of truth for carrier identification and test each integration independently. In either case, a successful pilot with your own shipment samples is more informative than a generic promise of “unified tracking.”

FAQ

Can I use a DHL tracking number instead of an API key?

No. A tracking number identifies a shipment for lookup. An API key or other documented credential authenticates an application making the request. You generally need both a valid request input and the access method specified by the selected API.

Does one DHL API key work for every DHL shipment?

Do not assume so. Confirm which DHL service and API product your credential is authorized to use, then test tracking numbers from each service in your shipment mix. Access and coverage should be determined from the selected product’s current documentation and your own test results.

Is a DHL API key required to use 17TRACK’s Tracking API?

A DHL developer key and credentials for 17TRACK’s Tracking API are different things. Check 17TRACK’s documentation for its current setup requirements, and verify your intended carrier and service coverage before committing to an integration. Do not assume that receiving credentials from one provider grants access to the other’s developer portal.

Why does my API request return no shipment?

First check the carrier and service associated with the number, the request format, and the selected environment. Also check whether the shipment has generated a trackable event yet. If the API reports an authorization problem, verify your credential and access for that specific product; if it reports no matching shipment, do not treat that alone as proof that the parcel does not exist.

Should I poll for updates or use webhooks?

Use the update methods documented for the API you actually select. If event notifications are available and fit your workflow, evaluate them alongside any permitted polling approach. Either way, design for delayed events, duplicate updates, and periods with no new tracking information rather than assuming every request produces a new status.

Sources