Create or update a Vehicle. A unique ID is required to identify the Vehicle. Calling this endpoint with an existing id will update the Vehicle.
Modifying (or retrieving) a Vehicle will provide the caller with a version number for this Vehicle. This version can be passed to the upsert endpoint as a weak ETag in the If-Match header. This allows the caller to ensure that the Vehicle has not been modified since the last time it was retrieved.
The RFC7240 Prefer header indicates that a particular server behavior is preferred by the client but is not required for successful completion of the request (see RFC 7240).
The following behavior (see Examples) is supported by this API:
- return=<minimal|representation> is used to suggest the server to return using 204 without resource (minimal) or using 200 or 201 with resource (representation) in the response body on success.
Description of the vehicle.
Whether OptiFlow must use this vehicle in a planning or not. If false, OptiFlow will only use this vehicle when it makes sense to do so.
Capabilities this vehicle provides. Used to make sure that orders requiring a specific capability, are only handled by vehicles with that capability. Note: if a capability contains a dash, it will be split into two capabilities upon exporting and re-importing the vehicle set in PTV OptiFlow Route Optimization.
[ "refrigerated", "hazmat" ]
Labels for categorizing vehicles. Can be used for facility filtering or defining constraints. Note: if a label contains a dash, it will be split into two labels upon exporting and re-importing the vehicle set in PTV OptiFlow Route Optimization.
[ "priority", "express" ]
The color used to display this vehicle's route in the planning overview. Accepts CSS color names (e.g., "red", "blue") or hexadecimal color codes (e.g., "#FF5733", "#123DEF").
Break Rule group for this vehicle. Allows bulk assignment of break rules to all vehicles in the group during planning.
- Mock serverhttps://developer.conundra.eu/_mock/apis/vehicles/vehicle-api/vehicles/{id}
- Vehicle API Productionhttps://api.conundra.eu/vehicle/v1/vehicles/{id}
curl -i -X PUT \
'https://developer.conundra.eu/_mock/apis/vehicles/vehicle-api/vehicles/{id}' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-H 'If-Match: W/"24"' \
-H 'Prefer: return=minimal' \
-d '{
"description": "Horn plays La Cucaracha - use sparingly in residential areas",
"mandatory": true,
"driver": {
"name": "John Doe",
"efficiency_factor": 1.2,
"custom_data": {
"something": "customer specific"
}
},
"start": {
"location": {
"address": {
"id": "50.9514048-3.8067878",
"name": "The office",
"address_line": "Voordries 41",
"city": "Oosterzele",
"zip_code": "9860",
"country_code": "BE",
"geo_point": {
"latitude": 50.9514048,
"longitude": 3.8067878
}
},
"at_first_activity": false
},
"service_time": "PT20M",
"orders_to_deliver_available": true
},
"end": {
"location": {
"address": {
"id": "50.9514048-3.8067878",
"name": "The office",
"address_line": "Voordries 41",
"city": "Oosterzele",
"zip_code": "9860",
"country_code": "BE",
"geo_point": {
"latitude": 50.9514048,
"longitude": 3.8067878
}
},
"at_last_activity": false,
"same_as_start": false
},
"service_time": "PT15M",
"allow_picked_up_orders": true
},
"deployability": {
"window": {
"start": {
"earliest": "2025-01-01T08:00:00Z",
"latest": "2025-01-01T10:00:00Z"
},
"end": {
"latest": "2025-01-01T18:00:00Z"
}
},
"duration": {
"at_most_without_overtime": "PT8H",
"allowed_overtime": "PT2H"
}
},
"capabilities": [
"refrigerated",
"hazmat"
],
"transport_resource": {
"license_plate": "1-ABC-234",
"capacities": [
{
"type": "weight",
"value": 3500
},
{
"type": "volume",
"value": 25.5
}
],
"custom_data": {
"something": "customer specific"
}
},
"labels": [
"priority",
"express"
],
"cost": {
"fixed": 50,
"per_hour": 25,
"per_kilometer": 0.5,
"per_stop": 12,
"overtime_per_hour": 30
},
"route_settings": {
"routing_group": "medium-truck",
"max_distance_in_kilometers": 450,
"max_stops": 10,
"driving_speed_factor": 1.5,
"preferred_route_duration": {
"duration": "PT8H",
"importance": 0.5
}
},
"color": "#FF5733",
"break_rule_group": "BELGIUM-LEGAL",
"plan_group": "PLAN-GROUP-1",
"battery": {
"capacity": 1,
"consumption": {
"per_hundred_kilometers": 1000
},
"state_of_charge": {
"initial": 1,
"minimum": 1
}
}
}'Vehicle updated
Unique identifier for this Vehicle.
Description of the vehicle.
Whether OptiFlow must use this vehicle in a planning or not. If false, OptiFlow will only use this vehicle when it makes sense to do so.
Capabilities this vehicle provides. Used to make sure that orders requiring a specific capability, are only handled by vehicles with that capability. Note: if a capability contains a dash, it will be split into two capabilities upon exporting and re-importing the vehicle set in PTV OptiFlow Route Optimization.
[ "refrigerated", "hazmat" ]
Labels for categorizing vehicles. Can be used for facility filtering or defining constraints. Note: if a label contains a dash, it will be split into two labels upon exporting and re-importing the vehicle set in PTV OptiFlow Route Optimization.
[ "priority", "express" ]
The color used to display this vehicle's route in the planning overview. Accepts CSS color names (e.g., "red", "blue") or hexadecimal color codes (e.g., "#FF5733", "#123DEF").
Break Rule group for this vehicle. Allows bulk assignment of break rules to all vehicles in the group during planning.
{ "id": "truck-42", "description": "Horn plays La Cucaracha - use sparingly in residential areas", "mandatory": true, "driver": { "name": "John Doe", "efficiency_factor": 1.2, "custom_data": { … } }, "start": { "location": { … }, "service_time": "PT20M", "orders_to_deliver_available": true }, "end": { "location": { … }, "service_time": "PT15M", "allow_picked_up_orders": true }, "deployability": { "window": { … }, "duration": { … } }, "capabilities": [ "refrigerated", "hazmat" ], "transport_resource": { "license_plate": "1-ABC-234", "capacities": [ … ], "custom_data": { … } }, "labels": [ "priority", "express" ], "cost": { "fixed": 50, "per_hour": 25, "per_kilometer": 0.5, "per_stop": 12, "overtime_per_hour": 30 }, "route_settings": { "routing_group": "medium-truck", "max_distance_in_kilometers": 450, "max_stops": 10, "driving_speed_factor": 1.5, "preferred_route_duration": { … } }, "color": "#FF5733", "break_rule_group": "BELGIUM-LEGAL", "plan_group": "PLAN-GROUP-1", "battery": { "capacity": 1, "consumption": { … }, "state_of_charge": { … } } }