PRODUCT

One API Call to Route a Mixed Fleet: Our Multi-Modal VRP Is Now Open

November 9, 2026Updated November 10, 2026
One API Call to Route a Mixed Fleet: Our Multi-Modal VRP Is Now Open

Most vehicle routing APIs assume every vehicle is a truck. Plenty of freight doesn't work that way: a planner in Rotterdam can have trucks, a barge and a rail slot in the same day's work, and each moves at a different speed, reaches different places and is limited by different things.

Our solver has handled that inside Transportial for a while. It is now available on its own, as POST /vrp/solve. You send the whole problem in one request and get the tours back. You don't need any orders, vehicles or locations in Transportial, and the call stores nothing.

What you send

At its simplest, three lists and some options: locations, vehicles and shipments (the field also accepts shipments). A shipment is a pickup and a delivery that the same vehicle must serve, in that order. This is a truck and a barge leaving the same port:

{
  "locations": [
    { "id": "rotterdam", "lat": 51.9244, "lon": 4.4777, "transportModes": ["inlandWaterway"] },
    { "id": "duisburg", "lat": 51.4344, "lon": 6.7623, "transportModes": ["inlandWaterway"] },
    { "id": "utrecht", "lat": 52.0907, "lon": 5.1214, "transportModes": [] }
  ],
  "vehicles": [
    { "id": "truck-1", "startLocationId": "rotterdam", "capacity": { "weightKg": 24000 } },
    { "id": "barge-1", "startLocationId": "rotterdam", "transportMode": "inlandWaterway", "capacity": { "weightKg": 2000000 } }
  ],
  "shipments": [
    { "id": "pallets", "pickup": { "locationId": "rotterdam" }, "delivery": { "locationId": "utrecht" }, "load": { "weightKg": 8000 } },
    { "id": "steel", "pickup": { "locationId": "rotterdam" }, "delivery": { "locationId": "duisburg" }, "load": { "weightKg": 900000 } }
  ]
}

The steel is far too heavy for the truck. Utrecht has an empty transportModes list, so only road reaches it. The solver sends each shipment to the only vehicle that can take it, and with more shipments it decides who carries what and in which order.

The whole fleet, not just trucks

A plan a dispatcher can actually use has to know who drives and what they pull. So the request takes all of it, and the planner decides per tour.

chauffeurs have availability, certificates, a license, languages, customers they may not visit, and a driving-time clock of their own. Send what someone has already driven this week and the plan starts from there. Every tour gets a driver who can legally do it, and the search moves drivers between tours as it goes, so it does not promise three ADR tours with two ADR drivers.

transportEquipments are your trailers. Couple them to a vehicle, or leave them free and a tractor takes the one that suits the goods: the right type, attributes and temperature range, available for the whole tour, and fetched first if it stands somewhere else.

Shipments carry dangerous goods, with the ADR 1.1.3.6 points added up over each tour. Locations have opening hours per weekday and limits on what fits. Everything can be set to block, warn or off, so the plan matches how strict you want to be.

What makes it multi-modal

Each vehicle has one mode and drives one tour, and three things change with that mode.

Travel times

Every mode has its own travel data. You can send a matrix per mode, from your own routing engine or sailing schedules. A mode without one is estimated from the straight-line distance with a detour factor and average speed: 13 km/h and a 1.3 detour for a barge by default, against 80 km/h and a 1.3 detour for a truck. Estimates are never silent, because the response names them in warnings.

Where a vehicle can go

A location can list the non-road modes that reach it, which is how a quay or rail terminal differs from a warehouse. A barge only gets shipments between places on the water. Road reaches everywhere.

What fills up first

A truck can run out of weight, loading meters or volume. Water and rail are checked on weight, and air on chargeable weight and volume.

Your fleet or a carrier

Most fleets also buy capacity. Add capacityContracts and the solver can give work to a carrier instead of your own truck, or buy in trailers and drivers. A contract has its purchased units and its pricingModules, the same pricing modules a capacity contract has inside Transportial:

{
  "id": "carrier-a",
  "startLocationId": "rotterdam",
  "purchasedUnits": 2,
  "capacity": { "weightKg": 24000 },
  "pricingModules": [
    { "type": "fixed", "amount": 60, "targetEntityType": "trip" },
    { "type": "unit", "unit": "mile", "amount": 0.45 }
  ]
}

Your own vehicles, trailers and chauffeurs can carry pricing modules as well. With the minimize_cost objective, the solver reads the rates from those modules and weighs each contract against what your own fleet costs. Every tour comes back with the contract it runs on and its expected cost.

A contract can also say what the carrier really does. capability holds its lanes, service areas, goods, equipment, temperature range, operating hours and notice period, so work only goes to carriers that can take it. A contract without one is unrestricted.

How it searches

The default search, large_neighborhood_search, starts with a nearest-neighbor plan, then repeatedly tears out part of it and rebuilds it with greedy and regret insertion, using simulated-annealing acceptance so it can escape a local optimum. It also retries shipments the first plan could not place. The alternative, atomic_search, improves the first plan with moves between tours (relocating, swapping, merging and splitting) and 2-opt within a tour until none helps.

Both respect time windows, waiting at a stop when the vehicle arrives early, and both stop when your time budget runs out, up to ten seconds. Shipments that didn't make it are returned with a reason, so nothing disappears quietly.

Trains and ships in the same plan

Add scheduleRoutes and a shipment can leave the road: truck to a terminal, a train, barge, ship or aircraft, and a truck to the door. Departures have cut-offs and capacity, and what is already booked counts. The road legs follow the same rules as any other tour. Keep your services on the platform and one option, useStoredScheduleRoutes, plans over those too.

Plan around what is already moving

Orders rarely arrive before the trucks have left. Send existingTrips and new shipments are combined with the trips you already have. Each trip brings its vehicle, crew, equipment and stops. Stops already done stay put, the tour carries on from the last one, and what is on board keeps its room. Per trip you choose whether the planner may only add stops or may also reorder the open ones. Work already on a trip is never dropped.

Added since launch

The same request now also takes the things that usually break a plan in the yard:

  • Compartments on vehicles and trailers, for multi-temperature, tank and food-grade loads.
  • Dock capacity per location, with periods that are already taken.
  • Empty containers and pool equipment, with street-turns and stock tracked over time across tours.
  • A custom objective, with your own weights and priority levels.

One Search, the Whole Freight Plan walks through all of it.

What it doesn't do

Shipments are not split: each one stays on one vehicle or one chain of legs. A trailer taken from the pool stays with one vehicle for the whole plan, while units handed between tours, such as empty containers, go through equipmentStock. And an estimate is an estimate: without your own matrices, the distances are good enough to compare plans, not to promise an arrival time.

Try it

The vehicle routing page has the full example with its real response. It sits alongside the rest of what you can call the same way, including 3D load planning. For a step-by-step version, see the guide in our documentation.

Get started with Transportial

See how Transportial TMS can help you plan, track, and manage your logistics operations.