PHPackages                             smart-dato/dhl-parcel-sdk - 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. smart-dato/dhl-parcel-sdk

ActiveLibrary[API Development](/categories/api)

smart-dato/dhl-parcel-sdk
=========================

Laravel SDK for the DHL Parcel DE Shipping v2 API

v0.0.10(1mo ago)1362↑84.6%[1 PRs](https://github.com/smart-dato/dhl-parcel-sdk/pulls)MITPHPPHP ^8.4CI passing

Since Mar 19Pushed 1w agoCompare

[ Source](https://github.com/smart-dato/dhl-parcel-sdk)[ Packagist](https://packagist.org/packages/smart-dato/dhl-parcel-sdk)[ Docs](https://github.com/smart-dato/dhl-parcel-sdk)[ GitHub Sponsors](https://github.com/SmartDato)[ RSS](/packages/smart-dato-dhl-parcel-sdk/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (30)Versions (12)Used By (0)

DHL Parcel DE Shipping SDK for Laravel
======================================

[](#dhl-parcel-de-shipping-sdk-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4913a6bbe91416305492215429fa44abbb65d77c2c6007be900497dddbae2ce0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736d6172742d6461746f2f64686c2d70617263656c2d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/smart-dato/dhl-parcel-sdk)[![GitHub Tests Action Status](https://camo.githubusercontent.com/3991ebcd0a7d27137f5efa2b3f95464c621eeeaf0c14aa003103bff71d896325/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736d6172742d6461746f2f64686c2d70617263656c2d73646b2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/smart-dato/dhl-parcel-sdk/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/c48b16826930ea3af59a44a83d0bb9c65202dabc54726a35da29efea4650b288/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736d6172742d6461746f2f64686c2d70617263656c2d73646b2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/smart-dato/dhl-parcel-sdk/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/c75c2e4031863cbe356a3f7711c9b4cb0de460d1fefa147ccef93a24a53f2093/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736d6172742d6461746f2f64686c2d70617263656c2d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/smart-dato/dhl-parcel-sdk)

A Laravel package for the [DHL Parcel DE Shipping v2 API](https://developer.dhl.com/api-reference/parcel-de-shipping-post-parcel-germany-v2). Create shipments, retrieve labels, manage manifests, and more. Built on [Saloon](https://docs.saloon.dev) and [Spatie Laravel Data](https://spatie.be/docs/laravel-data).

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

[](#installation)

```
composer require smart-dato/dhl-parcel-sdk
```

Publish the config file:

```
php artisan vendor:publish --tag="dhl-parcel-sdk-config"
```

Add your credentials to `.env`:

```
# OAuth2 (recommended — Basic Auth is deprecated by DHL):
DHL_PARCEL_API_KEY=your-client-id
DHL_PARCEL_CLIENT_SECRET=your-client-secret
DHL_PARCEL_USERNAME=your-business-customer-username
DHL_PARCEL_PASSWORD=your-business-customer-password

# Or legacy API key only:
# DHL_PARCEL_API_KEY=your-api-key

# Or legacy Basic Auth:
# DHL_PARCEL_USERNAME=your-username
# DHL_PARCEL_PASSWORD=your-password

# Enable sandbox for testing:
# DHL_PARCEL_SANDBOX=true
```

OAuth2 mode is enabled automatically when `DHL_PARCEL_CLIENT_SECRET` is set together with the API key, username and password. The SDK then exchanges the credentials for a Bearer token against the DHL ROPC token endpoint and caches the token in memory until it expires.

Usage
-----

[](#usage)

### Create a shipment

[](#create-a-shipment)

```
use SmartDato\DhlParcel\Data\Orders\ContactAddressData;
use SmartDato\DhlParcel\Data\Orders\ShipmentData;
use SmartDato\DhlParcel\Data\Orders\ShipmentDetailsData;
use SmartDato\DhlParcel\Data\Orders\ShipmentOrderRequestData;
use SmartDato\DhlParcel\Data\Orders\ShipperData;
use SmartDato\DhlParcel\Data\Orders\WeightData;
use SmartDato\DhlParcel\Enums\DocFormat;
use SmartDato\DhlParcel\Enums\Product;
use SmartDato\DhlParcel\Enums\WeightUom;
use SmartDato\DhlParcel\Facades\DhlParcel;

$response = DhlParcel::orders()->create(
    data: new ShipmentOrderRequestData(
        profile: 'STANDARD_GRUPPENPROFIL',
        shipments: [
            new ShipmentData(
                product: Product::V01PAK,
                billingNumber: '33333333330102',
                details: new ShipmentDetailsData(
                    weight: new WeightData(WeightUom::Grams, 500),
                ),
                shipper: new ShipperData(
                    name1: 'My Online Shop GmbH',
                    addressStreet: 'Sträßchensweg 10',
                    city: 'Bonn',
                    country: 'DEU',
                    postalCode: '53113',
                ),
                consignee: new ContactAddressData(
                    name1: 'Maria Musterfrau',
                    addressStreet: 'Kurt-Schumacher-Str. 20',
                    city: 'Bonn',
                    country: 'DEU',
                    postalCode: '53113',
                ),
            ),
        ],
    ),
    docFormat: DocFormat::Pdf,
);

// Access the label
$label = $response->items[0]->label;
```

### Validate a shipment (dry run)

[](#validate-a-shipment-dry-run)

```
$response = DhlParcel::orders()->validate(
    data: $shipmentOrderRequest,
);
```

### Retrieve existing labels

[](#retrieve-existing-labels)

```
$response = DhlParcel::orders()->get(
    shipments: ['340434310428091700'],
);
```

### Delete shipments

[](#delete-shipments)

```
$response = DhlParcel::orders()->delete(
    profile: 'STANDARD_GRUPPENPROFIL',
    shipments: ['340434310428091700'],
);
```

### Manifests

[](#manifests)

```
use SmartDato\DhlParcel\Data\Manifests\ManifestRequestData;

// Get daily manifest
$manifest = DhlParcel::manifests()->get(date: '2025-01-15');

// Close out shipments
$response = DhlParcel::manifests()->create(
    data: new ManifestRequestData(
        profile: 'STANDARD_GRUPPENPROFIL',
        shipmentNumbers: ['340434310428091700'],
    ),
);
```

### Download a label PDF

[](#download-a-label-pdf)

```
$pdfContent = DhlParcel::labels()->download(token: 'label-token-from-response');
```

### Using without the Facade

[](#using-without-the-facade)

You can create a `DhlParcel` instance directly using `DhlParcel::make()`. This is useful when you prefer not to use the facade, need different credentials per request, or want to support multi-tenant setups:

```
use SmartDato\DhlParcel\DhlParcel;

// With OAuth2 (recommended)
$dhl = DhlParcel::make([
    'api_key' => 'your-client-id',
    'client_secret' => 'your-client-secret',
    'username' => 'your-business-customer-username',
    'password' => 'your-business-customer-password',
    'sandbox' => true,
]);

// Or with legacy API key
$dhl = DhlParcel::make([
    'api_key' => 'your-api-key',
    'sandbox' => true,
]);

// Or with legacy Basic Auth
$dhl = DhlParcel::make([
    'username' => 'your-username',
    'password' => 'your-password',
]);

$response = $dhl->orders()->create($data);
```

You can also optionally pass a custom `base_url` if needed:

```
$dhl = DhlParcel::make([
    'api_key' => 'your-api-key',
    'base_url' => 'https://api-eu.dhl.com/parcel/de/shipping/v2',
]);
```

Available products
------------------

[](#available-products)

EnumProduct`Product::V01PAK`DHL Paket`Product::V53WPAK`DHL Paket International`Product::V54EPAK`DHL Europaket`Product::V62WP`Warenpost`Product::V62KP`DHL Kleinpaket`Product::V66WPI`Warenpost InternationalTesting
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [SmartDato](https://github.com/smart-dato)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance96

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~7 days

Total

10

Last Release

38d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c3006db55caec62526937fa2d941da32fc5e69e2ca86a52e87c8046da5958d82?d=identicon)[smart-dato](/maintainers/smart-dato)

---

Top Contributors

[![michael-tscholl](https://avatars.githubusercontent.com/u/178569346?v=4)](https://github.com/michael-tscholl "michael-tscholl (9 commits)")[![tschigo](https://avatars.githubusercontent.com/u/344100?v=4)](https://github.com/tschigo "tschigo (8 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelsaloonshippingdhlSmartDatodhl-parcel

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[danestves/laravel-polar

A package to easily integrate your Laravel application with Polar.sh

8118.0k](/packages/danestves-laravel-polar)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1122.7k](/packages/codebar-ag-laravel-docuware)[codebar-ag/laravel-zammad

Zammad integration with Laravel

106.7k](/packages/codebar-ag-laravel-zammad)

PHPackages © 2026

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