Skip to navigation

3. Build trips (web)

Put FTLs on a truck as outbound and return stops in the Mile web app

A trip is the work for one truck. You build it in the Mile web app from FTLs you already created, through the API or in the web app. Then you read it through the API.

Need to create trips, optimize them or assign them to transporters through the API? Contact Mile support and we will enable it for your account.

Build a trip in the web app

1

Create the FTLs

Create each FTL first. Its created_on sets the pickup day and its expected_on the delivery day.

2

Create a trip

In the Mile web app, open the FTL Trips menu and create a trip.

3

Add the FTLs as stops

Each stop carries one FTL. For each stop, enter:

What you enterRule
LegOutbound (default) or Return. A trip with a return stop is a round trip
Pickup from, pickup toThe pickup window, as times. The day is the FTL’s created_on. Pickup to defaults to pickup from
Delivery from, delivery toThe delivery window, as times. The day is the FTL’s expected_on. Delivery from defaults to the pickup time, delivery to defaults to delivery from

Each window must end on or after it starts, and the delivery must not start before the pickup. To pick up on another day, change the FTL’s created_on, not the stop.

4

Optimize the route

Click Optimize and save sequence. Mile orders the stops and calculates the ETA plan. Stop times do not change. Mile also re-optimizes after every change made through the API.

5

Choose who drives

Assign your own driver, through the API or the web app. Or outsource the trip to a transporter in the web app. Not both.

A new trip has status null until a driver is assigned. See trip statuses.

Outbound and round trips

One outbound stop: pick up a full container at the port between 10:00 and 11:00, and deliver it to the factory between 12:00 and 14:00.

Trip rules

  • An FTL can be on one trip only. It can be on both legs of the same trip, but only once per leg. To move it, remove its stop from the other trip first.
  • Return stops come after the outbound deliveries. Every return pickup must be on or after the latest outbound delivery start on the trip.
  • Once a trip is outsourced to a transporter, you cannot add stops until you take it back.
  • A trip can change until it starts. See when a trip can change.

Where the truck picks up

FTLPickup point
pickup_from_port is not true and the customer has coordinatesThe customer’s address
OtherwiseThe FTL’s warehouse if it has one, else its destination_port

The container is always delivered to the consignee.

Read the trip through the API

Once the trip is saved, it appears in list trips. Get a trip returns it in full. The response is shortened here.

curl "https://lastmile.milenow.com/index.php/api/v1/partners/shipment-trips/412" \
-H "Authorization: Bearer $MILE_TOKEN"
{
"status": 200,
"msg": "Shipment trip fetched successfully",
"msgs": [],
"data": {
"id": 412,
"type": "round_trip",
"status": null,
"outbound_stops": 1,
"return_stops": 1,
"driver": null,
"partner": null,
"offer": null,
"busy_from": "2026-11-03 09:30:00",
"busy_to": "2026-11-03 17:41:00",
"stops": [
{
"order_id": 70003943807,
"tracking_no": "MSKU4821736",
"leg": "outbound",
"stop_no": 1,
"pickup_sequence": 1,
"delivery_sequence": 2,
"status": { "id": 1, "name": "Scheduled" },
"pickup": { "address": "Jiddah", "from": "2026-11-03 10:00:00", "to": "2026-11-03 11:00:00" },
"delivery": { "name": "Coastal Trading Factory", "address": "South Industrial Area, Jeddah", "from": "2026-11-03 12:00:00", "to": "2026-11-03 14:00:00" },
"eta": "2026-11-03 12:09:00",
"shipment": { "id": 301, "shipment_no": "SHP-1001" }
},
{
"order_id": 70003943808,
"tracking_no": "MSKU4821736-2",
"leg": "return",
"stop_no": 1,
"pickup_sequence": 3,
"delivery_sequence": 4,
"status": { "id": 1, "name": "Scheduled" },
"pickup": { "address": "South Industrial Area, Jeddah", "from": "2026-11-03 15:00:00", "to": "2026-11-03 16:00:00" },
"delivery": { "name": "Jeddah Port Empty Depot", "address": "Jeddah Islamic Port, Jeddah", "from": "2026-11-03 16:30:00", "to": "2026-11-03 18:00:00" },
"eta": "2026-11-03 16:28:00",
"shipment": { "id": 302, "shipment_no": "SHP-1002" }
}
],
"eta": { "busy_from": "2026-11-03 09:30:00", "busy_to": "2026-11-03 17:41:00", "total_km": 80, "late": false, "days": [] }
}
}
FieldMeaning
idThe trip id. Use it in every later call
driver, partner, offerWho runs the trip: your driver, the transporter it is outsourced to, or the latest offer
typeround_trip when there is a return stop, else outbound
statusnull until a driver is assigned. See trip statuses
stops[].order_idThe stop id. Use it to remove the stop
stops[].stop_noPosition within its leg, in the order you added stops
stops[].pickup_sequence, delivery_sequencePosition in the optimized route. Pickups and deliveries share one numbering
stops[].etaEstimated arrival at the consignee
etaThe ETA plan, day by day
busy_from, busy_toWhen the truck is busy with this trip. Used for driver clashes

Next: manage stops.