smart-dato/dhl-connect-plus-sdk

A PHP SDK for integrating with DHL Parcel Iberia's CIMAPI (Customer Integration Management API). This package provides an easy-to-use interface for creating shipments, tracking packages, managing pickups, finding service points, and handling end-of-day operations for B2B and B2C deliveries across Spain and Portugal.
6,327
Install
composer require smart-dato/dhl-connect-plus-sdk
Latest Version:0.0.11
PHP:^8.4|^8.5
Laravel:11 · 12 · 13
License:MIT
Last Updated:Oct 14, 2026
Links: GitHub  ·  Packagist
Maintainer: smart-dato

DHL Connect Plus

GitHub Tests Action Status GitHub Code Style Action Status

A PHP SDK for integrating with DHL Parcel Iberia's CIMAPI (Customer Integration Management API). This package provides an easy-to-use interface for creating shipments, tracking packages, managing pickups, finding service points, and handling end-of-day operations for B2B and B2C deliveries across Spain and Portugal.

The SDK is built on top of Saloon for robust HTTP client functionality and supports JWT-based authentication as required by DHL's API.

Requirements

  • PHP 8.4 or higher
  • Laravel 11 – 13
  • Saloon 4

Installation

You can install the package via composer:

composer require smart-dato/dhl-connect-plus-sdk

You can publish the config file with:

php artisan vendor:publish --tag="dhl-connect-plus-sdk-config"

This is the contents of the published config file:

return [
    'url' => env('DHL_CONNECT_PLUS_SDK_BASE_URL', 'https://external.dhl.es/cimapi/api/v1/customer'),
    'auth' => [
        'username' => env('DHL_CONNECT_PLUS_SDK_USERNAME', 'Username2025'),
        'password' => env('DHL_CONNECT_PLUS_SDK_PASSWORD', 'Password312'),
        'customer_id' => env('DHL_CONNECT_PLUS_SDK_CUSTOMER_ID', '00-111000'),
    ],
];

Usage

Authentication

First, authenticate to get an access token:

use SmartDato\DhlConnectPlusClient\DhlConnectPlusConnector;
use SmartDato\DhlConnectPlusClient\Requests\Authentication\Authenticate;

$connector = new DhlConnectPlusConnector;
$token = $connector->send(new Authenticate('test', 'user'));
// Token is automatically stored and used for subsequent requests

Creating a Shipment

Create a basic B2B shipment:

use SmartDato\DhlConnectPlusClient\DhlConnectPlusConnector;
use SmartDato\DhlConnectPlusClient\Dto\Input\Shipment\CreateShipmentPayload;
use SmartDato\DhlConnectPlusClient\Dto\Input\Shipment\Receiver;
use SmartDato\DhlConnectPlusClient\Dto\Input\Shipment\Sender;
use SmartDato\DhlConnectPlusClient\Requests\Shipment\Create;

$payload = new CreateShipmentPayload(
    quantity: 2,
    weight: 5,
    incoterms: 'CPT',
    receiver: new Receiver(
        name: 'DHL Parcel Madrid',
        address: 'Río Almanzora,s/n',
        city: 'Getafe',
        postalcode: '28906',
        country: 'ES',
        phone: '+34935656885',
        email: 'ferran.julian@dhl.com'
    ),
    sender: new Sender(
        name: 'DHL Parcel Barcelona',
        address: 'Les Minetes,2-3',
        city: 'Santa Perpetua',
        postalcode: '08130',
        country: 'ES',
        phone: '+34935656885',
        email: 'ferran.julian@dhl.com'
    ),
    reference: 'ALB123456',
    weightVolume: 0,
    codAmount: 0,
    codExpenses: 'P',
    codCurrency: 'EUR',
    insuranceAmount: 0,
    insuranceExpenses: 'P',
    insuranceCurrency: 'EUR',
    deliveryNote: 'S',
    remarks1: '',
    remarks2: '',
    contactName: '',
    goodsDescription: '',
    customsValue: 0,
    customsCurrency: '',
    format: 'PDF'
);

$connector = new DhlConnectPlusConnector;
$label = $connector->send(new Create($payload));

// Access tracking number and label
$trackingNumber = $label->tracking;
$labelBase64 = $label->label;

Tracking a Shipment

Track a shipment by tracking number:

use SmartDato\DhlConnectPlusClient\DhlConnectPlusConnector;
use SmartDato\DhlConnectPlusClient\Requests\Tracking\Track;
use SmartDato\DhlConnectPlusClient\Enums\Idioma;
use SmartDato\DhlConnectPlusClient\Enums\Show;


$connector = new DhlConnectPlusConnector;
$trackEvent = $connector->send(new Track(
    id: '0870002260',
    idioma: Idioma::En,
    show: Show::Events,
));
// Returns array of tracking events

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

Related Packages

overtrue/laravel-wechat

微信 SDK for Laravel

1,894,223 2,900
zgldh/qiniu-laravel-storage

Qiniu Resource (Cloud) Storage SDK for Laravel 5/6/7/8/9

408,913 516
santigraviano/laravel-mercadopago

Mercado Pago SDK v0.5.2 for Laravel

160,480 46
artesaos/laravel-linkedin

Linkedin API integration for Laravel and Lumen 5

66,936 56
aws/aws-sdk-php-laravel

A simple Laravel 9/10/11/12/13 service provider for including the AWS SDK for PH...

41,441,551 1,715

Version History

Version Released PHP Laravel License
0.0.11 ^8.4|^8.5 ^11.0||^12.0||^13.0 MIT
0.0.10 ^8.4|^8.5 ^11.0||^12.0||^13.0 MIT
0.0.9 ^8.4|^8.5 ^11.0||^12.0||^13.0 MIT
0.0.7 ^8.4|^8.5 ^11.0||^12.0||^13.0 MIT
0.0.6 ^8.4|^8.5 ^11.0||^12.0||^13.0 MIT