Search by

omnibus / db-schenker

GlitchArt

Omnibus DB Schenker: tracking through the eSchenker API; rates from configuration, shipments booked in the portal.

v2.0.0 2026-11-13 08:56 UTC

This package is auto-updated.

Last update: 2026-11-13 13:28:28 UTC


README

DB Schenker for omnisense/omnibus: tracking through eSchenker's public tracking (no credentials), and land-transport bookings through the Schenker Open API when an API key is configured. Prices come from configuration (rates): Schenker quotes by contract.

Install and a first call

composer require omnibus/db-schenker

No account for this first call: DB Schenker's answer is recorded (Omnibus\Testing\RecordedHttpClient answers in place of the API), so nothing leaves the process. With your own credentials, give the factory your HTTP client (or none: it makes its own) and drop the recorded one.

<?php

require __DIR__.'/vendor/autoload.php';

use Omnibus\DbSchenker\DbSchenkerGatewayFactory;
use Omnibus\Testing\RecordedHttpClient;

// DB Schenker's answer, recorded: no account, and nothing leaves the process.
$http = new RecordedHttpClient([
    'eschenker.dbschenker.com' => ['shipments' => [['shipmentNumber' => '1234567890', 'status' => 'Delivered', 'events' => [
        ['eventDate' => '2026-10-02T09:40:00', 'eventCode' => 'DLV', 'eventDescription' => 'Delivered', 'location' => ['city' => 'Lyon', 'country' => 'FR']],
    ]]]],
]);
$gateway = (new DbSchenkerGatewayFactory($http))->create([]);

$tracking = $gateway->track('1234567890');
echo $tracking->status->value, ' - ', $tracking->latest()?->description, "\n";   // delivered - Delivered

Tracking needs no account at DB Schenker; a booking needs an Open API key (below). Nothing here was run against DB Schenker's service: the answer is shaped after its documentation, and the bookings are unverified.

Configuration

$gateway = (new DbSchenkerGatewayFactory($http))->create($options);   // $http: the application's HTTP client - none given, the factory makes its own; the options below

No framework needed: the package requires omnisense/omnibus and symfony/http-client. In a Symfony application, the same through the bundle's configuration:

omnibus:
    gateways:
        db_schenker:
            factory: db_schenker
            options:
                api_key: '%env(SCHENKER_API_KEY)%'        # optional: bookings
                account_number: '%env(SCHENKER_ACCOUNT)%'
                rates:
                    - { service: SYSTEM, label: 'DB Schenker System', bands: { 30000: 2900 } }

The booking action is built on the Open API's published shape and is unverified: it needs an account's key (from the Schenker partner portal) to be run against the service. Tracking is live.

Responsibility

This package is an independent, unofficial client: it is not affiliated with, endorsed by or sponsored by DB Schenker (now part of DSV A/S). It reaches their service on behalf of whoever runs it, and it does not redistribute their data beyond the short excerpts recorded as test fixtures. Its MIT licence covers this package's code only and grants no right to the service or to its data.

Whoever installs and runs this package is responsible for complying with DSV and DB Schenker's terms (DSV API terms and conditions), for obtaining whatever they require (an account, a key, a licence or subscription, an attribution or a citation, a rate limit to respect), and for any use made of what it returns. The authors publish it free of charge, make no commercial use of it, and accept no liability for how it is used (see LICENSE).

License: MIT since 2026-10-09; earlier versions remain published under LGPL-3.0-or-later.