Все запросы выполняются по адресу:
http://8express.ru
Тестовые запросы возможно выполнять по адресу:
http://dev.8express.ru
Все внесенные данные на тестовый сервер стираются в 00:00 (GMT+3)
Сервер возвращает результат выполнения запроса в формате JSON.
Адрес POST запроса:
/json/mrs/create
Входные параметры:
Имя |
Описание |
Обязательное |
Тип |
key |
API ключ |
да |
string |
orders |
Список накладных |
да |
array |
Каждый элемент списка накладных должен иметь следующие параметры:
Имя |
Описание |
Обязательное |
Тип |
invoice_sender |
Номер накладной |
да |
string |
to_name |
Имя получателя |
да |
string |
to_phone |
Номер телефона получателя |
да |
integer |
to_area |
Регион доставки |
нет |
string |
to_city |
Город доставки |
да |
string |
to_index |
Индекс доставки |
да |
integer |
to_address |
Адрес доставки |
да |
string |
type | Тип отправления. (warehouse — фулфилмент, trainsit — транзит, return — возврат) |
нет | string |
goods |
Список товаров |
да |
array |
Каждый элемент списка товаров должен иметь следующие параметры:
Имя |
Описание |
Обязательное |
Тип |
sku |
Артикул |
да |
string |
description |
Описание |
нет |
string |
weight_fact |
Вес фактический |
да |
float |
count |
Количество |
нет |
integer |
Полный пример кода на PHP:
$base = 'http://demo.8express.ru';
$path = '/json/mrs/create';
$url = $base . $path;
$post = array(
'key' => API_KEY,
'orders' => array(
array(
'invoice_sender' => '0160900341YQ',
'to_name' => 'Ivanov Ivan',
'to_phone' => '89999999999',
'to_area' => 'Moscowskaya oblast',
'to_city' => 'Moscow',
'to_index' => 101000,
'to_address' => 'ul\. Tverskaya, 17-47',
'goods' => array(
'DC0157BL' => array(
'sku' => 'DC0157BL',
'description' => 'сотовый телефон Xiaomi',
'weight_fact' => 0.5,
'count' => 1,
)
)
)
)
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
$result = json_decode($result);
return $result;
Пример ответа на успешный запрос:
{
"success": true,
"result": "MSK0000015090"
}
Пример ответа на запрос с ошибкой:
{
"error": true,
"error_code": 6,
"result": "Name required"
}
Адрес POST запроса:
/json/mrs/getstatus
Входные параметры:
Имя |
Описание |
Обязательное |
Тип |
key |
API ключ |
да |
string |
id |
Номер накладной |
да |
string |
Параметры ответа:
Имя |
Описание |
Тип |
city |
Город |
string |
date |
Дата и время | timestamp |
state_id |
Идентификатор статуса | integer |
Возможные значения параметра state_id:
1 |
Cargo shipped from storage warehouse |
2 |
Invoice created in the system. Cargo expects |
3 |
Cargo accepted for storage |
4 |
Invoice verified. Given to the assembly and shipment |
5 |
Adopted at the transit depot |
6 |
Preparation for shipment to transit warehouse |
7 |
Cargo returned to the transit warehouse |
8 |
Goods in transit |
9 |
Adopted at the issuing warehouse |
10 |
Adopted at the warehouse issuing demand |
11 |
Referred to the courier on delivery |
12 |
Returned to the issuing warehouse |
13 |
The cargo was successfully delivered to the recipient. Thank you for using ourservices |
14 |
The cargo is not delivered to the recipient. Returned to the issuing warehouse |
15 |
The cargo through customs |
16 |
Shipped in Russia |
17 |
Customs clearance is completed |
18 |
Load assembled and ready for shipping |
24 |
The recipient does not answer the call |
25 |
Recipient phone is turned off or is not available |
26 |
Specified the wrong goods |
27 |
You must specify a telephone number |
33 |
The cargo is transferred to the assembly |
Полный пример кода на PHP:
$base = 'http://demo.8express.ru';
$path = '/json/mrs/getstatus';
$url = $base . $path;
$post = array(
'key' => API_KEY,
'iid' => 'KHV0000011437' // array('KHV0000011437', 'KHV0000011438')
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
$result = json_decode($result);
return $result;
Вы можете обновлять накладную отправляя запрос с одним и тем же параметром invoice sender, пока накладная не получит статус 5 — накладная проверена.
Адрес POST запроса:
/json/mrs/storage/balance
Входные параметры:
Имя |
Описание |
Обязательное |
Тип |
key |
API ключ |
да |
string |
Параметры ответа:
Имя |
Описание |
Тип |
sku |
Артикул |
string |
title_ru |
Название на русском языке | timestamp |
title_ch |
Название на китайском языке | integer |
count_received |
Количество принятых | integer |
departed |
Количество отправленных | integer |
balance |
Остаток на складе | integer |
color |
Цвет | string |
size |
Размер | string |
length |
Длина, мм | integer |
width |
Ширина, мм | integer |
height |
Высота, мм | integer |
weight_item |
Вес, кг | float |
status |
Статус груза: waiting — ожидание поступления received — принят |
string |
Полный пример кода на PHP:
$base = 'http://demo.8express.ru';
$path = '/json/mrs/storage/balance';
$url = $base . $path;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
$post = array(
'key' => API_KEY,
);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
$result = json_decode($result);
return $result;
Адрес POST запроса:
/json/mrs/storage/add
Входные параметры:
Имя |
Описание |
Обязательное |
Тип |
key |
API ключ |
да |
string |
storage |
Список артикулов |
да |
array |
Каждый элемент списка артикулов должен иметь следующие параметры:
Имя |
Описание | Обязательное |
Тип |
sku |
Артикул (не должен содержать символ пробела) | да |
string |
title_ru |
Название на русском языке | да | timestamp |
title_ch |
Название на китайском языке | да | integer |
count |
Количество | да | integer |
color |
Цвет | нет | string |
size |
Размер | нет | string |
length |
Длина, мм | нет | integer |
width |
Ширина, мм | нет | integer |
height |
Высота, мм | нет | integer |
weight_item |
Вес, кг | да | float |
Полный пример кода на PHP:
$base = 'http://demo.8express.ru';
$path = '/json/mrs/storage/add';
$url = $base . $path;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
$post = array(
'key' => API_KEY,
'storage' => array(
array(
'sku' => 'QA45ERT',
'count' => 25,
'title_ru' => 'Телефон Meizu',
'title_ch' => '魅族手机',
'weight_item' => 250
),
array(
'sku' => 'AZFDPK',
'count' => 25,
'title_ru' => 'Телефон Xiaomi',
'title_ch' => '小米手机',
'weight_item' => 250
),
)
);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
$result = json_decode($result);
return $result;
На Вашу почту отправлено письмо с новым паролем.
Ваш вопрос отправлен.
Мы ответим на него
в течение 24 часов.
Спасибо за обращение
в нашу компанию.
Наш менеджер свяжется
с Вами в течение
24 часов.