korbeil/dhl-express-php-api

An up to date PHP client for DHL Express API

Installs: 80 395

Dependents: 0

Suggesters: 0

Security: 0

Stars: 6

Watchers: 1

Forks: 1

Open Issues: 1

pkg:composer/korbeil/dhl-express-php-api

v1.0.6 2023-07-24 10:08 UTC

This package is auto-updated.

Last update: 2025-09-24 14:58:21 UTC


README

I found close to nothing related to DHL Express API and needed it for a customer. So here I decided to make it open-source so everybody could use it freely.

This SDK is generated automatically with JanePHP from the official DHL Express specs.

It also provides a full object oriented interface for all the endpoints, requests and responses of the DHL Express REST API.

Installation

This library is made with symfony/http-client as our HTTP transport. So by installing it, you'll have close to nothing in order to make it work:

composer require korbeil/dhl-express-php-api

Quick start

// $client contains all the methods to interact with the API
$clientFactory = new Korbeil\DHLExpress\ClientFactory($dhlExpressUrl, $dhlExpressUsername, $dhlExpressPassword);
$client = $clientFactory->getClient();

$pickupRequest = new Korbeil\DHLExpress\Api\Model\SupermodelIoLogisticsExpressPickupRequest();
// ... fill your request contents

$response = $client->expApiPickups($pickupRequest);
$trackingNumbers = $response->getDispatchConfirmationNumbers();

Tests

If you want to use the DHL Express API in your tests, you can get a client dedicated for this purpose by doing as following:

$testClient = $clientFactory->getMockClient();

License

This library is licensed under the MIT License - see the LICENSE file for details.