beziworld / laravel-dpd
DPD Polska client for Laravel: DPDServices REST shipments, labels, protocols and courier pickups, InfoServices tracking and MyPudo pickup points.
Requires
- php: ^8.3
- ext-dom: *
- ext-json: *
- guzzlehttp/guzzle: ^7.8
- illuminate/contracts: ^12.0|^13.0
- illuminate/http: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.18
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^3.7|^4.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0
- phpstan/phpstan-strict-rules: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-04 16:36:25 UTC
README
DPD Polska client for Laravel:
- shipments through the DPDServices REST API, with COD, declared value, DPD Pickup delivery and any DPD service
- labels (PDF, ZPL, EPL; A4 or label printer) and handover protocols
- courier pickup windows, ordering and cancellation; postal code routing check
- tracking through DPD InfoServices (SOAP, without
ext-soap) - DPD Pickup points from MyPudo
Installation
composer require beziworld/laravel-dpd
php artisan vendor:publish --tag=dpd-config # optional
DPD_LOGIN=... # DPDServices credentials configured by DPD DPD_PASSWORD=... DPD_MASTER_FID=... DPD_PAYER_FID= # numkat; the master FID when empty DPD_SANDBOX=false # true = dpdservicesdemo.dpd.com.pl (test / thetu4Ee / 1495) DPD_SENDER_COMPANY="ACME Sp. z o.o." DPD_SENDER_NAME="Jan Nowak" DPD_SENDER_ADDRESS="ul. Prosta 1" DPD_SENDER_CITY=Warszawa DPD_SENDER_POSTAL_CODE=00-001 DPD_SENDER_PHONE=500600700 DPD_TRACKING_LOGIN=... # InfoServices: separate credentials and channel DPD_TRACKING_PASSWORD=... DPD_TRACKING_CHANNEL=... DPD_PUDO_KEY=... # MyPudo key from your DPD account manager
Send a package
use Beziworld\Dpd\Data\Address; use Beziworld\Dpd\Data\Package; use Beziworld\Dpd\Data\Parcel; use Beziworld\Dpd\Facades\Dpd; $package = Dpd::createPackage(new Package( receiver: new Address('ul. Długa 5/3', 'Kraków', '30-001', name: 'Anna Kowalska', phone: '600700800', email: 'anna@example.com'), parcels: [new Parcel(weight: 2.5, sizeX: 30, sizeY: 20, sizeZ: 10, content: 'Books')], ref1: 'ORDER-1', // your order or invoice number, printed on the label codAmount: 149.99, services: ['B2C' => ['VALUE' => '10:00-13:00']], // any DPD service with its attributes )); $package->waybills; // ['0000899447393Q'] $pdf = Dpd::labels($package->waybills); // PDF for a label printer by default $protocol = Dpd::protocol($package->waybills); // handover protocol for the courier
Deliver to a DPD Pickup point with pickupPoint: 'PL11523'. createPackages() sends many packages in one session;
with the IGNORE_ERRORS policy the valid ones are registered and each GeneratedPackage carries its own errors.
Courier, tracking and points
Dpd::courierAvailability('00-001'); // [['offset' => 360, 'range' => '09:00-17:00'], ...] $order = Dpd::orderPickup('2026-11-05', '10:00', '15:00', parcelCount: 2, totalWeight: 5, maxWeight: 3); Dpd::cancelPickup($order); // keep $order->orderNumber and $order->checkSum foreach (Dpd::tracking('0000899447393Q') as $event) { $event->code; // six-digit business code, e.g. 190101 delivered $event->description; $event->occurredAt; $event->isDelivered(); } Dpd::pickupPoints('Warszawa', '01-390'); // list<PickupPoint> Dpd::pickupPointsNear(52.2277, 20.9894, 500); // within 500 m Dpd::pickupPoint('PL11523');
Errors
| Exception | When |
|---|---|
ApiException |
DPD rejected the request: status() (e.g. INCORRECT_DATA), field errors(), httpStatus(), traceId() for DPD support |
InvalidConfiguration |
missing credentials, sender, tracking channel or MyPudo key |
Shipment registration is never retried automatically. DPD offers no API to cancel a registered shipment; unused waybills are simply not handed over.
Development
composer install
composer ci # pint --test, phpstan (level 8), pest
Author
Created and maintained by Kamil Ćwiertnia, beziworld.eu.
- E-mail: biuro@beziworld.eu
- Issues: GitHub issues
Need a shipping integration for your shop? Get in touch through beziworld.eu.
Other packages by the author
laravel-inpost · laravel-dhl-parcel · laravel-orlen-paczka · laravel-furgonetka · laravel-apaczka
License
MIT. See LICENSE.md. This package is not affiliated with DPD.