PHPackages                             neriba/dpd-api-lib - 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. neriba/dpd-api-lib

ActiveLibrary[API Development](/categories/api)

neriba/dpd-api-lib
==================

DPD API library, to help to integrate with other systems

1.0.2(3y ago)4784↓50%MITPHPPHP ^8.0|^8.1|^8.2

Since Oct 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/NerijusBartosevicius/dpd-api-lib)[ Packagist](https://packagist.org/packages/neriba/dpd-api-lib)[ Docs](https://github.com/NerijusBartosevicius/dpd-api-lib)[ RSS](/packages/neriba-dpd-api-lib/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

DPD Api library
===============

[](#dpd-api-library)

DPD API library, to help to integrate with other systems

[![Latest Stable Version](https://camo.githubusercontent.com/2140f20dd435a14bd417ed7883373bd1567a76af600841d092b04d3fc0940e7c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e65726962612f6470642d6170692d6c69622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/neriba/dpd-api-lib)[![Total Downloads](https://camo.githubusercontent.com/c8d9b5cc438b10e46ccc8b394e51d2d5424b595af8278516ff3003395c805577/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e65726962612f6470642d6170692d6c69622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/neriba/dpd-api-lib)[![License](https://camo.githubusercontent.com/a3e1f7c655fddaf175489782be7f4726fad42d9e23766e511f6e328d4567e78f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6e65726962612f6470642d6170692d6c6962)](https://packagist.org/packages/neriba/dpd-api-lib)

Official DPD docs
-----------------

[](#official-dpd-docs)

- [DPD Amber API](https://esiunta.dpd.lt/api/)
- [DPD API documentation](https://github.com/NerijusBartosevicius/dpd-api-lib/blob/main/docs/DPD-Telli-API-documentation-v1-1-3.pdf)
- [DPD tracking service](https://github.com/NerijusBartosevicius/dpd-api-lib/blob/main/docs/Shipment-status-tracking-web-service.pdf)

Instalation
-----------

[](#instalation)

To install via composer:

```
composer require neriba/dpd-api-lib
```

Authentication
--------------

[](#authentication)

#### Environments

[](#environments)

- LT - Lithuania production (default).
- LT\_TEST - Lithuania sandbox.
- LV - Latvia production.
- LV\_TEST - Latvia sandbox.
- EE - Estonia production.
- EE\_TEST - Estonia sandbox.

### Get new token

[](#get-new-token)

`If you don't have an API key from DPD, but you have an old API credencials name and password you can generate your own API key.`

```
  // By default, third parameter is Lithuanian production environment
  $getToken = new \NeriBa\DpdApiLib\ApiTokenGenerator('USERNAME','PASSWORD','LT_TEST');
  $getToken->createAuthToken('Token name');
```

#### Create instance

[](#create-instance)

```
  $token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9....';
  // By default, third parameter is Lithuanian production environment
  $dpd = new \NeriBa\DpdApiLib\Request($token, 'LT_TEST');
```

### Get user information

[](#get-user-information)

```
  $dpd->authMe();
```

### Get list of tokens

[](#get-list-of-tokens)

```
  $dpd->getAuthTokenSecrets();
```

### Delete existing token

[](#delete-existing-token)

```
  $dpd->deleteAuthTokenSecrets('99bb2035-5ed8-4547-95ca-7ffb5e79e694');
```

Services
--------

[](#services)

### Get services and price for user

[](#get-services-and-price-for-user)

```
  // additional parameters are possible as an array e.g ['countryFrom' => 'LT', 'countryTo' => 'LT']
  // Parameters list: https://esiunta.dpd.lt/api#/Services/042db4934d823e1cc21745c549f2a810
  $dpd->getServices(['countryFrom' => 'LT', 'countryTo' => 'LT']);
```

Shipment
--------

[](#shipment)

### Get list of shipments

[](#get-list-of-shipments)

```
  // additional parameters are possible as an array e.g ['limit'=> 10]
  // Parameters list: https://esiunta.dpd.lt/api/#/Shipment/1aed3b00cafe6d7bd576b2b84b41826f
  $dpd->getShipments();
```

### Create simple shipment

[](#create-simple-shipment)

```
  $senderAddress = new \NeriBa\DpdApiLib\Shipment\Package\Address();
  $senderAddress
      ->setName('Test Sender')
      ->setPhone('62166025')
      ->setStreet('Uosių g')
      ->setStreetNo(24)
      ->setCity('Kaunas')
      ->setPostalCode('51446')
      ->setCountry('LT');

  $receiverAddress = new \NeriBa\DpdApiLib\Shipment\Package\Address();
  $receiverAddress
      ->setName('Test Receiver')
      ->setPhone('65123456')
      ->setStreet('Uriekstes')
      ->setStreetNo(24)
      ->setCity('Kaunas')
      ->setPostalCode('51446')
      ->setCountry('LT');

  $shipment = new \NeriBa\DpdApiLib\Shipment\Shipment();
  $shipment
      ->setSenderAddress($senderAddress)
      ->setReceiverAddress($receiverAddress)
      ->setService((new \NeriBa\DpdApiLib\Shipment\Package\Service())->setServiceName('DPD CLASSIC'))
      ->setParcel((new \NeriBa\DpdApiLib\Shipment\Package\Parcel())->setWeight(31)->setSize('XS'));

  $shipment2 = new \NeriBa\DpdApiLib\Shipment\Shipment();
  $shipment2
      ->setSenderAddress($senderAddress)
      ->setReceiverAddress($receiverAddress)
      ->setService((new \NeriBa\DpdApiLib\Shipment\Package\Service())->setServiceName('DPD CLASSIC'))
      ->setParcel((new \NeriBa\DpdApiLib\Shipment\Package\Parcel())->setWeight(10)->setSize('m'));

  // Max 50 shipments per request
  $dpd->createShipments([$shipment,$shipment2]);
```

### Delete shipments

[](#delete-shipments)

```
$dpd->deleteShipments(['0fa01f06-7c56-4c5c-a33f-0eca869663f3','0fa01f06-7c56-4c5c-a33f-0eca869663f4']);
```

Labels
------

[](#labels)

### Create label

[](#create-label)

```
$dpd->createShipmentsLabels((new \NeriBa\DpdApiLib\Shipment\Package\LabelOption())->setShipmentIds(['0fa01f06-7c56-4c5c-a33f-0eca869663f3']));
```

Invoice
-------

[](#invoice)

### Gets invoice by uuid

[](#gets-invoice-by-uuid)

```
$dpd->getInvoices('0fa01f06-7c56-4c5c-a33f-0eca869663f3');
```

Lockers
-------

[](#lockers)

### Find lockers based on given criteria

[](#find-lockers-based-on-given-criteria)

```
$dpd->getLockers(['countryCode' => 'LT']);
```

Manifest
--------

[](#manifest)

### Create shipment manifest

[](#create-shipment-manifest)

```
$dpd->createShipmentManifest((new \NeriBa\DpdApiLib\Shipment\Package\Manifest())->setShipmentIds(['0fa01f06-7c56-4c5c-a33f-0eca869663f3']));
```

### Get shipment manifest by uuid

[](#get-shipment-manifest-by-uuid)

```
$dpd->getShipmentsManifestByManifest('0fa01f06-7c56-4c5c-a33f-0eca869663f3');
```

### Get shipment manifest by shipment uuid

[](#get-shipment-manifest-by-shipment-uuid)

```
$dpd->getShipmentsManifestByShipment('0fa01f06-7c56-4c5c-a33f-0eca869663f3');
```

Pickup
------

[](#pickup)

### Create pickup

[](#create-pickup)

```
$pickupAddress = new \NeriBa\DpdApiLib\Shipment\Package\Address();
$pickupAddress
    ->setName('Test Sender')
    ->setContactName('Test Sender cc')
    ->setEmail('john.doe@email.com')
    ->setPhone('+37062166025')
    ->setStreet('Uosių g')
    ->setStreetNo(24)
    ->setCity('Kaunas')
    ->setPostalCode('51446')
    ->setCountry('LT');

$pickup = new \NeriBa\DpdApiLib\Pickup\Pickup();
$pickup
    ->setPallets([(new \NeriBa\DpdApiLib\Pickup\Package\Pallet())->setWeight(150)->setCount(1)])
    ->setAddress($pickupAddress)
    ->setPickupDate('2022-10-12')
    ->setPickupTime('11:00', '15:00');

$dpd->createPickup($pickup);
```

### Get pickups

[](#get-pickups)

```
// additional parameters are possible as an array e.g ['limit'=> 10]
// Parameters list: https://esiunta.dpd.lt/api/#/Pickup/50e315fc1327d9f9a55db05ef66b4b48
$dpd->getPickups();
```

### Get list of pickup timeframes

[](#get-list-of-pickup-timeframes)

```
// additional parameters are possible as an array e.g ['country' => 'LT','zip' => 51336]
// Parameters list: https://esiunta.dpd.lt/api/#/Pickup%20timeframes/e092e35374638c464b1e0b3eaa7513d9
$dpd->getPickupTimeFrames(['country' => 'LT','zip' => 51336]);
```

Problem
-------

[](#problem)

### Get a description for a problem from the knowledge base

[](#get-a-description-for-a-problem-from-the-knowledge-base)

```
$dpd->getProblems(123456);
```

Status
------

[](#status)

### Gets parcel statuses

[](#gets-parcel-statuses)

```
// additional parameters are possible as an array e.g ['pknr' => '05808021421108','show_all' => 1]
// Parameters list: https://esiunta.dpd.lt/api#/Status/ede44d1ca4e3e15955d44ecc42970e3c
$dpd->getTrackingStatus(['pknr' => '05808021421108']);
```

### Subscribe to parcel

[](#subscribe-to-parcel)

```
// additional parameters are possible as an array e.g ['parcelnumber' => '05808021421108', 'callbackurl' => 'https://www.hereisyoursiteurl.com']
// Parameters list: https://esiunta.dpd.lt/api#/Status/8d78b691726ba36b76c5960067c1370c
$dpd->subscribeToParcel(['parcelnumber' => '05808021421108', 'callbackurl' => 'https://www.hereisyoursiteurl.com']);
```

### Unsubscribe to parcel

[](#unsubscribe-to-parcel)

```
// additional parameters are possible as an array e.g ['parcelnumber' => '05808021421108', 'callbackurl' => 'https://www.hereisyoursiteurl.com']
// Parameters list: https://esiunta.dpd.lt/api#/Status/915e1bfce8f27458cfb3f27f78326866
$dpd->unsubscribeToParcel(['parcelnumber' => '05808021421108', 'callbackurl' => 'https://www.hereisyoursiteurl.com']);
```

Tracking
--------

[](#tracking)

#### Environments

[](#environments-1)

- LT - Lithuania production (default).
- LV - Latvia production.
- EE - Estonia production.

### Get tracking info by parcel numbers

[](#get-tracking-info-by-parcel-numbers)

`NOTE: Now tracking working without authorization,although the documentation says that it is used Bearer.`

```
$apiKey = '';
// By default, second parameter is Lithuanian production environment
$tracking = new \NeriBa\DpdApiLib\Tracking($apiKey,'LT');
$tracking->getTracking(['05808021421108','05808021421105']);
```

License
=======

[](#license)

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

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~161 days

Total

2

Last Release

1141d ago

PHP version history (2 changes)1.0.1PHP ^8.0|^8.1

1.0.2PHP ^8.0|^8.1|^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/568838bd42f195391c3b55f36e9d5be56d1667f45db4d50a5f0b9b792f708e4b?d=identicon)[NerijusBartosevicius](/maintainers/NerijusBartosevicius)

---

Top Contributors

[![NerijusBartosevicius](https://avatars.githubusercontent.com/u/8555488?v=4)](https://github.com/NerijusBartosevicius "NerijusBartosevicius (3 commits)")

---

Tags

apidpdphpphp-library

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/neriba-dpd-api-lib/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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