PHPackages                             jackbayliss/laravel-dhl-api - 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. jackbayliss/laravel-dhl-api

ActiveLibrary[API Development](/categories/api)

jackbayliss/laravel-dhl-api
===========================

DHL XML Wrapper for Laravel

v1(5y ago)35.3k1MITPHPPHP &gt;=7.0.0

Since Jul 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/jackbayliss/laravel-dhl-api)[ Packagist](https://packagist.org/packages/jackbayliss/laravel-dhl-api)[ RSS](/packages/jackbayliss-laravel-dhl-api/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Laravel DHL XML API
===================

[](#laravel-dhl-xml-api)

I needed a DHL wrapper so I could efficiently provide courier quotes to customers- I did find one. But, it needed to be adjusted to work for my needs- this is effectively the edited version to provide Quotes, Routing and Tracking.

Getting Started
---------------

[](#getting-started)

### Prerequisites

[](#prerequisites)

This should work fine on Laravel&gt;=5.7.28, if your version of Laravel does not support auto linking you will need to add `\jackbayliss\DHLApi\DHLAPIProvider::class` into your providers array located in `config/app.php`

### Installing

[](#installing)

`composer require jackbayliss/laravel-dhl-api`

Usage Examples
--------------

[](#usage-examples)

### Config setup

[](#config-setup)

In order to use the wrapper you'll need to setup a few things in your Config.php file- or alternatively you .env file if you don't want to use the config.

You'll need to set `from_country_code`,`from_post_code`,`account_number`,`siteid`,`password` in your config

or alternatively set `DHL_SITEID`,`DHL_PASSWORD`,`DHL_ACCOUNT_NUMBER`, `DHL_FROM_COUNTRYCODE`,`DHL_FROM_POSTCODE` in your `.env` don't forget to edit the config to be null for all the entries.

### Quotation

[](#quotation)

This is typically used to get shipping quotes, as well as the time for transit etc.

```
$quote = new \jackbayliss\DHLApi\Calls\GetQuote();
$quote->declaredValue(10)->reference("0999999999990393939333333333")
->currency("GBP")->toCountryCode("DE")->toPostalCode("91056")->setPieces([
 array("height" => 10,"width" => 10 ,"depth" => 2,"weight" => 0.5)
]);

$quote->getResponse();
```

### Tracking

[](#tracking)

Self explanitory- it'll track a parcel for you.

```
 $tracking = new \jackbayliss\DHLApi\Calls\GetTracking();
 $tracking = $tracking->reference("0999999999990393939333333333")->trackingNumber("8564385550");
 $tracking->getResponse();
```

### Routing

[](#routing)

Used to provide routing information about a parcel to a particular address.

```
$routing = new  \jackbayliss\DHLApi\Calls\GetRouting();

$routing = $routing->reference("0999999999990393939333333333")->address([
'RegionCode' => 'EU',
'RequestType' => 'O',
'Address1'  => 'Oracle Parkway,',
'Address2' => 'Thames Valley Park (TVP)',
'Address3' => 'Berkshire',
'PostalCode' => 'RG6 1RA',
'City' => 'Reading',
'Division' => 'RE',
'CountryCode' => 'GB',
'CountryName' => 'United Kingdom',
'OriginCountryCode' => 'GB'
]);

$routing->getResponse();
```

Methods
-------

[](#methods)

These methods can be linked to any of the above core API classes.

`getResponse()` - This will execute the cURL request and return the XML data as an `Object`.

`getRawResponse()` - This will return the XML response from the DHL API as A `String`.

`toXML()` - This will return the XML you sent to the DHL API as A `String`.

Authors
-------

[](#authors)

- **Jack Bayliss** - *Adjustments to make it work ^^* - [Jack Bayliss](https://github.com/jackbayliss)
- **Duwayne Brown** - *(old repo)* - [MisterBrownRSA](https://github.com/MisterBrownRSA)

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2171d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/79e2e2281e64b7800db09d468ce14156b604138636efd6f85c7b6b8d2f0994b7?d=identicon)[jackbayliss](/maintainers/jackbayliss)

---

Top Contributors

[![jackbayliss](https://avatars.githubusercontent.com/u/13621738?v=4)](https://github.com/jackbayliss "jackbayliss (4 commits)")

---

Tags

apidhllaravelphplaraveldhl xmldhml xml api

### Embed Badge

![Health badge](/badges/jackbayliss-laravel-dhl-api/health.svg)

```
[![Health](https://phpackages.com/badges/jackbayliss-laravel-dhl-api/health.svg)](https://phpackages.com/packages/jackbayliss-laravel-dhl-api)
```

###  Alternatives

[joisarjignesh/bigbluebutton

BigBlueButton Server API Library for Laravel

162151.8k1](/packages/joisarjignesh-bigbluebutton)[jeroen-g/flickr

Modern PHP package to make Flickr API calls. Ships with Laravel implementation.

2562.1k2](/packages/jeroen-g-flickr)[octw/aramex

A Library to integrate with Aramex APIs

2926.2k](/packages/octw-aramex)[exlo89/laravel-sevdesk-api

A helpful Sevdesk API client for Laravel.

1117.7k](/packages/exlo89-laravel-sevdesk-api)[dystcz/lunar-api

Dystore API layer for Lunar e-commerce package

411.2k3](/packages/dystcz-lunar-api)[yxx/laravel-quick

agile development

145.5k](/packages/yxx-laravel-quick)

PHPackages © 2026

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