Chuyển đến nội dung chính
Mục lục tài liệu
POST

/tour-planning

API tạo tour planning cho đối tác sử dụng

Mở trong ChatGPTMở trong Claude

Đường dẫn

POST/api/v1/partners/tour-planning
Xác thực yêu cầuapi-keytoken

Ví dụ gọi bằng curl

curl -X POST "https://api.route4green.com/api/v1/partners/tour-planning" \
  -H "api-key: YOUR_API_KEY" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "content-type: application/json" \
  -d '{
  "tourPlanOption": [
    {
      "delivery_mode": {},
      "kindOfPlan": {},
      "tour_mode": "string",
      "transport_mode": {}
    }
  ],
  "offers": [
    {
      "registration_number": "string",
      "resource_id": 0,
      "from_address": "string",
      "from_lat": 0,
      "from_lon": 0,
      "from_working_time": "2026-01-01T00:00:00+07:00",
      "handling_unit_ids": [
        "string"
      ],
      "height_of_vehicle": 0,
      "length_of_vehicle": 0,
      "width_of_vehicle": 0,
      "vehicle_tonnage": 0,
      "to_address": "string",
      "to_lat": 0,
      "to_lon": 0,
      "to_working_time": "2026-01-01T00:00:00+07:00",
      "member_id": "string",
      "offer_kind": {}
    }
  ],
  "requests": [
    {
      "order_id": "string",
      "handling_unit_id": 0,
      "service_id": 0,
      "resource_id": 0,
      "distance": 0,
      "drop_address": "string",
      "drop_lat": 0,
      "drop_lon": 0,
      "drop_wid": 0,
      "pickup_address": "string",
      "pickup_lat": 0,
      "pickup_lon": 0,
      "pickup_wid": 0,
      "pickup_date_time": "2026-01-01T00:00:00+07:00",
      "pickup_date_time_to": "2026-01-01T00:00:00+07:00",
      "drop_date_time": "2026-01-01T00:00:00+07:00",
      "drop_date_time_to": "2026-01-01T00:00:00+07:00",
      "loading_time": 0,
      "unloading_time": 0,
      "rlength": 0,
      "rwidth": 0,
      "rheight": 0,
      "rweight": 0,
      "count_of_parcels": 0,
      "sender_name": "string",
      "sender_phone": "string",
      "receiver_name": "string",
      "receiver_phone": "string"
    }
  ]
}'

Tham số

Endpoint này không nhận tham số.

Nội dung gửi lên

TrườngKiểuBắt buộcMô tả
tourPlanOptionobject[]Có
offersobject[]Có
requestsobject[]Có

Các trường của tourPlanOption

TrườngKiểuBắt buộcMô tả
delivery_mode1 | 2 | 3 | 4Có1: normal, 2: same day delivery, 3: express 2H delivery, 4: 4H delivery
kindOfPlan1 | 2Có1: actual planning, 2: plan in advance
tour_modestringCóOptimization mode: 6 param separate by semicolon 1: minimize total distance, 2: minimize vehicle count, 3: balance workload across vehicles, 4: prioritize time windows, 5: require an available driver, 6: time-limited route as an integer count of minutes (not a flag). Positions 1-5 are 0/1 flags.
transport_mode1 | 2 | 3 | 20 | 50 | 100Có1: last mile, 2: first mile, 3: pickup and drop, 20: mid mile

Các trường của offers

TrườngKiểuBắt buộcMô tả
registration_numberstringCó
resource_idnumberCó
from_addressstringCó
from_latnumberCó
from_lonnumberCó
from_working_timestring (date-time)Có
handling_unit_idsstring[]Không
height_of_vehiclenumberCó
length_of_vehiclenumberCó
width_of_vehiclenumberCó
vehicle_tonnagenumberKhông
to_addressstringKhông
to_latnumberKhông
to_lonnumberKhông
to_working_timestring (date-time)Có
member_idstringKhông
offer_kind1 | 2 | 3KhôngOffer kind (1: theo tuyến, 2: theo thời gian)

Các trường của requests

TrườngKiểuBắt buộcMô tả
order_idstringCó
handling_unit_idnumberCó
service_idnumberCó
resource_idnumberKhông
distancenumberKhông
drop_addressstringCó
drop_latnumberCó
drop_lonnumberCó
drop_widnumberKhôngDrop ward id
pickup_addressstringCó
pickup_latnumberCó
pickup_lonnumberCó
pickup_widnumberKhôngPickup ward id
pickup_date_timestring (date-time)Có
pickup_date_time_tostring (date-time)Có
drop_date_timestring (date-time)Có
drop_date_time_tostring (date-time)Có
loading_timenumberKhôngTổng số phút cho việc chất hàng lên xe
unloading_timenumberKhôngTổng số phút cho việc dở hàng khỏi xe
rlengthnumberCó
rwidthnumberCó
rheightnumberCó
rweightnumberCó
count_of_parcelsnumberCó
sender_namestringCó
sender_phonestringCó
receiver_namestringCó
receiver_phonestringCó
3 trườngBulkInsertRequestDto

Kết quả trả về

201

Về nhóm: Lập kế hoạch chuyến

POST /tour-planning | Route4Green