Note: This is the specification of the DPDHL Group Parcel DE Shipping API for Post & Parcel Germany. This REST web service allows business customers to create shipping labels on demand.
PHP 7.4 and later. Should also work with PHP 8.0.
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/kruegge82/dhl-php-rest-sdk.git"
}
],
"require": {
"kruegge82/dhl-php-rest-sdk": "*@dev"
}
}
Then run composer install
Download the files and include autoload.php
:
<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new kruegge82\DHL\Api\GeneralApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(['http_errors'=>false])
);
try {
$result = $apiInstance->rootGet();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling GeneralApi->rootGet: ', $e->getMessage(), PHP_EOL;
}
All URIs are relative to https://api-eu.dhl.com/parcel/de/shipping/v2
Class | Method | HTTP request | Description |
---|---|---|---|
GeneralApi | rootGet | GET / | Return API version |
ManifestsApi | getManifests | GET /manifests | Retrieve daily manifest document |
ManifestsApi | manifestsPost | POST /manifests | Mark shipments as being ready for shipping |
ShipmentsAndLabelsApi | createOrders | POST /orders | Create one or more shipments and their documents. (This is the primary call of the API.) |
ShipmentsAndLabelsApi | getLabel | GET /labels | Download PDF document |
ShipmentsAndLabelsApi | getOrder | GET /orders | Retrieve shipment documents - labels and customs documents |
ShipmentsAndLabelsApi | ordersAccountDelete | DELETE /orders | Delete one or more shipments |
- BankAccount
- Commodity
- Consignee
- ContactAddress
- Country
- CustomsDetails
- Dimensions
- Document
- GetManifestData
- LabelDataResponse
- Locker
- MultipleManifestResponse
- POBox
- PostOffice
- RequestStatus
- ResponseItem
- ServiceInformation
- ServiceInformationAmp
- ServiceInformationBackend
- Shipment
- ShipmentDetails
- ShipmentManifestingRequest
- ShipmentOrderRequest
- ShipmentShipper
- Shipper
- ShipperReference
- ShortResponseItem
- SingleManifestResponse
- VAS
- VASCashOnDelivery
- VASDhlRetoure
- VASIdentCheck
- ValidationMessageItem
- Value
- Weight
Authentication schemes defined for the API:
- Type: HTTP basic authentication
- Type: API key
- API key parameter name: dhl-api-key
- Location: HTTP header
- Type:
OAuth
- Flow:
password
- Authorization URL: ``
- Scopes: N/A
To run the tests, use:
composer install
vendor/bin/phpunit