Inpost ShipX PHP SDK
Installation
composer require imper86/php-inpost-api
HTTPlug note
This lib uses HTTPlug
so it doesn't depend on any http client. In order to use this
lib you must have some PSR-18 http client
and PSR-17 http factories.
If you don't know which one you shoud install you can require
these:
composer require php-http/guzzle6-adapter http-interop/http-factory-guzzle
Usage
Using this library is very simple, fast example should be enough
to understand how it works.
use Imper86\PhpInpostApi\InpostApi;
use Imper86\PhpInpostApi\Plugin\AcceptLanguagePlugin;
$token = 'aaaa.aaaa';
$api = new InpostApi($token);
$api->addPlugin(new AcceptLanguagePlugin('pl_PL'));
$api->addressBooks()->(...);
$api->batches()->(...);
$api->dispatchOrders()->(...);
$api->dispatchPoints()->(...);
$api->mpks()->(...);
$api->organizations()->(...);
$api->points()->(...);
$api->sendingMethods()->(...);
$api->services()->(...);
$api->shipments()->(...);
$api->shipmentTemplates()->(...);
$api->statuses()->(...);
$api->tracking()->(...);
var_dump($api->organizations()->shipments()->get('1234'));
If you use IDE with typehinting such as PHPStorm, you'll easily
figure it out. If not, please
take a look in Resource directory
Examples
If you still wonder how to use this lib, checkout example
php scripts:
Contributing
Any help will be very appreciated :)