Mottor API
Search…
Доставки
get
https://api.lpmotor.ru
/v1/delivery/site/{site_id}
Получение списка доставок

Пример запроса

CURL
PHP CURL
PHP Guzzle
JavaScript
1
curl \
2
-H "Accept: application/json" \
3
-H "Content-Type: application/json" \
4
-H "X-Api-User-Id: <<Your-user-id>>" \
5
-H "Authorization: Bearer <<Your-API-token>>" \
6
-X GET "https://api.lpmotor.ru/v1/delivery/site/11111"
Copied!
1
Copied!
1
<?php
2
$client = new GuzzleHttp\Client([
3
'base_uri' => 'https://api.lpmotor.ru',
4
'headers' => [
5
'Content-Type' => 'application/json',
6
'Accept' => 'application/json',
7
'X-Api-User-Id' => $userId,
8
'Authorization' => 'Bearer ' . $apiKey,
9
],
10
]);
11
$response = $client->get(
12
'/v1/delivery/site/' . $siteId
13
);
14
$statusCode = $response->getStatusCode();
15
$deliveries = json_decode((string) $response->getBody(), true);
Copied!
1
http = Axios.create({
2
baseURL: "https://api.lpmotor.ru",
3
timeout: 60000,
4
headers: {
5
"Content-Type" : "application/json",
6
"Accept" : "application/json",
7
"Cache-Control": "no-cache, no-store, must-revalidate",
8
"X-Api-User-Id": userId,
9
"Authorization": "Bearer " + myApiKey,
10
}
11
});
12
http.get("/v1/delivery/site/" + siteId);
Copied!
post
https://api.lpmotor.ru
/v1/delivery
Создание доставки

Пример запроса

CURL
PHP CURL
PHP Guzzle
JavaScript
1
curl \
2
-H "Accept: application/json" \
3
-H "Content-Type: application/json" \
4
-H "X-Api-User-Id: <<Your-user-id>>" \
5
-H "Authorization: Bearer <<Your-API-token>>" \
6
-X POST "https://api.lpmotor.ru/v1/delivery" \
7
-d '{"template_id":2,"title":"delivery name","site_id":11111,"enabled":true,"regions":[],"points":[{"title":"test point","comment":"this is comment","enabled":true}],"additional_fields":[{"id":1},{"id":2}]}'
Copied!
1
Copied!
1
<?php
2
$client = new GuzzleHttp\Client([
3
'base_uri' => 'https://api.lpmotor.ru',
4
'headers' => [
5
'Content-Type' => 'application/json',
6
'Accept' => 'application/json',
7
'X-Api-User-Id' => $userId,
8
'Authorization' => 'Bearer ' . $apiKey,
9
],
10
]);
11
$response = $client->post(
12
'/v1/delivery',
13
[
14
'json' => [
15
'template_id' => 2,
16
'site_id' => $siteId,
17
'title' => 'my delivery',
18
'enabled' => true,
19
'regions' => [],
20
'points' => [
21
[
22
'title' => 'test point',
23
'comment' => 'this is comment',
24
'enabled' => true
25
],
26
],
27
'additional_fields' => [
28
['id' => 1],
29
['id' => 2],
30
],
31
],
32
]
33
);
34
$statusCode = $response->getStatusCode();
35
$delivery = json_decode((string) $response->getBody(), true);
Copied!
1
http = Axios.create({
2
baseURL: "https://api.lpmotor.ru",
3
timeout: 60000,
4
headers: {
5
"Content-Type" : "application/json",
6
"Accept" : "application/json",
7
"Cache-Control": "no-cache, no-store, must-revalidate",
8
"X-Api-User-Id": userId,
9
"Authorization": "Bearer " + myApiKey,
10
}
11
});
12
http.post('/v1/delivery', {
13
"template_id": 1,
14
"title": "delivery name",
15
"site_id": 11111,
16
"enabled": true,
17
"regions": [],
18
"points": [
19
{
20
"title": "test point",
21
"comment": "this is comment",
22
"enabled": true
23
}
24
],
25
"additional_fields": [
26
{
27
"id": 1
28
},
29
{
30
"id": 2
31
}
32
]
33
});
Copied!
get
https://api.lpmotor.ru
/v1/delivery/{delivery_id}
Получение доставки по ID

Пример запроса

