Update vehicle or asset

/v2/vehicles

Allows to update a specific vehicle or asset.

Parameters

id

The ID of the vehicle to update. This ID is included in the URL of the request.

Example:

https://v2api.frotcom.com/v2/vehicles/12345

edit

This in the json structure that define the new values of the vehicle's properties. It must be specified in the body of the HTTP/S request.

{
  "LicensePlate": "ABC-1234",
  "ClassId": 4,
  "EngineNumber": "EN123456789",
  "DriverId": 123,
  "CoDriverId": 456,
  "DepartmentId": 10,
  "SegmentId": 20,
  "TypeId": 5,
  "Manufacturer": "Volvo",
  "Model": "FH16",
  "Year": 2022,
  "Odometer": 123456.7,
  "Chronometer": 98765.4,
  "Field1": "Primary vehicle",
  "Field2": "Route A",
  "Field3": "",
  "Field4": "",
  "Field5": "",
  "EngineId": 300,
  "CruiseControl": true,
  "UseCanbusMileage": false,
  "Icon": 7,
  "Vin": "1HGBH41JXMN109186",
  "Width": 2.5,
  "Height": 3.0,
  "Length": 12.0,
  "Pallets": 20.0,
  "DoubleDeck": false,
  "PalletCarrier": true,
  "MeatRail": false,
  "SecuringStraps": "4 straps",
  "Refrigerated": true,
  "RefrigeratedFrom": -20.0,
  "RefrigeratedTo": 5.0,
  "Bitemperature": false,
  "BitemperatureFrom": null,
  "BitemperatureTo": null,
  "Acquisition": "2023-03-15T09:30:00Z",
  "DriversWhiteList": [123, 456],
  "Whitelist": {
    "LastChanged": "2023-03-15T09:30:00Z",
    "LastConfigured": "2023-03-16T10:00:00Z",
    "Drivers": [123, 456]
  },
  "TerminalId": 200,
  "AssetId": 300,
  "GrossWeight": 25000.0,
  "CurbWeight": 18000.0,
  "CostKm": 0.75,
  "CostHour": 15.0,
  "Fuel100Km": 30.5,
  "FuelHour": 8.0,
  "FuelTank": 400.0,
  "CanbusFuelTank": 380.0,
  "FuelManagement": true,
  "FuelConsumption": 1,
  "Sensor1": true,
  "Sensor2": false,
  "Sensor3": false,
  "SensorCanbus": true,
  "UseOneMinRule": false,
  "VehicleAssetType": 3,
  "UseDriversWLRestrictions": true,
  "TachographType": "Digital",
  "TollSystemEmissionStandard": 4,
  "TollSystemEngine": 4,
  "TollSystemNumberOfAxles": 5,
  "TollSystemCoEmission": 200,
  "TollSystemGrossWeight": 25000,
  "TollSystemKerbWeight": 18000,
  "TollSystemVehicleClass": 4,
  "TollSystemFirstAxleHeight": 1200,
  "TollSystemVehicleTrainWeight": 30000,
  "InteractAuthorization": 3,
  "PercMinIncrease": 5,
  "PercMinDecrease": 5,
  "VehicleStatusName": "Active",
  "Payload": 7000.0,
  "EntityCost": [
    {
      "CostTypeId": 1,
      "EntityId": 500,
      "CostType": 2
    }
  ]
}

