Download the PHP package smart-dato/dpd-sdk without Composer
On this page you can find all versions of the php package smart-dato/dpd-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smart-dato/dpd-sdk
More information about smart-dato/dpd-sdk
Files in smart-dato/dpd-sdk
Package dpd-sdk
Short Description A Laravel package for integrating with the DPD shipping service API.
License MIT
Homepage https://github.com/smart-dato/dpd-sdk
Informations about the package dpd-sdk
DPD SDK for Laravel
A Laravel package for integrating with DPD's SOAP API. Create shipments, generate labels, and track parcels with a fluent, Laravel-style interface.
Features
- ๐ Fluent API - Laravel-style builders for creating shipments
- ๐ Automatic Authentication - Token management with 24-hour caching
- ๐ Multi-Environment - Support for both staging and production endpoints
- ๐ข Multi-Tenant Ready - Runtime configuration override for different accounts
- ๐ฆ Full SOAP Support - LoginService, ShipmentService, and ParcelLifeCycleService
- โ Type-Safe - Modern PHP 8.4 with readonly DTOs and enums
- ๐งช Well Tested - Comprehensive test suite with Pest PHP
Requirements
- PHP 8.4 or higher
- Laravel 11.0 or 12.0
- ext-soap PHP extension
Installation
Install the package via composer:
Publish the config file:
Add your DPD credentials to your .env file:
Usage
Creating a Shipment (Facade)
Use the facade for simple, application-wide configuration:
Runtime Configuration Override (Multi-Tenant)
For multi-tenant applications or dynamic credentials:
Tracking Parcels
Multiple Parcels per Shipment
Custom Label Formats
Customer Reference Numbers and MPS ID
Add custom reference numbers to track your shipments and group related shipments together:
Use cases:
- MPS ID: Group multiple shipments together (useful for split orders or multi-box shipments)
- Reference Number 1: Order number or invoice number
- Reference Number 2: Customer ID or account number
- Reference Number 3: Warehouse location or department
- Reference Number 4: Batch number or shipping wave
Configuration
The config file (config/dpd-sdk.php) provides extensive customization options:
Error Handling
The SDK throws specific exceptions for different error scenarios:
DPD API Error Responses
The SDK automatically detects and formats errors returned by the DPD API. When the API returns error information in the response (instead of SOAP faults), you'll get clear error messages with error codes:
Common DPD error codes:
- Invalid address data - Check sender/recipient address fields (name, street, zip code, city, country)
- Missing required fields - Ensure all mandatory fields are provided
- Invalid depot code - Verify the sending depot code (must be exactly 4 digits)
- Authentication issues - Check your DPD credentials (delis_id and password)
Testing
Run the test suite:
Run tests with coverage:
Run static analysis:
Fix code style:
Architecture
The SDK is built with a layered architecture:
- SOAP Clients - Low-level SOAP wrappers (
BaseSoapClient,LoginServiceClient, etc.) - Token Management - Automatic authentication with 24-hour token caching
- Services - High-level business logic (
ShipmentService,TrackingService) - Builders - Fluent API for creating shipments (
ShipmentBuilder,AddressBuilder,ParcelBuilder) - DTOs - Type-safe data transfer objects (
ShipmentResponse,TrackingEvent, etc.)
See CLAUDE.md for detailed architecture documentation.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- SmartDato
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of dpd-sdk with dependencies
ext-soap Version *
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0||^13.0