PHPackages                             dhl/sdk-api-parcel-de - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. dhl/sdk-api-parcel-de

ActiveLibrary[API Development](/categories/api)

dhl/sdk-api-parcel-de
=====================

DHL Parcel DE Shipping API SDK

1.3.0(10mo ago)265.0k—8.9%11MITPHPPHP ^8.1.0

Since May 24Pushed 10mo ago5 watchersCompare

[ Source](https://github.com/netresearch/dhl-sdk-api-parcel-de)[ Packagist](https://packagist.org/packages/dhl/sdk-api-parcel-de)[ RSS](/packages/dhl-sdk-api-parcel-de/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (19)Versions (5)Used By (1)

DHL Parcel DE Shipping API SDK
==============================

[](#dhl-parcel-de-shipping-api-sdk)

The DHL Parcel DE Shipping API SDK package offers an interface to the following web services:

- [DHL Parcel DE Shipping 2.1.7](https://developer.dhl.com/api-reference/parcel-de-shipping-post-parcel-germany-v2)

Requirements
------------

[](#requirements)

### System Requirements

[](#system-requirements)

- PHP 8.1+ with SOAP and JSON extension

### Package Requirements

[](#package-requirements)

- `league/openapi-psr7-validator`: Schema validator for JSON request messages
- `netresearch/jsonmapper`: Mapper for deserialization of JSON response messages into PHP objects
- `php-http/discovery`: Discovery service for HTTP client and message factory implementations
- `php-http/httplug`: Pluggable HTTP client abstraction
- `php-http/logger-plugin`: HTTP client logger plugin for HTTPlug
- `psr/http-client`: PSR-18 HTTP client interfaces
- `psr/http-factory`: PSR-7 HTTP message factory interfaces
- `psr/http-message`: PSR-7 HTTP message interfaces
- `psr/log`: PSR-3 logger interfaces

### Virtual Package Requirements

[](#virtual-package-requirements)

- `psr/http-client-implementation`: Any package that provides a PSR-18 compatible HTTP client
- `psr/http-factory-implementation`: Any package that provides PSR-7 compatible HTTP message factories
- `psr/http-message-implementation`: Any package that provides PSR-7 HTTP messages

### Development Package Requirements

[](#development-package-requirements)

- `fig/log-test`: PSR-3 logger implementation for testing purposes
- `nyholm/psr7`: PSR-7 HTTP message factory &amp; message implementation
- `phpunit/phpunit`: Testing framework
- `php-http/mock-client`: HTTPlug mock client implementation
- `phpstan/phpstan`: Static analysis tool
- `rector/rector`: Automatic refactoring tool to help with PHP upgrades
- `squizlabs/php_codesniffer`: Static analysis tool

Installation
------------

[](#installation)

```
$ composer require dhl/sdk-api-parcel-de
```

Uninstallation
--------------

[](#uninstallation)

```
$ composer remove dhl/sdk-api-parcel-de
```

Testing
-------

[](#testing)

```
$ ./vendor/bin/phpunit -c test/phpunit.xml
```

Features
--------

[](#features)

The DHL Parcel DE Shipping API SDK supports the following features:

- Validate Shipment
- Create Shipment Order
- Delete Shipment Order

### Authentication

[](#authentication)

The DHL Parcel DE Shipping API requires a two-level authentication (see [API User Guide](https://developer.dhl.com/api-reference/parcel-de-shipping-post-parcel-germany-v2#get-started-section/user-guide)):

1. The **application** submits a *Consumer Key Header* ("API Key") that must be created in the [DHL API Developer Portal](https://developer.dhl.com/user/apps).
2. The **user** is identified via *HTTP Basic Authentication* with credentials configured in the [DHL Business Customer Portal](https://geschaeftskunden.dhl.de/).

These credentials are passed to the SDK via `\Dhl\Sdk\ParcelDe\Shipping\Api\Data\AuthenticationStorageInterface`. Create your own or use the default implementation:

```
$authStorage = new \Dhl\Sdk\ParcelDe\Shipping\Auth\AuthenticationStorage('apiKey', 'user', 'password');
```

### Validate Shipment

[](#validate-shipment)

Validate shipments for DHL Paket including the relevant shipping documents.

#### Public API

[](#public-api)

The library's components suitable for consumption comprise

- services:
    - service factory
    - shipment service
    - data transfer object builder
- data transfer objects:
    - [authentication storage](#Authentication)
    - order/label settings
    - validation result with status message

#### Usage

[](#usage)

```
$logger = new \Psr\Log\NullLogger();

$serviceFactory = new \Dhl\Sdk\ParcelDe\Shipping\Service\ServiceFactory();
$service = $serviceFactory->createShipmentService($authStorage, $logger, $sandbox = true);

$requestBuilder = new \Dhl\Sdk\ParcelDe\Shipping\RequestBuilder\ShipmentOrderRequestBuilder();
$requestBuilder->setShipperAccount($billingNumber = '33333333330101');
$requestBuilder->setShipperAddress(
    company: 'DHL',
    country: 'DEU',
    postalCode: '53113',
    city: 'Bonn',
    street: 'Charles-de-Gaulle-Straße',
    streetNumber: '20'
);
$requestBuilder->setRecipientAddress(
    recipientName: 'Jane Doe',
    recipientCountry: 'DEU',
    recipientPostalCode: '53113',
    recipientCity: 'Bonn',
    recipientStreet: 'Sträßchensweg',
    recipientStreetNumber: '2'
);
$requestBuilder->setShipmentDetails(productCode: 'V01PAK', shipmentDate: new \DateTimeImmutable('2023-02-23'));
$requestBuilder->setPackageDetails(weightInKg: 2.4);

$shipmentOrder = $requestBuilder->create();
$result = $service->validateShipments([$shipmentOrder]);
```

### Create Shipment Order

[](#create-shipment-order)

Create shipments for DHL Paket including the relevant shipping documents. In addition to the primary shipment data (shipper, consignee, etc.), further settings can be defined per request via the *order configuration* object, including label printing size, profile, and more.

#### Public API

[](#public-api-1)

The library's components suitable for consumption comprise

- services:
    - service factory
    - shipment service
    - data transfer object builder
- data transfer objects:
    - [authentication storage](#Authentication)
    - order/label settings
    - shipment with shipment/tracking number and label(s)

#### Usage

[](#usage-1)

```
$logger = new \Psr\Log\NullLogger();

$serviceFactory = new \Dhl\Sdk\ParcelDe\Shipping\Service\ServiceFactory();
$service = $serviceFactory->createShipmentService($authStorage, $logger, sandbox: true);

$orderConfiguration = new \Dhl\Sdk\ParcelDe\Shipping\Service\ShipmentService\OrderConfiguration(
    mustEncode: true,
    combinedPrinting: null,
    docFormat: \Dhl\Sdk\ParcelDe\Shipping\Api\Data\OrderConfigurationInterface::DOC_FORMAT_PDF,
    printFormat: \Dhl\Sdk\ParcelDe\Shipping\Api\Data\OrderConfigurationInterface::PRINT_FORMAT_A4
);

$requestBuilder = new \Dhl\Sdk\ParcelDe\Shipping\RequestBuilder\ShipmentOrderRequestBuilder();
$requestBuilder->setShipperAccount(billingNumber: '33333333330101');
$requestBuilder->setShipperAddress(
    company: 'DHL',
    country: 'DEU',
    postalCode: '53113',
    city: 'Bonn',
    streetName: 'Charles-de-Gaulle-Straße',
    streetNumber: '20'
);
$requestBuilder->setRecipientAddress(
    name: 'Jane Doe',
    countryCode: 'DEU',
    postalCode: '53113',
    city: 'Bonn',
    streetName: 'Sträßchensweg',
    streetNumber: '2'
);
$requestBuilder->setShipmentDetails(productCode: 'V01PAK', shipmentDate: new \DateTimeImmutable('2023-02-23'));
$requestBuilder->setPackageDetails(weightInKg: 2.4);

$shipmentOrder = $requestBuilder->create();
$shipments = $service->createShipments([$shipmentOrder], $orderConfiguration);
```

### Delete Shipment Order

[](#delete-shipment-order)

Cancel earlier created shipments.

#### Public API

[](#public-api-2)

The library's components suitable for consumption comprise

- services:
    - service factory
    - shipment service
- data transfer objects:
    - authentication storage

#### Usage

[](#usage-2)

```
$logger = new \Psr\Log\NullLogger();

$serviceFactory = new \Dhl\Sdk\ParcelDe\Shipping\Service\ServiceFactory();
$service = $serviceFactory->createShipmentService($authStorage, $logger, sandbox: true);

$shipmentNumber = '333301011234567890';
$cancelled = $service->cancelShipments([$shipmentNumber]);
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance53

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~134 days

Total

4

Last Release

322d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/efd68399f95aa07110668d9af1a47a8030d8df5ec5af4b28e821d442d787583a?d=identicon)[team-mage](/maintainers/team-mage)

---

Top Contributors

[![Sebastian80](https://avatars.githubusercontent.com/u/6400300?v=4)](https://github.com/Sebastian80 "Sebastian80 (13 commits)")[![CybotTM](https://avatars.githubusercontent.com/u/326348?v=4)](https://github.com/CybotTM "CybotTM (1 commits)")[![mam08ixo](https://avatars.githubusercontent.com/u/1771622?v=4)](https://github.com/mam08ixo "mam08ixo (1 commits)")

---

Tags

gitlab-mirrorphpsdk

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dhl-sdk-api-parcel-de/health.svg)

```
[![Health](https://phpackages.com/badges/dhl-sdk-api-parcel-de/health.svg)](https://phpackages.com/packages/dhl-sdk-api-parcel-de)
```

###  Alternatives

[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15224.3M65](/packages/opensearch-project-opensearch-php)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[mozex/anthropic-php

Anthropic PHP is a supercharged community-maintained PHP API client that allows you to interact with Anthropic API.

46365.1k13](/packages/mozex-anthropic-php)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