FieldDescription
LicensePlate Vehicle license plate string
ClassId The ID of the class of the vehicle.
The list of vehicle classes can be found here. int
EngineNumber Vehicle engine number string
DriverId Driver id to be associated to the vehicle int
CoDriverId CoDriver id to be associated to the vehicle int
DepartmentId Department of the vehicle int
SegmentId Segment of the vehicle int
TypeId Vehicle type id int
Manufacturer Vehicle manufacturer string
Model Vehicle model string
Year Year of production of this vehicle int
Odometer Vehicle odometer double
Chronometer Vehicle chronometer double
Field1 Any vehicle information string
Field2 Any vehicle information string
Field3 Any vehicle information string
Field4 Any vehicle information string
Field5 Any vehicle information string
EngineId Id of the engine type int
CruiseControl True if vehicle has cruise control bool
UseCanbusMileage True if it is to use CANbus mileage bool
Icon Identifies the vehicle icon used in Frotcom interface int
Vin Vehicle identification number string
Width Vehicle width double
Height Vehicle height double
Length Vehicle length double
Pallets Number of pallets double
DoubleDeck True if vehicle has double deck bool
PalletCarrier True if vehicle has pallet carrier bool
MeatRail True if vehicle has meat rail bool
SecuringStraps If vehicle has securing straps, how many. string
Refrigerated True if vehicle has refrigeration system bool
RefrigeratedFrom Minimum cooling temperature double
RefrigeratedTo Maximum cooling temperature double
Bitemperature True if vehicle has bitemperature system bool
BitemperatureFrom Minimum bitemp. cooling temperature double
BitemperatureTo Maximum bitemp. cooling temperature double
Acquisition Vehicle acquisition date datetime
DriversWhiteList If null all drivers can drive; otherwise only listed drivers array|null
Whitelist
FieldDescription
LastChangeddatetime
LastConfigureddatetime
Driversint[]
TerminalId Terminal Id to associate to the vehicle int
AssetId Id of the asset associated to the vehicle int
GrossWeight Vehicle gross weight double
CurbWeight Vehicle curb weight double
CostKm Cost per km double
CostHour Cost per hour double
Fuel100Km Fuel consumption per 100 km double
FuelHour Fuel consumption per hour double
FuelTank Fuel tank capacity double
CanbusFuelTank CANbus fuel tank capacity double
FuelManagement True if vehicle has fuel management bool
FuelConsumption 1=Use CANbus total fuel, 2=Calc from level, 3=Use fixed consumption int
Sensor1 True if ANA1 has fuel level sensor bool
Sensor2 True if ANA2 has fuel level sensor bool
Sensor3 True if ANA3 has fuel level sensor bool
SensorCanbus True if fuel level from CANbus is considered bool
UseOneMinRule Enable one‑minute rule for driving-time calculator bool
VehicleAssetType The kind of tracking that is applied to the vehicle.
Find the list of kinds of traking here enum
UseDriversWLRestrictions True if using drivers white list restrictions bool
TachographType Vehicle tachograph type string
TollSystemEmissionStandard NoCategory=0,Euro_1=1,Euro_2=2,Euro_3=3,Euro_4=4,Euro_5=5,Euro_6=6,EEV=15 enum
TollSystemEngine NoEngine=1,PetrolUnleaded=2,PetrolLeaded=3,Diesel=4,IPG=5,Battery=6,Solar=7,Hybrid=8,Hydrogen=9,CNG=10,LNG=11,Electric=12 enum
TollSystemNumberOfAxles Toll system number of axles int
TollSystemCoEmission Toll system CO emission int
TollSystemGrossWeight Toll system gross weight int
TollSystemKerbWeight Toll system kerb weight int
TollSystemVehicleClass NoInformation=0,M1=1,M2=2,M3=3,N1=4,N2=5,N3=6,L=7,AnyVehicle=8 enum
TollSystemFirstAxleHeight Toll system first axle height int
TollSystemVehicleTrainWeight Toll system vehicle train weight int
InteractAuthorization 1=NotAuthorized,2=ReceivedOnly,3=SendAndReceived enum
PercMinIncrease Minimum increase in fuel level for auto refuelling detection int
PercMinDecrease Minimum decrease in fuel level for auto drainage detection int
VehicleStatusName Vehicle status name string
Payload Vehicle payload double
EntityCost
FieldDescription
CostTypeIdint
EntityIdint
CostType(Fixed=1, Variable=2)enum

Return

true, if the update was successfull ; false otherwise.

Response HTTP Codes

200 - OK

- The update was executed successfully

400 - Bad request

  • If a valid edit json structure is not provided
  • If the licencesePlate is null, empty or undefined
  • If the licensePlate is too long
  • If Year greated then 9999 or lower then 0
  • If EngineNumber.Length lower then 20
  • If Width bigger then 999999999.99
  • If Height bigger then 999999999.99
  • If Length bigger then 999999999.99
  • If Pallets bigger then 999999999.99
  • If GrossWeight bigger then 999999999.99
  • If CurbWeight bigger then 999999999.99
  • If Vehicle Kind is 'A' and have a driver or codriver associated
  • If the DriversWhiteList is not null and the drivers ids do not belong to the company
  • If TachographType.Length is bigger then 50
  • If PercMinIncrease is lower then 1
  • If PercMinDecrease is lower then 1

403 - Forbidden

  • If the user doesn't have permission to Manage Vehicles

404 - Not found

  • If the vehicle ID specified could not be found