Here is my code:
curl --location --request POST 'https://graphhopper.com/api/1/vrp?key=mykey' \
--header 'Content-Type: application/json' \
--data-raw '{
"vehicles": [{
"vehicle_id": "vehicle-1",
"type_id": "truck",
"start_address": {
"location_id": "Lyon, France Auvergne-Rhône-Alpes",
"lon": 4.8318,
"lat": 45.7577
},
"end_address": {
"location_id": "Lyon, France Auvergne-Rhône-Alpes",
"lon": 4.8318,
"lat": 45.7577
},
"earliest_start": 1664919000,
"max_jobs": 2
}
],
"vehicle_types": [{
"type_id": "truck",
"capacity": [2],
"profile": "truck"
}
],
"services": [{
"id": "s-1",
"name": "address",
"address": {
"location_id": "Rue Charles Péguy, ZAC Île de France, Laon, Aisne, Hauts-de-France, Metropolitan France, 02000, France",
"lon": 3.617,
"lat": 49.549
},
"duration": 720
}, {
"id": "s-2",
"name": "address",
"address": {
"location_id": "3, Rue le Coq, Leuilly, Laon, Aisne, Hauts-de-France, Metropolitan France, 02000, France",
"lon": 3.607,
"lat": 49.5401
},
"duration": 720
}
],
"objectives": [{
"type": "min",
"value": "vehicles"
}, {
"type": "min",
"value": "completion_time"
}
],
"configuration": {
"routing": {
"calc_points": true,
"snap_preventions": ["motorway", "trunk", "tunnel", "bridge", "ferry"]
}
}
}