Download the PHP package ecommerce-utilities/dhl-api without Composer

On this page you can find all versions of the php package ecommerce-utilities/dhl-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dhl-api

DHL-API

Use at your own risk - parents are responsible for their children!

Latest Stable Version License

Composer

composer require ecommerce-utilities/dhl-api *

Shipment Tracking Unified Push

The push API uses the API key from the DHL Developer Portal. It does not use the OAuth token for the DHL business customer portal.

The validation message sent to the webhook contains the subscription ID and its hook secret. Use both to activate the subscription:

Batch subscriptions and daily quota

DHL documents 1 to 10 tracking numbers per subscription request in SubscriptionShipmentIds.shipmentIDs of its Unified Push OpenAPI specification v1.2.5 (checked 2026-09-26). The maximum is stated in the property's description, not as a machine-readable maxItems constraint. The library exposes this limit as DHLPushSubscriptionService::MAX_SHIPMENT_IDS_PER_REQUEST.

createShipmentSubscription() still sends exactly one request and returns one subscription response. More than ten IDs, missing required input or invalid IDs now raise DHLRequestValidationException (a DHLApiException) locally, before any API call. For larger lists, iterate the new batch method:

The generator sends requests only while it is iterated, with ten IDs per request except for a smaller final batch. It validates the complete input before the first request, preserves ID order and leading zeros, and makes no requests for an empty list. Errors stop iteration without retrying; already yielded results remain available to the caller. Persist each result inside the loop rather than collecting all results with iterator_to_array(). An interrupted/failed HTTP request may already have created a subscription: reconcile it before retrying and never replay the complete list blindly.

Each batch still requires its own activation call. For N shipments, budget at least 2 * ceil(N / 10) outgoing API calls (creation plus activation). A quota of 500 calls/day therefore allows at most 2,500 new shipments/day with full batches, before additional lookups, deletions or retries. At 8,000 shipments/day, at least 1,600 calls are needed. Incoming webhook messages do not consume this outgoing-call quota. See the DHL access form and activation workflow.

The batch method does not collect numbers across separate calls, enforce the daily quota or activate subscriptions automatically. Consumers such as ShopOffice must aggregate pending shipments, map all batch members to the shared subscription ID, activate each subscription only once, and reserve quota for activation and retries. For durable queues that must reserve a batch before the HTTP request, use array_chunk($trackingNumbers, DHLPushSubscriptionService::MAX_SHIPMENT_IDS_PER_REQUEST) and call createShipmentSubscription() for each reserved batch.

Example:

Shipment labels via REST API

Supported outbound shipment features:

DHLOAuthCredentials now contains the business customer portal login, the developer portal API key/secret, the environment flag, and optionally the receiverId for returns use cases. The current setup flow is:

  1. Create DHLOAuthCredentials
  2. Create DHLHttpClient
  3. Create DHLOAuthTokenProvider
  4. Inject those dependencies into DHLRetoureService or DHLShipmentService

For DHL Returns in sandbox, use the sandbox user plus receiverId = 'deu'. The developer portal appName is not part of the OAuth token request.


All versions of dhl-api with dependencies

PHP Build Version
Package Version
Requires php Version >= 8.1
ext-curl Version *
ext-dom Version *
ext-json Version *
ext-mbstring Version *
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ecommerce-utilities/dhl-api contains the following files

Loading the files please wait ...