PHPackages                             mladjom/dhlbook - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mladjom/dhlbook

ActiveLibrary[API Development](/categories/api)

mladjom/dhlbook
===============

DHL Sweden Freight DHLBookWS

01PHP

Since Sep 9Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mladjom/dhlbook)[ Packagist](https://packagist.org/packages/mladjom/dhlbook)[ RSS](/packages/mladjom-dhlbook/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

License
-------

[](#license)

```
This Code is released under the GNU LGPL

This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.

See the GNU Lesser General Public License for more details.

```

Description
-----------

[](#description)

This library is a PHP Oriented Object client for the DHL Book pickup - Web Service. IT implements the DHL DHL Book pickup as described here . An account is required to see this restricted web page.

Setup
-----

[](#setup)

You can use composer to use this library.

```
{
    "require": {
		"mladjom/dhlbook": "*"
    }
}
```

Usage
-----

[](#usage)

This client does not rely or depend on any framework and it should be fairly easy to integrate with your own code.

The example.php contains examples on how to use the client and perform requests to DHL XML API, those are bock a pickup, get stations and get station details.

In order to have the samples working, you will need to create a DHL Freight account. You can do that by going to their URL :

Example
-------

[](#example)

### Request a shipment

[](#request-a-shipment)

```
require_once __DIR__ . '/vendor/autoload.php';
/**
 * Minimal options
 */
$options = array(
	\WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_URL => 'https://www.dhltoolbox.se/DHLBookWS/Book.asmx?wsdl',
	\WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_CLASSMAP => \DHLBook\ClassMap::get(),
	\WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_SOAP_VERSION => 'SOAP_1_2',
);

/**
 * Samples for Book ServiceType
 */
$book = new \DHLBook\ServiceType\Book( $options );

/**
 * Credentials for all operations/methods
 */
$credentials = new \DHLBook\StructType\Credentials();
$credentials->User = 'BookAppUser';
$credentials->Password = 'BA%Pwd07';
/**
 * Sample call for BookPickup operation/method
 */
$requestMessageHeader = new \DHLBook\StructType\RequestMessageHeader();
$requestMessageHeader->MessageId = sprintf( '%04X%04X-%04X-%04X-%04X-%04X%04X%04X', mt_rand( 0, 65535 ), mt_rand( 0, 65535 ), mt_rand( 0, 65535 ), mt_rand( 16384, 20479 ), mt_rand( 32768, 49151 ), mt_rand( 0, 65535 ), mt_rand( 0, 65535 ), mt_rand( 0, 65535 ) );
$requestMessageHeader->TimeStamp = date( "Y-m-d" ) . 'T' . date( "H:i:s" );
$requestMessageHeader->Environment = 'Book';
$requestMessageHeader->RequestingSystem = 'TestApp';

$general = new \DHLBook\StructType\TGeneral();
$general->PickupDate = date( "Y-m-d" );
$general->CustomerID = 'your customer id';
$general->Note1 = 'Test utför ej';
$general->Note2 = '';
$general->FreightNo = '';
$general->Weight = new \DHLBook\StructType\TWeight();
$general->Weight->unit = 'kg';
$general->Weight->_ = '1';
$general->Volume = new \DHLBook\StructType\TVolume();
$general->Volume->unit = 'm3';
$general->Volume->_ = '';
$general->Loadingmeter = new \DHLBook\StructType\TLoadingmeter();
$general->Loadingmeter->unit = 'm';
$general->Loadingmeter->_ = '';
$general->NoItems = '';
$general->NoPallets = '2';
$general->PalletPlace = new \DHLBook\StructType\TPalletPlace();
$general->PalletPlace->unit = '';
$general->PalletPlace->_ = '';
$general->ProductCode = '401';
$general->Pickup = new \DHLBook\StructType\TPickup();
$general->Pickup->Address = new \DHLBook\StructType\TAddressSE();
$general->Pickup->Address->Name = 'Gränsfors bruks AB';
$general->Pickup->Address->AddressLine = 'Stationsgatan';
$general->Pickup->Address->PostCode = '82077';
$general->Pickup->Address->City = 'Gnarp';
$general->Delivery = new \DHLBook\StructType\TDelivery();
$general->Delivery->Address = new \DHLBook\StructType\TAddressGeneric();
$general->Delivery->Address->Name = 'Testkund';
$general->Delivery->Address->AddressLine = 'Testgatan';
$general->Delivery->Address->PostCode = '56432';
$general->Delivery->Address->City = 'Bankeryd';

$tbook = new \DHLBook\StructType\TBook( $requestMessageHeader, $general, $gBook = null );

if ( $book->BookPickup( new \DHLBook\StructType\BookPickup( $credentials, $tbook ) ) !== false ) {
    print_r( $book->getResult() );
} else {
	print_r( $book->getLastError() );
}
```

### Security

[](#security)

The access to the web service is restricted using Basic Authentication. User and Password are sent as part of the HTTP request body.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2504778?v=4)[Mladen Milentijevic](/maintainers/mladjom)[@mladjom](https://github.com/mladjom)

### Embed Badge

![Health badge](/badges/mladjom-dhlbook/health.svg)

```
[![Health](https://phpackages.com/badges/mladjom-dhlbook/health.svg)](https://phpackages.com/packages/mladjom-dhlbook)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
