Добавлен заказ накладной
This commit is contained in:
+90
-35
@@ -17,45 +17,69 @@ POST http://localhost:8000/api/v1/delivery/order
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"order_uuid": "order-uuid-1",
|
||||
"price": 125000,
|
||||
"type": 2,
|
||||
"tariff_code": 535,
|
||||
"comment": "Тестовая оплата доставки",
|
||||
"sender": {
|
||||
"name": "Петр Петров",
|
||||
"orderUuid": "order-uuid-1",
|
||||
"senderAddress": {
|
||||
"cityId": 1,
|
||||
"city": "Дубай",
|
||||
"street": "Sheikh Zayed Road",
|
||||
"house": "10",
|
||||
"apartment": "201",
|
||||
"zip": "12345",
|
||||
"comment": "Домофон 12"
|
||||
},
|
||||
"senderContact": {
|
||||
"fullName": "Петр Петров",
|
||||
"email": "sender@example.com",
|
||||
"phone": {
|
||||
"number": "+79009876543"
|
||||
}
|
||||
"phone": "+79009876543",
|
||||
"phoneExt": null,
|
||||
"isCompany": false,
|
||||
"companyName": null,
|
||||
"inn": null,
|
||||
"kpp": null
|
||||
},
|
||||
"recipient": {
|
||||
"name": "Иван Иванов",
|
||||
"receiverAddress": {
|
||||
"cityId": 2,
|
||||
"city": "Шарджа",
|
||||
"street": "Al Wahda",
|
||||
"house": "5",
|
||||
"apartment": null,
|
||||
"zip": "54321",
|
||||
"comment": null
|
||||
},
|
||||
"receiverContact": {
|
||||
"fullName": "Иван Иванов",
|
||||
"email": "ivan@example.com",
|
||||
"phone": {
|
||||
"number": "+79001234567"
|
||||
"phone": "+79001234567",
|
||||
"phoneExt": "101",
|
||||
"isCompany": false,
|
||||
"companyName": null,
|
||||
"inn": null,
|
||||
"kpp": null
|
||||
},
|
||||
"content": {
|
||||
"description": "Наушники"
|
||||
},
|
||||
"pickupDate": "2026-05-15T10:00:00.000Z",
|
||||
"deliveryDate": "2026-05-18T18:00:00.000Z",
|
||||
"accountEmail": "client@example.com",
|
||||
"systemData": {
|
||||
"tariff": {
|
||||
"provider": "СДЭК",
|
||||
"serviceName": "Экспресс лайт",
|
||||
"price": 125000,
|
||||
"deliveryDaysMin": 1,
|
||||
"deliveryDaysMax": 2,
|
||||
"tariffCode": 535
|
||||
},
|
||||
"parcelType": "parcel",
|
||||
"docPackaging": null,
|
||||
"weight": "1.0",
|
||||
"dimensions": {
|
||||
"length": "20",
|
||||
"width": "15",
|
||||
"height": "10"
|
||||
}
|
||||
},
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
> {%
|
||||
@@ -66,3 +90,34 @@ Content-Type: application/json
|
||||
GET {{base_url}}/v2/calculator/alltariffs
|
||||
Authorization: Bearer {{auth_token}}
|
||||
X-User-Lang: rus
|
||||
|
||||
### 6. Формирование накладной по заказу
|
||||
POST {{base_url}}/v2/print/orders
|
||||
Authorization: Bearer {{auth_token}}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"orders": [
|
||||
{
|
||||
"order_uuid": "abd93f2d-7c5a-4820-9fdd-cab39aadbb1f"
|
||||
}
|
||||
],
|
||||
"copy_count": 1
|
||||
}
|
||||
|
||||
### 7. Получение накладной по UUID
|
||||
GET {{base_url}}/v2/print/orders/31ff53f5-4c01-43aa-afa2-b7efdf0c06da
|
||||
Authorization: Bearer {{auth_token}}
|
||||
|
||||
### 8. Просмотр заказа CDEK по UUID (с related_entities)
|
||||
GET {{base_url}}/v2/orders/1e2282ba-529e-4ee7-9d82-2d7837145755
|
||||
Authorization: Bearer {{auth_token}}
|
||||
|
||||
### 9. Скачивание готовой квитанции (PDF)
|
||||
# Подставь WAYBILL_UUID из related_entities[type=waybill] (### 8).
|
||||
# Файл сохраняется рядом с http-client.http как waybill.pdf.
|
||||
GET {{base_url}}/v2/print/orders/31ff53f5-4c01-43aa-afa2-b7efdf0c06da.pdf
|
||||
Authorization: Bearer {{auth_token}}
|
||||
Accept: application/pdf
|
||||
|
||||
>>! waybill.pdf
|
||||
|
||||
Reference in New Issue
Block a user