sonnenglas/mydhl-php-sdk
最新稳定版本:0.3.2
Composer 安装命令:
composer require sonnenglas/mydhl-php-sdk
包简介
Unofficial PHP SDK for MyDHL REST API (DHL Express)
README 文档
README
PHP library for using DHL Express REST API (MyDHL API).
Note: It supports only the latest REST API provided by DHL. No SOAP API support.
Supported services:
| Service | Supported |
|---|---|
| RATING | |
| Retrieve Rates for a one piece Shipment | ✅ |
| Retrieve Rates for Multi-piece Shipments | ❌ |
| Landed Cost | ❌ |
| PRODUCT | |
| Retrieve DHL Express products | ❌ |
| SHIPMENT | |
| Electronic Proof of Delivery | ❌ |
| Upload updated customs docs for shipment | ❌ |
| Create Shipment | ✅ |
| Upload Commercial Invoice Data for shipment | ❌ |
| TRACKING | |
| Track a single DHL Express Shipment | ❌ |
| Tracka single or multiple DHL Express Shipments | ❌ |
| PICKUP | |
| Cancel a DHL Express pickup booking request | ❌ |
| Update pickup information for existing pickup booking req | ❌ |
| Create a DHL Express pickup booking request | ❌ |
| IDENTIFIER | |
| Service to allocate identifiers upfront ... | ❌ |
| ADDRESS | |
| Validate DHL Express pickup/delivery capability | ❌ |
| INVOICE | |
| Upload Commercial Invoice data | ❌ |
Usage:
diff
Retrieve rates
use Sonnenglas\MyDHL\MyDHL; use Sonnenglas\MyDHL\ValueObjects\RateAddress; use Sonnenglas\MyDHL\ValueObjects\Package; $testMode = true; $myDhl = new MyDHL('username', 'password', $testMode); $rateService = $myDhl->getRateService(); $originAddress = new RateAddress( countryCode: 'DE', postalCode: '10117', cityName: 'Berlin', ); $destinationAddress = new RateAddress( countryCode: 'DE', postalCode: '20099', cityName: 'Hamburg', ); $package = new Package( weight: 10, // kg height: 20, // cm length: 10, // cm width: 30, // cm ); $shippingDate = new DateTimeImmutable('2021-01-15 12:00:00'); $rates = $rateService->setAccountNumber('99999999') ->setOriginAddress($originAddress) ->setDestinationAddress($destinationAddress) ->setPlannedShippingDate($shippingDate) ->setPackage($package) ->setNextBusinessDay(false) ->setCustomsDeclarable(false) ->getRates();
All usage examples:
统计信息
- 总下载量: 36.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-01-14