smart-dato/db-schenker

Laravel SDK for DB Schenker - Booking Parcel Customer API
6,649
Install
composer require smart-dato/db-schenker
Latest Version:0.1.0
PHP:^8.2|^8.5
Laravel:10 – 13
License:MIT
Last Updated:Oct 13, 2026
Links: GitHub  ·  Packagist
Maintainer: smart-dato

DB Schenker SDK

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A Laravel package for the DB Schenker Booking Parcel Customer API, built on Saloon. It saves and submits parcel bookings.

Requirements

  • PHP 8.2+
  • Laravel 10 – 13

Installation

composer require smart-dato/db-schenker

Publish the config file:

php artisan vendor:publish --tag="db-schenker-config"

Configuration

DB_SCHENKER_BASE_URL=https://wwwtest.dbschenker.com/nges-portal
DB_SCHENKER_TOKEN=your-api-token

The test environment is https://wwwtest.dbschenker.com/nges-portal; production is https://www.dbschenker.com/nges-portal.

Usage

DbSchenker reads the base URL and token from config, or you can pass them explicitly. The DbSchenker facade resolves the same class with the configured values.

use SmartDato\DbSchenker\DbSchenker;

$dbSchenker = new DbSchenker();

// or: new DbSchenker(url: 'https://…', token: '…');

Build a shipment

use SmartDato\DbSchenker\Data\AddressData;
use SmartDato\DbSchenker\Data\PackageData;
use SmartDato\DbSchenker\Data\ShipmentData;
use SmartDato\DbSchenker\Data\ShipmentOptionData;
use SmartDato\DbSchenker\Data\ShippingPartyData;

$shipment = new ShipmentData(
    productCode: 'your-product-code',
    incoterm: 'DAP',
    shipper: new ShippingPartyData(new AddressData(
        name: 'Sender GmbH',
        phone: '+49 30 000000',
        street: 'Musterstraße',
        streetNumber: '1',
        city: 'Berlin',
        countryCode: 'DE',
        personType: 'your-person-type',
        postalCode: '10115',
    )),
    consignee: new ShippingPartyData(new AddressData(
        name: 'Jane Doe',
        phone: '+43 1 000000',
        street: 'Hauptstraße',
        streetNumber: '5',
        city: 'Wien',
        countryCode: 'AT',
        personType: 'your-person-type',
        postalCode: '1010',
    )),
    packages: [
        new PackageData(
            codAmount: 0,
            description: 'Books',
            packagingCode: 'your-packaging-code',
            weight: 2.5,
            weightUnit: 'your-weight-unit',
            length: 30,
            width: 20,
            height: 10,
            dimensionUnit: 'your-dimension-unit',
            quantity: 1,
        ),
    ],
    files: [], // FileData instances for accompanying documents
    shipmentOptions: [new ShipmentOptionData(name: 'your-option')],
    labelFormat: 'your-label-format',
);

shipmentOptions, labelFormat and the optional address fields are omitted from the request body when left empty.

Codes such as personType, weightUnit, dimensionUnit, packagingCode and labelFormat are sent to DB Schenker unchanged — the SDK defines no enums for them, so use the values from your DB Schenker integration documentation.

Save and submit a booking

// Save the booking without submitting it — POST /api/booking/parcel/save
$response = $dbSchenker->save($shipment);

// Submit the booking — POST /api/booking/parcel/submit
$response = $dbSchenker->submit($shipment);

$response->json();

Both return a Saloon Response, so the usual status(), json() and throw() are available. The underlying DbSchenkerConnector is available as $dbSchenker->connector if you want to send SaveRequest / SubmitRequest yourself.

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

smart-dato/duty-refunds-landmark

Duty Refunds Landmark API SDK for Laravel

6,816 0
smart-dato/brt

BRT Laravel sdk

6,734 0
smart-dato/sf-express-sdk

SF Express international open API SDK for Laravel

6,692 0
smart-dato/correos-sdk

Correos SOAP pre-registration and tracking SDK for Laravel

6,699 0
smart-dato/eushipments

EuShipments Laravel SDK

6,142 0

Version History

Version Released PHP Laravel License
0.1.0 ^8.2|^8.5 ^10.0||^11.0||^12.0||^13.0 MIT
0.0.4 ^8.2|^8.5 ^10.0||^11.0||^12.0||^13.0 MIT
0.0.3 ^8.2 ^10.0||^11.0||^12.0 MIT
0.0.2 ^8.2 ^10.0||^11.0||^12.0 MIT
0.0.1 ^8.3 ^10.0||^11.0||^12.0 MIT