Files
g2s-aggregator/http-client.http
T
2026-04-05 00:05:28 +03:00

78 lines
1.8 KiB
HTTP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
### 1. Получение токена авторизации CDEK
POST {{base_url}}/v2/oauth/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id={{client_id}}&client_secret={{client_secret}}
> {%
client.global.set("auth_token", response.body.access_token);
%}
### 2. Получение информации о заказе по номеру СДЭК
GET {{base_url}}/v2/orders?cdek_number=10240410458
Authorization: Bearer {{auth_token}}
### 3. Регистрация заказа (тип "доставка", до двери)
POST {{base_url}}/v2/orders
Authorization: Bearer {{auth_token}}
Content-Type: application/json
{
"type": 2,
"tariff_code": 535,
"comment": "Тестовый заказ",
"sender": {
"name": "Петр Петров",
"email": "sender@example.com",
"phones": [
{
"number": "+79009876543"
}
]
},
"recipient": {
"name": "Иван Иванов",
"email": "ivan@example.com",
"phones": [
{
"number": "+79001234567"
}
]
},
"from_location": {
"address": "ул. Ленина, 1",
"city": "Москва",
"country_code": "RU"
},
"to_location": {
"address": "ул. Пушкина, 10",
"city": "Новосибирск",
"country_code": "RU"
},
"services": [
{
"code": "INSURANCE",
"parameter": "1000"
}
],
"packages": [
{
"number": "1",
"weight": 1000,
"length": 20,
"width": 15,
"height": 10,
"comment": "Упаковка 1"
}
]
}
> {%
client.global.set("order_uuid", response.body.entity.uuid);
%}
### 5. Список доступных тарифов
GET {{base_url}}/v2/calculator/alltariffs
Authorization: Bearer {{auth_token}}
X-User-Lang: rus