nogrod / dhl-shipping-php-sdk
注意:这是DPDHL集团包裹德国邮政和包裹配送API的规范。此REST Web服务允许企业客户按需创建配送标签。
v0.1.0
2024-02-19 13:32 UTC
Requires
- php: ^8.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.4.5
- guzzlehttp/psr7: ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- overtrue/phplint: ^9.0
- phpunit/phpunit: ^9.0
README
注意:这是DPDHL集团包裹德国邮政和包裹配送API的规范。此REST Web服务允许企业客户按需创建配送标签。
安装和用法
要求
PHP 8.1及以后版本。
Composer
要通过Composer安装绑定,请在composer.json
中添加以下内容:
{ "repositories": [ { "type": "vcs", "url": "https://github.com/nogrod/dhl-shipping-php-sdk.git" } ], "require": { "nogrod/dhl-shipping-php-sdk": "*@dev" } }
然后运行composer install
手动安装
下载文件并包含autoload.php
<?php require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
入门指南
请遵循安装过程,然后运行以下命令:
<?php require_once(__DIR__ . '/vendor/autoload.php'); $apiInstance = new Dhl\Rest\Shipping\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() ); try { $result = $apiInstance->rootGet(); print_r($result); } catch (Exception $e) { echo 'Exception when calling GeneralApi->rootGet: ', $e->getMessage(), PHP_EOL; }
API端点
所有URI均相对于https://api-eu.dhl.com/parcel/de/shipping/v2
模型
- 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
授权
BasicAuth
- 类型:HTTP基本认证
ApiKey
- 类型:API密钥
- API密钥参数名:dhl-api-key
- 位置:HTTP头
测试
要运行测试,请使用
composer install vendor/bin/phpunit
作者
关于此包
此PHP包是由OpenAPI Generator项目自动生成的
- API版本:
2.1.8
- 构建包:
org.openapitools.codegen.languages.PhpNextgenClientCodegen