016 add creating order to adapter

This commit is contained in:
Раис Юсупалиев
2026-03-14 03:54:55 +03:00
parent 66beab4682
commit 15a17be4ed
12 changed files with 607 additions and 12 deletions
+73
View File
@@ -0,0 +1,73 @@
### 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": {
"company": "ООО Ромашка",
"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);
%}