Examples
Worked, end-to-end examples for the FieldGenius VRP API. Each page shows a complete OptimizationRequest, the resulting OptimizationResponse, and an explanation of why the solver made the choices it made. All examples use realistic vehicle and job IDs and either a plain distance/time matrix or coordinates confined to the Belgium bounding box that the zone validator accepts.
- How to structure a minimal request with just resources, jobs, and a travel matrix.
- How hard vs. soft time windows change solver behavior.
- How multiple depots and multi-day planning fit together, including the
num_daysplacement gotcha. - How shipments link pickup and delivery onto the same vehicle.
- How named capacities and skill proficiency combine to filter eligible vehicles.
- How to re-optimize a route mid-day with
/optimize/replan. - How recurring weekly patterns get injected into a normal solve.
All examples
Basic Routing
Two trucks, a handful of jobs, and a plain distance matrix — the simplest possible request/response pair.
Time Windows
Hard vs. soft time windows on jobs, and how early_penalty/late_penalty change what the solver is willing to do.
Multi-Depot & Multiday
Vehicles starting from different depots, plus a 3-day plan with per-resource availability and day-pinned jobs.
Pickup & Delivery
Shipments with linked pickup/delivery steps that must stay on the same vehicle, including a skill-restricted shipment.
Skills & Capacities
Named multi-dimensional capacities combined with skill levels and per-skill service-time multipliers.
Live Replanning
An original solve followed by a mid-day /optimize/replan call with completed jobs, a moved vehicle, and an urgent new job.
Recurring Jobs Walkthrough
Registering a weekly recurring pattern and injecting its occurrences into a normal sync solve.
- OptimizationRequest schema — every field, exhaustively.
- OptimizationResponse schema — every field, exhaustively.
- POST /optimize/sync — the endpoint used by most examples on this page.