Описание
, (*1)
PHP класс для работы с почтой Intime, (*2)
Документация
Інструкція по інтеграції з веб- сервісами Ін-Тайм. API 3.1, (*3)
Требование
Composer
composer require jackmartin/api3intime
Библиотеки
- Soap-Guzzle
Методы API
- Настройка подключения
- Получить список стран
- Получить информацию о стране по ID
- Получить список областей
- Получить информацию о областе по ID
- Получить список областей по фильтру
- Получить список районов
- Получить информацию о районе по ID
- Получить список районов по фильтру
- Получение список населенных пунктов
- Получить информацию о населенным пункте по ID
- Получить список населенных пунктов по фильтру
- Получение список складов / почтоматов
- Получить информацию о складе / почтомате по ID
- Получить список складов / почтоматов по фильтру
- Получить список описаний груза
- Получить описание груза по ID
- Получить список упаковок
- Получить упаковку по ID
- Создать заявку ТТН
- Получить список графика работы складов
- Получить график работы склада по ID
- Получить список историй ТТН
- Получить информацию ТТН
Пример
__construct()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
// $intime = new InTime3('API_KEY', true, false, 30, 30);
// $intime = new InTime3('API_KEY', true, false);
getCountryList()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
//$intime = new InTime3('API_KEY', false); print data stdclass format
//$intime = new InTime3('API_KEY', false, true); debug mode
print_r($intime->getCountryList());
//{"Entry_get_country_by_id":[{"id":"213","name_ua":"УЕЛЬС","name_en":"WALES","name_ru":"УЭЛЬС","short_name_ua":"УЕЛЬС","short_name_en":"WALES","short_name_ru":"УЭЛЬС","code":"000000213","last_change":"2017-08-30T21:04:00.000+03:00","status":"1"},{"id":"214","name_ua":"УЗБЕКИСТАН","name_en":"UZBEKISTAN","name_ru":"УЗБЕКИСТАН","short_name_ua":"УЗБЕКИСТАН","short_name_en":"UZBEKISTAN","short_name_ru":"УЗБЕКИСТАН","code":"000000214","last_change":"2017-05-11T21:10:00.000+03:00","status":"1"}
getCountryId($id)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getCountryId(213));
getAreaList()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getAreaList());
getAreaId($id)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getAreaId(1));
getAreaFilter($data = array())
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getAreaFilter(array(
// 'id' => 1,
'area_name' => 'В',
// 'country_id' => '215',
)));
getDistrictList()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getDistrictList());
getDistrictId($id)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getDistrictId(241));
getDistrictFilter($data = array())
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getDistrictFilter(array(
// 'id' => '241',
// 'country_id' => '215',
'district_name' => 'Бере',
)));
getLocalityList()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_key');
print_r($intime->getLocalityList());
getLocalityId($id)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getLocalityId(100));
getLocalityFilter($data = array())
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getLocalityFilter(array(
// 'id' => 328,
// 'country_id' => 215,
// 'area_id' => 14,
'district_id' => 416,
// 'locality_name' => 'Сково',
)));
getBranchList()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getBranchList());
getBranchId($id)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getBranchId(328));
getBranchFilter($data = array())
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getBranchFilter(array(
// 'id' => 328,
// 'country_id' => 215,
// 'area_id' => 15,
// 'district_id' => 40,
// 'locality_id' => 39,
'branch_name' => 'Воло',
)));
getGoodsDescList()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getGoodsDescList());
getGoodsDescId($id)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getGoodsDescList());
getBoxList()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getBoxList());
getBoxId($id)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getBoxId(50));
declarationCreate($data = array())
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r(
$intime->declarationCreate(
[
...
]
)
);
getBranchWorkList()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getBranchWorkList());
getBranchWorkId($id)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getBranchWorkId(200));
declStatus($number)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->declStatus('NUMBER_TTN'));
getTTN($number)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getTTN('NUMBER_TTN'));