Docs menu
POST
/tour-planning
API tạo tour planning cho đối tác sử dụng
Path
POST
/api/v1/partners/tour-planningAuthentication required
api-keytokencurl example
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"
}
]
}'Parameters
This endpoint takes no parameters.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| tourPlanOption | object[] | Yes | |
| offers | object[] | Yes | |
| requests | object[] | Yes |
Fields of tourPlanOption
| Field | Type | Required | Description |
|---|---|---|---|
| delivery_mode | 1 | 2 | 3 | 4 | Yes | 1: normal, 2: same day delivery, 3: express 2H delivery, 4: 4H delivery |
| kindOfPlan | 1 | 2 | Yes | 1: actual planning, 2: plan in advance |
| tour_mode | string | Yes | 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_mode | 1 | 2 | 3 | 20 | 50 | 100 | Yes | 1: last mile, 2: first mile, 3: pickup and drop, 20: mid mile |
Fields of offers
| Field | Type | Required | Description |
|---|---|---|---|
| registration_number | string | Yes | |
| resource_id | number | Yes | |
| from_address | string | Yes | |
| from_lat | number | Yes | |
| from_lon | number | Yes | |
| from_working_time | string (date-time) | Yes | |
| handling_unit_ids | string[] | No | |
| height_of_vehicle | number | Yes | |
| length_of_vehicle | number | Yes | |
| width_of_vehicle | number | Yes | |
| vehicle_tonnage | number | No | |
| to_address | string | No | |
| to_lat | number | No | |
| to_lon | number | No | |
| to_working_time | string (date-time) | Yes | |
| member_id | string | No | |
| offer_kind | 1 | 2 | 3 | No | Offer kind (1: theo tuyến, 2: theo thời gian) |
Fields of requests
| Field | Type | Required | Description |
|---|---|---|---|
| order_id | string | Yes | |
| handling_unit_id | number | Yes | |
| service_id | number | Yes | |
| resource_id | number | No | |
| distance | number | No | |
| drop_address | string | Yes | |
| drop_lat | number | Yes | |
| drop_lon | number | Yes | |
| drop_wid | number | No | Drop ward id |
| pickup_address | string | Yes | |
| pickup_lat | number | Yes | |
| pickup_lon | number | Yes | |
| pickup_wid | number | No | Pickup ward id |
| pickup_date_time | string (date-time) | Yes | |
| pickup_date_time_to | string (date-time) | Yes | |
| drop_date_time | string (date-time) | Yes | |
| drop_date_time_to | string (date-time) | Yes | |
| loading_time | number | No | Tổng số phút cho việc chất hàng lên xe |
| unloading_time | number | No | Tổng số phút cho việc dở hàng khỏi xe |
| rlength | number | Yes | |
| rwidth | number | Yes | |
| rheight | number | Yes | |
| rweight | number | Yes | |
| count_of_parcels | number | Yes | |
| sender_name | string | Yes | |
| sender_phone | string | Yes | |
| receiver_name | string | Yes | |
| receiver_phone | string | Yes |
3 fieldsBulkInsertRequestDto
Responses
201