PHPackages                             blobswop/dpd-php-api - 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. blobswop/dpd-php-api

ActiveLibrary[API Development](/categories/api)

blobswop/dpd-php-api
====================

PHP wrapper for DPD Germany SOAP API

v1.0.2(1y ago)41.9k↓30%8[1 issues](https://github.com/blobswop/dpd-php-api/issues)[1 PRs](https://github.com/blobswop/dpd-php-api/pulls)MITPHPPHP ^8.0

Since Jun 11Pushed 1y ago1 watchersCompare

[ Source](https://github.com/blobswop/dpd-php-api)[ Packagist](https://packagist.org/packages/blobswop/dpd-php-api)[ RSS](/packages/blobswop-dpd-php-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

PHP DPD Germany API
===================

[](#php-dpd-germany-api)

About
-----

[](#about)

PHP wrapper for [DPD Germany](https://esolutions.dpd.com/entwickler/dpdwebservices.aspx) SOAP API.

Using:

- LoginService version 2.0
- ParcelLifeCycleService version 2.0
- ShipmentService version 4.4

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

[](#requirements)

This library uses PHP 8.0+

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

[](#installation)

It is recommended that you install the PHP UPS API library [through composer](http://getcomposer.org/). To do so, run the Composer command to install the latest stable version of PHP DPD API:

```
$ composer require blobswop/dpd-php-api
```

Table Of Content
----------------

[](#table-of-content)

1. [Authorization](#authorization)
2. [Create order](#createOrder) (get tracking number and generate label)
3. [Track parcel](#track)

### Authorization

[](#authorization)

```
// set development environment
\Dpd\Api::dev();
$response = null;

try {
    $response = \Dpd\Api::me()->auth(
        new \Dpd\Business\Credentials('sandboxdpd', 'password', 'en_US')
    );

    if ($response instanceof \Dpd\Business\AuthenticationFault) {
        // authentication fault
        print_r($response);
    } elseif ($response instanceof \Dpd\Business\Login) {
        // authentication success - save token
        print_r($response);
    }
} catch(\Throwable $e) {
    print_r($e);
}
```

Example response for authentication fault:

```
Dpd\Business\AuthenticationFault Object
(
    [errorCode:protected] => LOGIN_8
    [errorMessage:protected] => The combination of user and password is invalid.
)
```

Example response for success authentication:

```
Dpd\Business\Login Object
(
    [delisId:protected] => sandboxdpd
    [customerUid:protected] => sandboxdpd
    [authToken:protected] => LT***RR
    [depot:protected] => 0998
)
```

### Create order

[](#create-order)

```
// set development environment
\Dpd\Api::dev();
$response = null;

try {
    $authentication =
        (new \Dpd\Business\Authentication)
            ->setDelisId('sandboxdpd')
            ->setAuthToken('L***R')
            ->setMessageLanguage('en_US');

    $storeOrders =
        (new \Dpd\Business\StoreOrders())
            ->setPrintOptions(
                (new \Dpd\Business\PrintOptions())
                    ->addPrintOption(
                        (new \Dpd\Business\PrintOption())
                            ->setPaperFormatA4()
                            ->setOutputFormat(\Dpd\Business\OutputFormatType::multipageImage())
                    )
                    ->setSplitByParcel(true)
            )
            ->addOrder(
                (new \Dpd\Business\ShipmentServiceData())
                    ->setGeneralShipmentData(
                        (new \Dpd\Business\GeneralShipmentData())
                            ->setProductDpdClassic()
                            ->setSendingDepot('0141')
                            ->setMpsWeight(500)
                            ->setMpsVolume(100 * 10 * 50)
                            ->setSender(
                                (new \Dpd\Business\AddressWithType())
                                    ->setAddressTypeCommercial()
                                    ->setName1('Sender Company GmbH')
                                    ->setName2('Company Sender Person')
                                    ->setStreet('Residenzstraße')
                                    ->setHouseNo(1)
                                    ->setCountry('DE')
                                    ->setZipCode('80333')
                                    ->setCity('München')
                            )
                            ->setRecipient(
                                (new \Dpd\Business\AddressWithType())
                                    ->setAddressTypePrivate()
                                    ->setName1('Person Name')
                                    ->setStreet('Neue Mainzer Str.')
                                    ->setHouseNo('52-58')
                                    ->setCountry('DE')
                                    ->setZipCode('60311')
                                    ->setCity('Frankfurt am Main')
                            )
                            ->setIdentificationNumber('Your-Shipment-Id')
                            ->setMpsCustomerReferenceNumber1('Customer reference 1')
                    )
                    ->addParcel(
                        (new \Dpd\Business\Parcel())
                            ->setWeight(500)
                            ->setAddServiceParcelBox()
                    )
                    ->setProductAndServiceData(
                        (new \Dpd\Business\ProductAndServiceData())
                            ->setOrderTypeConsignment()
                            ->setFood(false)
                    )
            )
            ->addOrder(
                (new \Dpd\Business\ShipmentServiceData())
                    ->setGeneralShipmentData(
                        (new \Dpd\Business\GeneralShipmentData())
                            ->setProductDpdClassic()
                            ->setSendingDepot('0141')
                            ->setMpsWeight(500)
                            ->setMpsVolume(100 * 10 * 50)
                            ->setSender(
                                (new \Dpd\Business\AddressWithType())
                                    ->setAddressTypeCommercial()
                                    ->setName1('Sender Company GmbH')
                                    ->setName2('Company Sender Person')
                                    ->setStreet('Residenzstraße')
                                    ->setHouseNo(1)
                                    ->setCountry('DE')
                                    ->setZipCode('80333')
                                    ->setCity('München')
                            )
                            ->setRecipient(
                                (new \Dpd\Business\AddressWithType())
                                    ->setAddressTypePrivate()
                                    ->setName1('Person Name')
                                    ->setStreet('Neue Mainzer Str.')
                                    ->setHouseNo('52-58')
                                    ->setCountry('DE')
                                    ->setZipCode('60311')
                                    ->setCity('Frankfurt am Main')
                            )
                            ->setIdentificationNumber('Your-Return-Shipment-Id')
                            ->setMpsCustomerReferenceNumber1('Customer reference 1')
                    )
                    ->addParcel(
                        (new \Dpd\Business\Parcel())
                            ->setWeight(500)
                            ->setAddServiceParcelBox()
                            ->setReturns(true)
                    )
                    ->setProductAndServiceData(
                        (new \Dpd\Business\ProductAndServiceData())
                            ->setOrderTypeConsignment()
                            ->setFood(false)
                    )
            );

    $response = \Dpd\Api::me()->storeOrders($authentication, $storeOrders);

    if ($response instanceof \Dpd\Business\AuthenticationFault) {
        // authentication fault
        print_r($response);
    } elseif ($response instanceof \Dpd\Business\StoreOrdersResponseType) {

        print_r($response);

        foreach ($response->getShipmentResponses() as $shipmentResponse) {
            if (
                $shipmentResponse instanceof \Dpd\Business\ShipmentResponse
                && $shipmentResponse->getParcelInformation() instanceof \Dpd\Business\ParcelInformationType
                && $shipmentResponse->getParcelInformation()->getParcelLabelNumber()
                && $shipmentResponse->getParcelInformation()->getOutput() instanceof \Dpd\Business\OutputType
                && $shipmentResponse->getParcelInformation()->getOutput()->getContent()
            ) {
                if ($shipmentResponse->getParcelInformation()->getOutput()->getFormat() == \Dpd\Business\OutputFormatType::TYPE_PDF) {
                    file_put_contents($shipmentResponse->getParcelInformation()->getParcelLabelNumber() . '.pdf', $shipmentResponse->getParcelInformation()->getOutput()->getContent());
                } elseif ($shipmentResponse->getParcelInformation()->getOutput()->getFormat() == \Dpd\Business\OutputFormatType::TYPE_MULTIPAGE_IMAGE) {
                    file_put_contents($shipmentResponse->getParcelInformation()->getParcelLabelNumber() . '.gif', $shipmentResponse->getParcelInformation()->getOutput()->getContent());
                }
            }
        }
    }
} catch(\Throwable $e) {
    // process exception
}
```

Example response for authentication fault:

```
Dpd\Business\AuthenticationFault Object
(
    [errorCode:protected] => LOGIN_5
    [errorMessage:protected] => The authtoken is invalid
)
```

Example response for incorrect request:

```
Dpd\Business\StoreOrdersResponseType Object
(
    [shipmentResponses:protected] => Array
        (
            [0] => Dpd\Business\ShipmentResponse Object
                (
                    [identificationNumber:protected] => Your-Shipment-Id
                    [faults:protected] => Dpd\Business\FaultCodeType Object
                        (
                            [faultCode:protected] => COMMON_7
                            [message:protected] => mpsWeight
                        )

                )

            [1] => Dpd\Business\ShipmentResponse Object
                (
                    [identificationNumber:protected] => Your-Return-Shipment-Id
                    [faults:protected] => Dpd\Business\FaultCodeType Object
                        (
                            [faultCode:protected] => COMMON_7
                            [message:protected] => mpsWeight
                        )

                )

        )

)
```

Example success response:

```
Dpd\Business\StoreOrdersResponseType Object
(
    [shipmentResponses:protected] => Array
        (
            [0] => Dpd\Business\ShipmentResponse Object
                (
                    [identificationNumber:protected] => Your-Shipment-Id
                    [mpsId:protected] => MPS0998505320867120210611
                    [parcelInformation:protected] => Dpd\Business\ParcelInformationType Object
                        (
                            [parcelLabelNumber:protected] => 09985053208671
                            [output:protected] => Dpd\Business\OutputType Object
                                (
                                    [format:protected] => MULTIPAGE_IMAGE
                                    [content:protected] => BINARY LABEL DATA
                                )
                        )
                )
            [1] => Dpd\Business\ShipmentResponse Object
                (
                    [identificationNumber:protected] => Your-Return-Shipment-Id
                    [mpsId:protected] => MPS0998505320867220210611
                    [parcelInformation:protected] => Dpd\Business\ParcelInformationType Object
                        (
                            [parcelLabelNumber:protected] => 09985053208672
                            [output:protected] => Dpd\Business\OutputType Object
                                (
                                    [format:protected] => MULTIPAGE_IMAGE
                                    [content:protected] => BINARY LABEL DATA
                                )
                        )
                )
        )
)
```

and labels will be saved in `09985053208666.gif` and `09985053208667.gif` files

### Track parcel

[](#track-parcel)

```
\Dpd\Api::dev();
$response = null;

try {
    $authentication =
        (new \Dpd\Business\Authentication)
            ->setDelisId('sandboxdpd')
            ->setAuthToken('L***R')
            ->setMessageLanguage('en_US');

    $response =
        \Dpd\Api::me()->getTrackingData(
            $authentication,
            new \Dpd\Business\GetTrackingData('09981122330100')
        );

    if ($response instanceof \Dpd\Business\AuthenticationFault) {
        // authentication fault
        print_r($response);
    } elseif ($response instanceof \Dpd\Business\TrackingResult) {
        print_r($response);
    }
} catch(\Throwable $e) {
    print_r($e);
}
```

Example response for authentication fault:

```
Dpd\Business\AuthenticationFault Object
(
    [errorCode:protected] => LOGIN_5
    [errorMessage:protected] => The authtoken is invalid
)
```

Example response for unexisted :

```
Dpd\Business\AuthenticationFault Object
(
    [errorCode:protected] => LOGIN_5
    [errorMessage:protected] => The authtoken is invalid
)
```

Example success response:

```
Dpd\Business\TrackingResult Object
(
    [shipmentInfo:protected] => Dpd\Business\ShipmentInfo Object
        (
            [serviceDescription:protected] => Dpd\Business\ContentItem Object
                (
                    [label:protected] => Dpd\Business\ContentLine Object
                        (
                            [content:protected] => Your DPD service:
                            [bold:protected] =>
                            [paragraph:protected] =>
                        )

                    [content:protected] => Dpd\Business\ContentLine Object
                        (
                            [content:protected] => DPD CLASSIC C.O.D.
                            [bold:protected] =>
                            [paragraph:protected] =>
                        )

                    [linkTarget:protected] =>
                )
            [status:protected] => SHIPMENT
            [label:protected] => Dpd\Business\ContentLine Object
                (
                    [content:protected] => Shipment information
                    [bold:protected] => 1
                    [paragraph:protected] =>
                )
            [description:protected] => Dpd\Business\ContentItem Object
                (
                    [content:protected] => Dpd\Business\ContentLine Object
                        (
                            [content:protected] => Details of your shipment
                            [bold:protected] =>
                            [paragraph:protected] =>
                        )
                    [linkTarget:protected] =>
                )
            [statusHasBeenReached:protected] =>
            [isCurrentStatus:protected] =>
            [showContactInfo:protected] =>
        )
    [statusInfo:protected] => Array
        (
            [0] => Dpd\Business\StatusInfo Object
                (
                    [status:protected] => ACCEPTED
                    [label:protected] => Dpd\Business\ContentLine Object
                        (
                            [content:protected] => Parcel handed to DPD
                            [bold:protected] => 1
                            [paragraph:protected] =>
                        )
                    [description:protected] => Dpd\Business\ContentItem Object
                        (
                            [content:protected] => Dpd\Business\ContentLine Object
                                (
                                    [content:protected] => DPD has received your parcel.
                                    [bold:protected] =>
                                    [paragraph:protected] =>
                                )
                            [linkTarget:protected] =>
                        )
                    [statusHasBeenReached:protected] =>
                    [isCurrentStatus:protected] => 1
                    [showContactInfo:protected] =>
                )
            [1] => Dpd\Business\StatusInfo Object
                (
                    [status:protected] => AT_SENDING_DEPOT
                    [label:protected] => Dpd\Business\ContentLine Object
                        (
                            [content:protected] => In transit
                            [bold:protected] => 1
                            [paragraph:protected] =>
                        )
                    [description:protected] => Dpd\Business\ContentItem Object
                        (
                            [content:protected] => Dpd\Business\ContentLine Object
                                (
                                    [content:protected] => The parcel is at the parcel dispatch centre.
                                    [bold:protected] =>
                                    [paragraph:protected] =>
                                )
                            [linkTarget:protected] =>
                        )
                    [statusHasBeenReached:protected] =>
                    [isCurrentStatus:protected] =>
                    [showContactInfo:protected] =>
                )
            [2] => Dpd\Business\StatusInfo Object
                (
                    [status:protected] => ON_THE_ROAD
                    [label:protected] => Dpd\Business\ContentLine Object
                        (
                            [content:protected] => At parcel delivery centre
                            [bold:protected] => 1
                            [paragraph:protected] =>
                        )
                    [description:protected] => Dpd\Business\ContentItem Object
                        (
                            [content:protected] => Dpd\Business\ContentLine Object
                                (
                                    [content:protected] => Your parcel is on its way to the parcel delivery centre.
                                    [bold:protected] =>
                                    [paragraph:protected] =>
                                )
                            [linkTarget:protected] =>
                        )
                    [statusHasBeenReached:protected] =>
                    [isCurrentStatus:protected] =>
                    [showContactInfo:protected] =>
                )
            [3] => Dpd\Business\StatusInfo Object
                (
                    [status:protected] => AT_DELIVERY_DEPOT
                    [label:protected] => Dpd\Business\ContentLine Object
                        (
                            [content:protected] => Parcel out for delivery
                            [bold:protected] => 1
                            [paragraph:protected] =>
                        )
                    [description:protected] => Dpd\Business\ContentItem Object
                        (
                            [content:protected] => Dpd\Business\ContentLine Object
                                (
                                    [content:protected] => At parcel delivery centre.
                                    [bold:protected] =>
                                    [paragraph:protected] =>
                                )
                            [linkTarget:protected] =>
                        )
                    [statusHasBeenReached:protected] =>
                    [isCurrentStatus:protected] =>
                    [showContactInfo:protected] =>
                )
            [4] => Dpd\Business\StatusInfo Object
                (
                    [status:protected] => DELIVERED
                    [label:protected] => Dpd\Business\ContentLine Object
                        (
                            [content:protected] => Parcel delivered
                            [bold:protected] => 1
                            [paragraph:protected] =>
                        )
                    [description:protected] => Dpd\Business\ContentItem Object
                        (
                            [content:protected] => Dpd\Business\ContentLine Object
                                (
                                    [content:protected] => Your parcel has been delivered successfully.
                                    [bold:protected] =>
                                    [paragraph:protected] =>
                                )

                            [linkTarget:protected] =>
                        )
                    [statusHasBeenReached:protected] =>
                    [isCurrentStatus:protected] =>
                    [showContactInfo:protected] =>
                )
        )
)
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance44

Moderate activity, may be stable

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~714 days

Total

3

Last Release

375d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7665884?v=4)[Deryabin Sergey](/maintainers/deryabinsergey)[@DeryabinSergey](https://github.com/DeryabinSergey)

---

Top Contributors

[![DeryabinSergey](https://avatars.githubusercontent.com/u/7665884?v=4)](https://github.com/DeryabinSergey "DeryabinSergey (3 commits)")[![HaroldAlingGSD](https://avatars.githubusercontent.com/u/177649633?v=4)](https://github.com/HaroldAlingGSD "HaroldAlingGSD (1 commits)")

---

Tags

apitrackingwrappershippingdpd

### Embed Badge

![Health badge](/badges/blobswop-dpd-php-api/health.svg)

```
[![Health](https://phpackages.com/badges/blobswop-dpd-php-api/health.svg)](https://phpackages.com/packages/blobswop-dpd-php-api)
```

###  Alternatives

[gabrielbull/ups-api

PHP UPS API

4642.4M10](/packages/gabrielbull-ups-api)[gavroche/ups-api

PHP UPS API

45613.2k](/packages/gavroche-ups-api)[maxirus/fedex

FedEx API wrapper

176.6k](/packages/maxirus-fedex)[michaelb/ship-station

A php wrapper for ship station's api

101.9k](/packages/michaelb-ship-station)

PHPackages © 2026

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