Files
g2s-aggregator/http-client.http
T

69 lines
1.7 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 http://localhost:8000/api/v1/delivery/init-payment
Content-Type: application/json
{
"order_uuid": "order-uuid-1",
"price": 125000,
"type": 2,
"tariff_code": 535,
"comment": "Тестовая оплата доставки",
"sender": {
"name": "Петр Петров",
"email": "sender@example.com",
"phone": {
"number": "+79009876543"
}
},
"recipient": {
"name": "Иван Иванов",
"email": "ivan@example.com",
"phone": {
"number": "+79001234567"
}
},
"from_location": {
"address": "ул. Ленина, 1",
"city": "Москва",
"country_code": "RU"
},
"to_location": {
"address": "ул. Пушкина, 10",
"city": "Новосибирск",
"country_code": "RU"
},
"packages": [
{
"number": "1",
"weight": 1,
"length": 20,
"width": 15,
"height": 10,
"comment": "Упаковка 1"
}
]
}
> {%
client.global.set("payment_url", response.body.payment_url);
%}
### 5. Список доступных тарифов
GET {{base_url}}/v2/calculator/alltariffs
Authorization: Bearer {{auth_token}}
X-User-Lang: rus