PHP code example of korbeil / dhl-express-php-api

1. Go to this page and download the library: Download korbeil/dhl-express-php-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

korbeil / dhl-express-php-api example snippets


// $client contains all the methods to interact with the API
$clientFactory = new Korbeil\DHLExpress\ClientFactory($dhlExpressUrl, $dhlExpressUsername, $dhlExpressPassword);
$client = $clientFactory->getClient();

$pickupRequest = new Korbeil\DHLExpress\Api\Model\SupermodelIoLogisticsExpressPickupRequest();
// ... fill your request contents

$response = $client->expApiPickups($pickupRequest);
$trackingNumbers = $response->getDispatchConfirmationNumbers();

$testClient = $clientFactory->getMockClient();