CURL
PHP CURL
PHP Guzzle
JavaScript
1
curl \
2
-H "Accept: application/json" \
3
-H "Content-Type: application/json" \
4
-H "X-Api-User-Id: <<Your-user-id>>" \
5
-H "Authorization: Bearer <<Your-API-token>>" \
6
-X GET "https://api.lpmotor.ru/v1/delivery/1"
Copied!
1
Copied!
1
<?php
2
$client = new GuzzleHttp\Client([
3
'base_uri' => 'https://api.lpmotor.ru',
4
'headers' => [
5
'Content-Type' => 'application/json',
6
'Accept' => 'application/json',
7
'X-Api-User-Id' => $userId,
8
'Authorization' => 'Bearer ' . $apiKey,
9
],
10
]);
11
$response = $client->get(
12
'/v1/delivery/' . $deliveryId
13
);
14
$statusCode = $response->getStatusCode();
15
$delivery = json_decode((string) $response->getBody(), true);
Copied!
1
http = Axios.create({
2
baseURL: "https://api.lpmotor.ru",
3
timeout: 60000,
4
headers: {
5
"Content-Type" : "application/json",
6
"Accept" : "application/json",
7
"Cache-Control": "no-cache, no-store, must-revalidate",
8
"X-Api-User-Id": userId,
9
"Authorization": "Bearer " + myApiKey,
10
}
11
});
12
http.get("/v1/delivery/" + deliveryId);
Copied!
put
https://api.lpmotor.ru
/v1/delivery
Изменение доставки

Пример запроса

CURL
PHP CURL
PHP Guzzle
JavaScript
1
curl \
2
-H "Accept: application/json" \
3
-H "Content-Type: application/json" \
4
-H "X-Api-User-Id: <<Your-user-id>>" \
5
-H "Authorization: Bearer <<Your-API-token>>" \
6
-X PUT "https://api.lpmotor.ru/v1/delivery" \
7
-d '{"id":1,"title":"new delivery name","enabled":false,"pos":1,"points":[],"regions":[{"id":1,"title":"new region name","enabled":true}]}'
Copied!
1
Copied!
1
<?php
2
$client = new GuzzleHttp\Client([
3
'base_uri' => 'https://api.lpmotor.ru',
4
'headers' => [
5
'Content-Type' => 'application/json',
6
'Accept' => 'application/json',
7
'X-Api-User-Id' => $userId,
8
'Authorization' => 'Bearer ' . $apiKey,
9
],
10
]);
11
$response = $client->put(
12
'/v1/delivery',
13
[
14
'json' => [
15
'id' => 1,
16
'title' => 'my delivery',
17
'enabled' => true,
18
'pos' => 1,
19
'regions' => [
20
[
21
'id' => 1,
22
'title' => 'test point',
23
'comment' => 'this is comment',
24
'enabled' => true
25
],
26
],
27
],
28
]
29
);
30
$statusCode = $response->getStatusCode();
31
$delivery = json_decode((string) $response->getBody(), true);
Copied!
1
http = Axios.create({
2
baseURL: "https://api.lpmotor.ru",
3
timeout: 60000,
4
headers: {
5
"Content-Type" : "application/json",
6
"Accept" : "application/json",
7
"Cache-Control": "no-cache, no-store, must-revalidate",
8
"X-Api-User-Id": userId,
9
"Authorization": "Bearer " + myApiKey,
10
}
11
});
12
http.put('/v1/delivery', {
13
"id": 1,
14
"title": "delivery name",
15
"pos": 1,
16
"enabled": true,
17
"regions": [
18
{
19
"id": 1,
20
"title": "test point",
21
"comment": "this is comment",
22
"enabled": true
23
}
24
],
25
});
Copied!
delete
https://api.lpmotor.ru
/v1/delivery/{delivery_id}
Удаление доставки

Пример запроса

CURL
PHP CURL
PHP Guzzle
JavaScript
1
curl \
2
-H "Accept: application/json" \
3
-H "Content-Type: application/json" \
4
-H "X-Api-User-Id: <<Your-user-id>>" \
5
-H "Authorization: Bearer <<Your-API-token>>" \
6
-X DELETE "https://api.lpmotor.ru/v1/delivery/1"
Copied!
1
Copied!
1
<?php
2
$client = new GuzzleHttp\Client([
3
'base_uri' => 'https://api.lpmotor.ru',
4
'headers' => [
5
'Content-Type' => 'application/json',
6
'Accept' => 'application/json',
7
'X-Api-User-Id' => $userId,
8
'Authorization' => 'Bearer ' . $apiKey,
9
],
10
]);
11
$response = $client->delete(
12
'/v1/delivery/1'
13
);
14
$statusCode = $response->getStatusCode();
Copied!
1
http = Axios.create({
2
baseURL: "https://api.lpmotor.ru",
3
timeout: 60000,
4
headers: {
5
"Content-Type" : "application/json",
6
"Accept" : "application/json",
7
"Cache-Control": "no-cache, no-store, must-revalidate",
8
"X-Api-User-Id": userId,
9
"Authorization": "Bearer " + myApiKey,
10
}
11
});
12
http.delete("/v1/delivery/1");
Copied!
Last modified 3mo ago