Mottor API
Search…
Промокоды
get
https://api.lpmotor.ru
/v1/promo
Получение списка промокодов

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

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/promo?site_id=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/promo',
13
[
14
'query' => [
15
'site_id' => $siteId,
16
]
17
]
18
);
19
$statusCode = $response->getStatusCode();
20
$promoCodes = 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/promo", {
13
params: {
14
site_id: 11111,
15
},
16
});
Copied!
post
https://api.lpmotor.ru
/v1/promo
Создание промокода

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

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/promo" \
7
-d '{"user_id":123,"site_id":11111,"code":"mypromocode"}'
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/promo',
13
[
14
'json' => [
15
'user_id' => $userId,
16
'site_id' => $siteId,
17
'code' => 'mypromocode',
18
],
19
]
20
);
21
$statusCode = $response->getStatusCode();
22
$promoCode = 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/promo', {
13
user_id: 123,
14
site_id: 11111,
15
code: 'mypromocode',
16
});
Copied!
get
https://api.lpmotor.ru
/v1/promo/{promo_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/promo/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/promo/' . $promoId
13
);
14
$statusCode = $response->getStatusCode();
15
$promoCode = 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/promo/" + promoId);
Copied!
put
https://api.lpmotor.ru
/v1/promo/{promo_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 PUT "https://api.lpmotor.ru/v1/promo/1" \
7
-d '{"code":"newpromocode"}'
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/promo/1',
13
[
14
'json' => [
15
'code' => 'newpromocode',
16
],
17
]
18
);
19
$statusCode = $response->getStatusCode();
20
$promoCode = 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/promo/1', {
13
code: 'newpromocode',
14
});
Copied!
delete
https://api.lpmotor.ru
/v1/promo/{promo_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/promo/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/promo/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/promo/1");
Copied!
get
https://api.lpmotor.ru
/v1/promo/{promo_id}/statistics
Получение статистики использования промокода

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

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/promo/1/statistics"
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/promo/1/statistics'
13
);
14
$statusCode = $response->getStatusCode();
15
$statistics = 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/promo/1/statistics");
Copied!
Last modified 3mo ago