API – Vehicles¶
All paths are under https://api.innovanet.com. Header Authorization: Bearer inv_mcp_…. The innovanet() function is in the API chapter. Errors have the form { "success": false, "error": "…" }, and for invalid fields (422) also errors.
The module covers the vehicle list, the vehicle card, the logbook (journeys, refuellings, monthly closing), deadlines (technical inspection, insurance…), delegating the logbook to another driver, comments, attachments, the monthly report and the module settings. 44 paths in total.
Rules and concepts¶
Token and permissions¶
- Reading (
GET) works with a read-only token. ForPOST,PUTandDELETEyou need a read and write token, otherwise the response is403. - Writing also requires an active licence for the Vehicles module. Without it the response is
403witherrorCodeMODULE_NOT_LICENSED. Reading does not need the licence. - Everything runs with the permissions of the token owner.
user_idalways means the person's master ID (not a row in the employees table). - A module administrator is a user with the vehicles permission of level 1 (or a superadmin). They see all vehicles and all journeys, create and edit vehicles, unlock months and view the report.
- An ordinary driver sees only vehicles assigned to them (main driver
user_id, an entry inuser_assignments) or whose logbook was delegated to them. In the logbook they see and record only journeys and refuellings within the period of their assignment or delegation (valid_from–valid_to, ordate_from–date_to). Outside that period the response is403or422. - The fields
price,acquire_price,acquire_price_excl_vat,description,gps_providerandgps_car_idare returned to the module administrator only and are missing from the response for everyone else. In the list,fuel_cardsis returned to the administrator only too. In the detail, a driver gets the cards valid within their assignment or delegation periods (a main driver without an entry inuser_assignmentsgets all of them up tohandin_date). - Deleting a vehicle and all writes in the module settings (
/api/vehicles/settings/…) require the module administrator, otherwise the response is403(error.access_denied). - Changing a journey type, refuellings (create and delete), a new comment, a new attachment,
PUT …/carlog-preferencesandPOST …/lockrequire access to the vehicle (module administrator, main driver, assigned driver or a delegation), otherwise the response is403. - A comment or an attachment can be deleted only by its author (uploader) or the module administrator, otherwise the response is
403. - Lists are not paginated, they return all records.
- A date is
YYYY-MM-DD, a date with time isYYYY-MM-DD HH:MM:SS(the portal sends it this way), a month isYYYY-MM. Decimal numbers (price, consumption, litres) may arrive as a string in the response, for example"31500.00". - The wording of error messages depends on the user's language. In code rely on the status code.
Logbook: how it is kept (carlog_regime)¶
This field on the vehicle decides whether the logbook is kept.
| Value | Meaning |
|---|---|
null or none |
The logbook is not kept. The portal hides the logbook section and the vehicle is not included in the report. |
kept |
The logbook is kept. This is the option the portal offers when creating a vehicle. |
sk_50 |
Slovakia from 1 Jan 2026: 50 % flat rate. |
sk_full |
Slovakia: full records (100 %). |
cz_full, cz_pausal, cz_proportional |
Czechia: full records, flat rate, proportional. |
The calculations (totals of km, consumption, limit) are the same for every value except none. The value therefore says whether the logbook is kept and stores the method label for accounting. The API does not forbid recording a journey for a vehicle without a kept logbook, but that vehicle will not appear in the report.
Journey type (type)¶
| Value | Meaning | Effect |
|---|---|---|
0 |
Business journey | place_start and place_end (route from – to) are required when recording. It does not count as private use. |
1 |
Private journey | The route is not stored, the server replaces it with the text .... Its km and consumption are charged against the driver's annual limit. |
The journey type can be toggled (0 ↔ 1) with the change-type path.
Refuelling (paid_by)¶
| Value | Who paid | Effect |
|---|---|---|
1 |
The company (business refuelling) | The litres count towards consumption, the price is reduced by EUR 0.038 per litre (correction). |
0 |
The driver out of pocket (private) | The price is deducted from the private consumption value the driver owes. |
A refuelling is counted in a month if it belongs to the vehicle by vehicle_id, by registration plate (car_plate equals ecv) or by fuel card (card_id equals a card_number in the vehicle's fuel_cards). A driver sees only refuellings within the period of their assignment.
Odometer and fuel¶
odometerin a journey is the final odometer reading after the journey,fuelis the fuel level in the tank after the journey (litres). The server stores them as you send them. It does not calculate them for you. The portal calculates the odometer as the previous reading pluslength, do the same.- The start of the month (
odometer.start,fuel.start) is the value from the first journey of the month or the end of the previous month. The end of the month is the value from the last journey. You can override them for a month withcarlog-preferences. - Order check: the odometer must not decrease from journey to journey. A violation is reported by
odometer_sequence_valid=falsewith details inodometer_sequence_error. - When a journey is deleted the server recalculates the odometer of all journeys of the month from their lengths. When a journey is inserted in the middle of the month it does not recalculate. Check the readings and correct them.
- Average consumption of the month:
(fuel at start + litres from the company + litres private − fuel at end) ÷ (km ÷ 100).- A vehicle withfuel_typeElektrois calculated in kWh and Wh/km (measure=kWh). Other values offered by the portal:Benzín,Diesel,Zemný plyn,Vodík,Plugin hybrid. The API accepts any text.
Annual limit of private use¶
Each driver can have a limit in EUR per year (/settings/limits). The balance goes down month by month by the price of private consumption and by the price of excess consumption (consumption above the manufacturer's figure). If the balance is negative, the difference is overwage. The balance is carried over from locked months. Without a locked previous month the last known balance of the year is used, in January the full limit.
Monthly closing (lock)¶
POST …/locklocks the month for the vehicle and the calling user and stores the totals as a snapshot. The report draws from it.- In a locked month the server refuses (
403) creating a journey, creating a refuelling, editing a journey, deleting a journey and changing a journey type (The month is locked, the change cannot be made.). A lock by another user of the same vehicle and month blocks them as well. - When locking, the server checks that
odometer.end − odometer.startequals the sum of km (tolerance 0.01). Otherwise the response is400. You can skip the check with theaccept_odometer_mismatchfield. - Only the module administrator can unlock. After locking and unlocking the server recalculates the limit balance of the following locked months.
Logbook delegation¶
A delegation gives another user access to the vehicle's logbook for the period date_from – date_to. The delegate sees the journeys in this period (they have in_delegation = true in the logbook), the assigned driver does not see them in that period and they are not counted for them. The delegate receives a notification. A delegation cannot be edited, only deleted and created again.
Workflows¶
1. Record a business trip in the logbook¶
- Read the end of the previous journey:
GET /api/vehicles/4/carlog?month=2026-11. The last journey indata.journeyshasodometerandfuel. If the month is empty usedata.odometer.startanddata.fuel.start. - The odometer of the new journey is the previous reading plus the length.
fuelis the tank level after the journey. - Record the journey with
type0and the route filled in.
$res = innovanet('POST', '/api/vehicles/4/journeys', [
'date_from' => '2026-11-05 07:30:00',
'date_to' => '2026-11-05 09:10:00',
'place_start' => 'Bratislava',
'place_end' => 'Trnava',
'length' => 52,
'type' => 0,
'driver' => 'Jana Nováková',
'odometer' => 61452,
'fuel' => 42.4,
'notes' => 'Meeting with a customer',
]);
// $res['status'] === 201, $res['json']['data']['id'] is the journey number
Private journey: type 1, the route does not have to be filled in. If you picked the wrong type, use POST /api/vehicles/4/journeys/931/change-type.
2. Record a refuelling¶
$res = innovanet('POST', '/api/vehicles/4/fuels', [
'fuel_date' => '2026-11-04 08:15:00',
'litres' => 20,
'amount' => 31.00,
'paid_by' => 1,
'driver' => 'Jana Nováková',
]);
paid_by 1 is a refuelling at the company's expense, 0 means the driver paid out of pocket. The fuel level in the following journeys (fuel) must take the refuelling into account.
3. Read the monthly logbook and its totals¶
GET /api/vehicles/4/carlog?month=2026-11 returns the journeys, refuellings and all totals of the month at once: kilometres (length), odometer, fuel, average consumption (consumption), the price of private consumption (consumptionPrice.private), excess consumption (overfuel, overfuelPrice) and the limit (limit, overwage). The isLocked field tells you whether you locked the month, and then the response also carries lockId. A full example is at the path below.
4. Close a month¶
- Read
GET …/carlog?month=2026-11and check thatodometer_sequence_validistrueand thatodometer.end − odometer.startequalslength.all. - Call
POST /api/vehicles/4/lockwith{ "month": "2026-11" }. The response hasdata.id– the lock ID. - The administrator can unlock the month with
DELETE /api/vehicles/4/lock/{lockId}. You can find the lock ID later too: for a locked monthGET /api/vehicles/4/carlog?month=2026-11returnsdata.isLockedtrueanddata.lockId. It is the lock of the calling user, so read the logbook with the token of whoever locked the month.
5. Service, technical inspection and insurance (deadlines)¶
- In the settings create the deadline types (technical inspection, insurance, motorway vignette…):
POST /api/vehicles/settings/event-types. Existing ones are listed byGETon the same path. - Save a vehicle's deadline with
PUT /api/vehicles/4/eventswithevent_type_idand a date. The same type for the same vehicle is overwritten, no duplicate is created. - The vehicle's deadlines are returned by
GET /api/vehicles/4/events.
MCP¶
For vehicles the MCP server currently has only the report tool get_vehicles_report (the monthly report like GET /api/vehicles/report, read only). Journeys, refuellings and the logbook are covered only by this REST API for now.
Vehicles¶
GET /api/vehicles¶
The list of vehicles ordered by make and model. The module administrator sees all of them, others only assigned or delegated ones.
| Parameter | Type | Required | Description |
|---|---|---|---|
search |
string | no | Searches the make, model, plate and VIN (partial match) |
status |
string | no | active, service or inactive |
user_id |
integer | no | Master ID of the driver (main driver or an entry in user_assignments) |
fuel_type |
string | no | Exact match with the fuel type, for example Diesel |
cURL
curl -sS "https://api.innovanet.com/api/vehicles?status=active&search=octavia" \
-H "Authorization: Bearer inv_mcp_…" \
-H "Accept: application/json"
PHP
$res = innovanet('GET', '/api/vehicles?status=active');
Response 200 – each vehicle has all the columns of the card plus owner_id and owner_name (the main driver, otherwise the currently valid assignment).
{
"success": true,
"data": [
{
"id": 4,
"user_id": 15,
"brand": "Škoda",
"model": "Octavia",
"equipment": "Style",
"engine_type": "2.0 TDI",
"transmission": "Manuál",
"is_four_by_four": false,
"color": "Biela",
"price": "31500.00",
"description": null,
"type": 0,
"status": "active",
"visible": true,
"vin": "TMBJJ7NE5L0123456",
"production_month": 3,
"production_year": 2023,
"acquire_price": "31500.00",
"acquire_price_excl_vat": "26250.00",
"note": null,
"first_di_date": "2023-03-15T00:00:00.000000Z",
"receive_date": "2023-04-01T00:00:00.000000Z",
"handin_date": null,
"ecv": "BA123AB",
"oev": null,
"pneu": "Zimné 205/55 R16",
"dz": "2027-01-31",
"stk": "2027-03-31",
"change_pneu": null,
"consumption": "5.20",
"phm_limit": null,
"emissions": null,
"fuel_type": "Diesel",
"carlog_regime": "kept",
"user_assignments": [
{ "user_id": 15, "valid_from": "2023-04-01", "valid_to": null }
],
"fuel_cards": [
{ "card_number": "7001234567", "valid_from": "2023-04-01", "valid_to": null }
],
"gps_devices": [],
"custom_fields": { "3": "Zmluva LP-2023-18" },
"created_at": "2026-03-02T09:14:05.000000Z",
"updated_at": "2026-10-20T11:02:41.000000Z",
"owner_id": 15,
"owner_name": "Jana Nováková"
}
]
}
The vehicle type is 0 car, 1 trailer and so on. The visible field controls visibility in the portal list.
POST /api/vehicles¶
Creates a vehicle. Requires the module administrator permission (otherwise 403). No field is required, but when creating a vehicle the portal asks for the make, model, plate, fuel type and status.
| Field | Type | Description |
|---|---|---|
brand, model |
string | Make and model, up to 255 characters |
equipment, engine_type, transmission, color |
string | Equipment, engine, transmission, colour (up to 255) |
is_four_by_four |
boolean | 4x4 drive |
user_id |
integer | Main driver (master ID) |
price |
number | Price, not negative |
description, note |
string | Description and note |
type |
integer | Vehicle kind, 0 car, 1 trailer |
status |
string | active, service, inactive (default active) |
visible |
boolean | Visibility in the list |
vin |
string | VIN, up to 255 |
production_month |
integer | 1 to 12 |
production_year |
integer | 1900 to 2100 |
acquire_price, acquire_price_excl_vat |
number | Acquisition price with and without VAT, not negative |
first_di_date, receive_date, handin_date |
date | First registration, takeover, hand-in |
ecv, oev |
string | Registration plate and OEV number |
pneu, dz, stk, change_pneu |
string | Free text (tyres, motorway vignette, technical inspection, tyre change). For deadlines with reminders use events instead |
consumption |
number | Manufacturer's consumption (L/100 km, for electric Wh/km), not negative |
phm_limit, emissions |
number | Fuel limit and emissions, not negative |
fuel_type |
string | Fuel type, for example Diesel, Benzín, Elektro |
carlog_regime |
string | none, kept, sk_50, sk_full, cz_full, cz_pausal, cz_proportional (see above) |
user_assignments |
array | Driver assignments: [{ "user_id": 15, "valid_from": "2023-04-01", "valid_to": null }] |
fuel_cards |
array | Fuel cards: [{ "card_number": "7001234567", "valid_from": "…", "valid_to": null }] |
gps_devices |
array | GPS units: [{ "gps_id": "…", "gps_sn": "…", "valid_from": "…", "valid_to": null }] |
custom_fields |
object | Values of custom fields, the key is the definition ID: { "3": "text" } |
Request
{
"brand": "Škoda",
"model": "Octavia",
"ecv": "BA123AB",
"status": "active",
"fuel_type": "Diesel",
"consumption": 5.2,
"carlog_regime": "kept",
"user_id": 15,
"user_assignments": [
{ "user_id": 15, "valid_from": "2026-01-01", "valid_to": null }
]
}
cURL
curl -sS -X POST "https://api.innovanet.com/api/vehicles" \
-H "Authorization: Bearer inv_mcp_…" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d "{\"brand\":\"Škoda\",\"model\":\"Octavia\",\"ecv\":\"BA123AB\",\"status\":\"active\",\"fuel_type\":\"Diesel\",\"carlog_regime\":\"kept\",\"user_id\":15}"
PHP
$res = innovanet('POST', '/api/vehicles', [
'brand' => 'Škoda',
'model' => 'Octavia',
'ecv' => 'BA123AB',
'status' => 'active',
'fuel_type' => 'Diesel',
'carlog_regime' => 'kept',
'user_id' => 15,
]);
Response 201
{ "success": true, "data": { "id": 4 } }
GET /api/vehicles/{id}¶
The vehicle card with all the fields as in the list (without owner_id and owner_name) plus ownerName, ownerPhoto, comments, attachments and delegations. An ordinary driver sees only the delegations that overlap their period. A non-existent vehicle returns 404, a vehicle without access 403.
PHP
$res = innovanet('GET', '/api/vehicles/4');
Response 200 (card fields shortened)
{
"success": true,
"data": {
"id": 4,
"brand": "Škoda",
"model": "Octavia",
"ecv": "BA123AB",
"status": "active",
"fuel_type": "Diesel",
"carlog_regime": "kept",
"ownerName": "Jana Nováková",
"ownerPhoto": null,
"comments": [
{
"id": 12,
"vehicle_id": 4,
"user_id": 15,
"userName": "Jana Nováková",
"userPhoto": null,
"body": "Brake pads replaced.",
"created_at": "2026-10-20T11:00:00+01:00",
"deleted_at": null
}
],
"attachments": [
{
"id": 5,
"file_name": "technicky-preukaz.pdf",
"file_path": "vehicles/vehicle_4_1760954400.pdf",
"file_size": 183204,
"mime_type": "application/pdf",
"created_at": "2026-10-20T11:05:00.000000Z"
}
],
"delegations": [
{
"id": 8,
"vehicle_id": 4,
"user_id": 18,
"date_from": "2026-11-10T00:00:00+01:00",
"date_to": "2026-11-14T00:00:00+01:00",
"note": "Cover during vacation",
"user_name": "Peter Horváth"
}
]
}
}
Deleted comments stay in the list with deleted_at filled in. Download an attachment with GET …/attachments/{attachmentId}/download.
PUT /api/vehicles/{id}¶
Updates a vehicle. Requires the module administrator permission (otherwise 403). The body has the same fields and rules as POST /api/vehicles. Send only the fields you change. The fields user_assignments, fuel_cards, gps_devices and custom_fields are overwritten as a whole, so send the complete list. A sent value of null clears the field.
PHP
$res = innovanet('PUT', '/api/vehicles/4', [
'status' => 'service',
'carlog_regime' => 'kept',
]);
Response 200
{ "success": true }
DELETE /api/vehicles/{id}¶
Deletes a vehicle. The deletion is irreversible and also removes its journeys, refuellings and deadlines. Requires the module administrator (vehicles permission of level 1 or superadmin), otherwise 403. A non-existent vehicle returns 404.
PHP
$res = innovanet('DELETE', '/api/vehicles/4');
Response 200
{ "success": true }
Logbook¶
GET /api/vehicles/{id}/carlog¶
The logbook for a month: the list of journeys, refuellings and all calculated totals. Without month it is the current month. The module administrator sees all journeys of the month, a driver only the journeys within the period of their assignment or delegation. Journeys within another user's delegation period are neither shown to nor counted for the assigned driver.
| Parameter | In query | Type | Required | Description |
|---|---|---|---|---|
month |
yes | string YYYY-MM |
no | Default is the current month |
cURL
curl -sS "https://api.innovanet.com/api/vehicles/4/carlog?month=2026-11" \
-H "Authorization: Bearer inv_mcp_…" \
-H "Accept: application/json"
PHP
$res = innovanet('GET', '/api/vehicles/4/carlog?month=2026-11');
Response 200
{
"success": true,
"data": {
"month": "2026-11",
"isLocked": false,
"preferencesSet": {
"odometer_start": false,
"odometer_end": false,
"fuel_start": false,
"fuel_end": false
},
"numRoads": 3,
"length": { "all": 134, "business": 104, "private": 30 },
"privateRoadsPerc": 22.39,
"odometer": { "start": 61400, "end": 61534 },
"fuel": { "start": 30, "end": 42.6 },
"fuelTanks": {
"litres": { "all": 20, "business": 20, "private": 0 },
"amount": { "business": 31, "private": 0 },
"list": [
{
"id": 77,
"fuel_date": "2026-11-04 08:15:00",
"litres": 20,
"amount": 31,
"paid_by": 1,
"driver": "Jana Nováková",
"card_id": null,
"car_plate": null,
"manual": true,
"type": null
}
]
},
"consumption": { "real": 5.52, "business": 5.74, "private": 1.66 },
"consumptionPrice": { "business": 8.68, "private": 2.5 },
"pricePerLitre": 1.512,
"overfuel": 0.34,
"overfuelPrice": 0.51,
"makerConsumption": 5.2,
"limit": { "full": 120, "balance": 98.4, "endMonth": 95.39 },
"overwage": 0,
"measure": "L",
"measure2": "L/100km",
"journeys": [
{
"id": 931,
"date_from": "2026-11-03T07:30:00+01:00",
"date_to": "2026-11-03T09:10:00+01:00",
"place_start": "Bratislava",
"place_end": "Trnava",
"length": 52,
"type": 0,
"fuel": 27.1,
"odometer": 61452,
"manual": true,
"project_id": null,
"driver": "Jana Nováková",
"notes": "Meeting with a customer",
"in_delegation": false
},
{
"id": 932,
"date_from": "2026-11-03T15:00:00+01:00",
"date_to": "2026-11-03T16:40:00+01:00",
"place_start": "Trnava",
"place_end": "Bratislava",
"length": 52,
"type": 0,
"fuel": 24.2,
"odometer": 61504,
"manual": true,
"project_id": null,
"driver": "Jana Nováková",
"notes": null,
"in_delegation": false
},
{
"id": 933,
"date_from": "2026-11-05T18:00:00+01:00",
"date_to": "2026-11-05T18:50:00+01:00",
"place_start": "...",
"place_end": "...",
"length": 30,
"type": 1,
"fuel": 42.6,
"odometer": 61534,
"manual": true,
"project_id": null,
"driver": "Jana Nováková",
"notes": null,
"in_delegation": false
}
],
"odometer_sequence_valid": true,
"odometer_sequence_error": null
}
}
Meaning of the fields:
| Field | Description |
|---|---|
isLocked |
The month is locked by you (another user's lock does not affect it here, but it does block journey edits) |
lockId |
The ID of your lock, which DELETE …/lock/{lockId} needs. The field is in the response only when isLocked is true |
preferencesSet |
Which odometer and fuel values were overridden manually through carlog-preferences |
numRoads, length |
Number of journeys and total, business and private km. privateRoadsPerc is the share of private km in % |
odometer, fuel |
The reading at the start and at the end of the month (km, litres) |
fuelTanks |
Totals of refuellings by payer and their list (paid_by 1 company, 0 driver). A list item carries bill_id if the refuelling was created from a receipt of the Bills module (otherwise null) |
consumption |
Average consumption of the month (L/100 km) and consumption in litres for business and private km |
pricePerLitre |
Price per litre (per kWh for an electric vehicle) in EUR. From the month's refuellings; without refuellings from the fuel price list in the settings (the price of the vehicle's fuel type), and if that is not entered either, 1.35 |
pricePerLitreSource |
Where the price comes from: refuels (the month's refuellings), settings (fuel price list) or default (the fixed 1.35) |
referencePrice |
The price of the vehicle's fuel type from the fuel price list, or null if it is not entered |
consumptionPrice |
Price of consumption in EUR. private is the price of private consumption after deducting what the driver paid personally |
overfuel, overfuelPrice |
Excess consumption against the manufacturer's figure (makerConsumption) in litres and EUR |
limit |
full the driver's annual limit, balance the balance at the start of the month, endMonth the balance after the month |
overwage |
By how many EUR the limit is exceeded (otherwise 0) |
measure, measure2 |
Units: L and L/100km, for electric kWh and Wh/1km |
journeys |
Journeys of the month ordered by time. in_delegation is true for journeys within a delegation period |
odometer_sequence_valid |
false if the odometer decreased somewhere. The first error is described by odometer_sequence_error (journey_id, date, odometer, previous_odometer) |
The journey time is ISO 8601 with the server's time zone, the refuelling time is YYYY-MM-DD HH:MM:SS. You also get the lock ID in the response to POST …/lock.
PUT /api/vehicles/{id}/carlog-preferences¶
Manually overrides the odometer and fuel at the start and end of a given month (for example when the logbook starts in the middle of the vehicle's life). Requires access to the vehicle (otherwise 403). The values apply to the calling user. A field you send empty or null removes the stored override and the logbook returns to the calculated value. So always send all four fields that should stay set.
| Field | Type | Required | Description |
|---|---|---|---|
month |
string YYYY-MM |
yes | The month |
odometer_start |
number | no | Odometer at the start of the month, at least 0 |
odometer_end |
number | no | Odometer at the end of the month |
fuel_start |
number | no | Fuel in the tank at the start (litres) |
fuel_end |
number | no | Fuel in the tank at the end (litres) |
Request
{
"month": "2026-11",
"odometer_start": 61400,
"odometer_end": 61534,
"fuel_start": 30,
"fuel_end": 42.6
}
PHP
$res = innovanet('PUT', '/api/vehicles/4/carlog-preferences', [
'month' => '2026-11',
'odometer_start' => 61400,
'fuel_start' => 30,
]);
// odometer_end and fuel_end stay calculated (empty values remove an override)
Response 200
{ "success": true }
POST /api/vehicles/{id}/journeys¶
Records a journey in the logbook. A driver may record only within the period of their assignment or delegation (both date_from and date_to must fall into it), otherwise 422.
| Field | Type | Required | Description |
|---|---|---|---|
date_from |
date with time | yes | Start of the journey, for example 2026-11-05 07:30:00 |
date_to |
date with time | no | End of the journey |
length |
number | yes | Length in km, at least 0 |
type |
integer | yes | 0 business, 1 private |
place_start |
string | for type 0 |
Start place, up to 500 characters. Replaced by ... for a private journey |
place_end |
string | for type 0 |
Destination, up to 500 characters |
driver |
string | no | Driver's name, up to 255 |
fuel |
number | no | Fuel level in the tank after the journey (litres). Without it 0 is stored |
odometer |
number | no | Final odometer reading after the journey (km). Without it 0 is stored |
manual |
boolean | no | Manually entered record, default true |
project_id |
integer | no | ID of the project the journey belongs to |
notes |
string | no | Note, up to 2000 |
Request
{
"date_from": "2026-11-05 07:30:00",
"date_to": "2026-11-05 09:10:00",
"place_start": "Bratislava",
"place_end": "Trnava",
"length": 52,
"type": 0,
"driver": "Jana Nováková",
"odometer": 61452,
"fuel": 42.4,
"notes": "Meeting with a customer"
}
cURL
curl -sS -X POST "https://api.innovanet.com/api/vehicles/4/journeys" \
-H "Authorization: Bearer inv_mcp_…" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d "{\"date_from\":\"2026-11-05 07:30:00\",\"date_to\":\"2026-11-05 09:10:00\",\"place_start\":\"Bratislava\",\"place_end\":\"Trnava\",\"length\":52,\"type\":0,\"odometer\":61452,\"fuel\":42.4}"
PHP
$res = innovanet('POST', '/api/vehicles/4/journeys', [
'date_from' => '2026-11-05 07:30:00',
'date_to' => '2026-11-05 09:10:00',
'place_start' => 'Bratislava',
'place_end' => 'Trnava',
'length' => 52,
'type' => 0,
'odometer' => 61452,
'fuel' => 42.4,
]);
Response 201
{ "success": true, "data": { "id": 934 } }
A business journey without a route returns 422:
{
"success": false,
"error": "For a business journey the route (from – to) is required."
}
An invalid type (other than 0 or 1) or a missing date_from or length returns 422 with the errors field.
A journey with date_from in a month that is locked for the vehicle returns 403 with the error The month is locked, the change cannot be made.
PUT /api/vehicles/{id}/journeys/{journeyId}¶
Updates a journey. Send only the fields you change. The manual field is not changed here. A journey in a locked month cannot be changed (403). The month of the journey before the edit is checked. A driver may move a journey only within their own period (422).
| Field | Type | Required | Description |
|---|---|---|---|
date_from, date_to |
date with time | no | Start and end of the journey |
length |
number | no | Length in km, at least 0 |
type |
integer | no | 0 business, 1 private. When changed to 1 via PUT the route is not overwritten with ..., use change-type for that |
place_start, place_end |
string | no | Route, up to 500 |
driver |
string | no | Up to 255 |
fuel, odometer |
number | no | Fuel level and odometer reading after the journey |
project_id |
integer | no | Project ID |
notes |
string | no | Up to 2000 |
PHP
$res = innovanet('PUT', '/api/vehicles/4/journeys/931', [
'length' => 54,
'odometer' => 61454,
'notes' => 'Including a detour',
]);
Response 200
{ "success": true }
Locked month:
{
"success": false,
"error": "The month is locked, the change cannot be made."
}
DELETE /api/vehicles/{id}/journeys/{journeyId}¶
Deletes a journey and recalculates the odometer of all journeys of the month from their lengths (each journey = the previous reading plus its length). In a locked month the response is 403. A driver may delete only a journey from the period of their assignment (403).
PHP
$res = innovanet('DELETE', '/api/vehicles/4/journeys/933');
Response 200
{ "success": true }
POST /api/vehicles/{id}/journeys/{journeyId}/change-type¶
Toggles a journey between business and private (0 ↔ 1). When changed to private the server replaces the route with the text .... When changed back to business it does not restore the route, fill it in with PUT. No body. Requires access to the vehicle (otherwise 403). In a locked month the response is 403.
PHP
$res = innovanet('POST', '/api/vehicles/4/journeys/932/change-type');
Response 200 – data.type is the new type.
{ "success": true, "data": { "type": 1 } }
Refuelling¶
POST /api/vehicles/{id}/fuels¶
Records a refuelling. The server always marks it as manual (manual). Requires access to the vehicle (otherwise 403). A driver may record only a refuelling from the period of their assignment or delegation, otherwise 403. A refuelling with fuel_date in a month that is locked for the vehicle returns 403 with the error The month is locked, the change cannot be made.
| Field | Type | Required | Description |
|---|---|---|---|
fuel_date |
date with time | yes | When it was refuelled, for example 2026-11-04 08:15:00 |
litres |
number | yes | Litres refuelled (kWh for electric), at least 0 |
amount |
number | no | Amount in EUR, at least 0. Without it 0 |
paid_by |
integer | yes | 1 the company paid, 0 the driver paid out of pocket |
driver |
string | no | Driver's name, up to 255 |
type |
string | no | Fuel label, for example Diesel |
card_id |
string | no | Fuel card number. If it equals a card_number on the vehicle, the refuelling is counted for the vehicle even without a link |
car_plate |
string | no | Plate. If it equals the vehicle's ecv, it is counted as well |
bill_id |
integer | no | The receipt from the Bills module the refuelling was created from (see GET /api/vehicles/{id}/fuel-bills). The receipt must be of the fuel (PHM) type, assigned to this vehicle, not rejected, visible to the caller in the Bills module and not yet in the logbook, otherwise 422. After saving, the receipt is marked "Fuel booked" |
Request
{
"fuel_date": "2026-11-04 08:15:00",
"litres": 20,
"amount": 31.0,
"paid_by": 1,
"driver": "Jana Nováková"
}
cURL
curl -sS -X POST "https://api.innovanet.com/api/vehicles/4/fuels" \
-H "Authorization: Bearer inv_mcp_…" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d "{\"fuel_date\":\"2026-11-04 08:15:00\",\"litres\":20,\"amount\":31.0,\"paid_by\":1}"
PHP
$res = innovanet('POST', '/api/vehicles/4/fuels', [
'fuel_date' => '2026-11-04 08:15:00',
'litres' => 20,
'amount' => 31.0,
'paid_by' => 1,
]);
Response 201
{ "success": true, "data": { "id": 77 } }
A missing litres, fuel_date or paid_by (or a value other than 0/1) returns 422 with the errors field.
GET /api/vehicles/{id}/fuel-bills¶
List of fuel (PHM) receipts of this vehicle from the Bills module that are not yet in the logbook and are not rejected. It returns only the receipts the caller may see in the Bills module. Requires access to the vehicle (otherwise 403). On a tenant without a link between refuellings and receipts it returns an empty list.
PHP
$res = innovanet('GET', '/api/vehicles/4/fuel-bills');
Response 200
{
"success": true,
"data": [
{
"bill_id": 312,
"date": "2026-11-04",
"description": "Slovnaft Bánovce",
"merchant": "Slovnaft, a.s.",
"litres": 41.2,
"amount": 63.4,
"currency": "EUR",
"payment_method": "employee_card"
}
]
}
Then send bill_id with POST /api/vehicles/{id}/fuels.
DELETE /api/vehicles/{id}/fuels/{fuelId}¶
Deletes a refuelling. If it was created from a receipt, the receipt is released ("Fuel booked" is cleared) and can be used again. Requires access to the vehicle (otherwise 403). Only manual refuellings can be deleted, which includes all the ones you recorded through the API. Refuellings imported from fuel cards return 403.
PHP
$res = innovanet('DELETE', '/api/vehicles/4/fuels/77');
Response 200
{ "success": true }
Importing refuels from fuel cards¶
Import of CCS, Slovnaft and OMV exports. Every path needs the module administrator (vehicles permission level 1 or superadmin), otherwise 403. The import has two steps: the preview saves nothing and returns a token, the confirmation saves it as one import that can be removed as a whole. Refuels are assigned to vehicles by the card number (card_number in fuel_cards, only the digits are compared); a card without a vehicle is saved with vehicle_id null. Amounts include VAT.
POST /api/vehicles/fuel-imports/preview¶
multipart/form-data: provider (ccs, slovnaft or omv) and file (CSV, XLSX or XLS, at most 8 MB and 5,000 rows). The 200 response carries token (valid for 2 hours and only for the same user), layout, summary (total, importable, counts by status, litres, amount, per_vehicle) and rows. A row status is ok, unmatched, duplicate, other_product, locked or invalid; ok and unmatched are imported. An unrecognised file returns 422.
POST /api/vehicles/fuel-imports¶
Body { "token": "…" }. Saves the rows of the preview (the status is evaluated again before saving). Returns 201 with the import record. An expired or foreign token, or nothing to import, returns 422.
GET /api/vehicles/fuel-imports¶
The imports, newest first (up to 200).
GET /api/vehicles/fuel-imports/{id}¶
The import and its refuels (import, fuels).
DELETE /api/vehicles/fuel-imports/{id}¶
Deletes the import with all its refuels. If one of them is in a month that is locked for the vehicle, it returns 422 with the list of months and nothing is deleted.
Monthly closing¶
POST /api/vehicles/{id}/lock¶
Locks the logbook month for the vehicle and you (a lock cannot be created for another user). The server stores the totals of the month (km, private and business km, consumption, excess consumption, limit balance) and recalculates the following locked months. Requires access to the vehicle (otherwise 403).
| Field | Type | Required | Description |
|---|---|---|---|
month |
string YYYY-MM |
yes | The month to lock |
accept_odometer_mismatch |
boolean | no | true locks even when odometer.end − odometer.start does not match the sum of km. Default false |
Request
{ "month": "2026-11" }
cURL
curl -sS -X POST "https://api.innovanet.com/api/vehicles/4/lock" \
-H "Authorization: Bearer inv_mcp_…" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d "{\"month\":\"2026-11\"}"
PHP
$res = innovanet('POST', '/api/vehicles/4/lock', ['month' => '2026-11']);
$lockId = $res['json']['data']['id'];
Response 201
{ "success": true, "data": { "id": 57 } }
Errors:
| Status | When |
|---|---|
400 |
The odometer difference does not match the distance driven: the message says the odometer difference (end − start) does not match the distance and the logbook cannot be locked. Fix the data or send accept_odometer_mismatch |
409 |
You have already locked the month |
422 |
month is missing or not in the form YYYY-MM |
404 |
The vehicle does not exist |
DELETE /api/vehicles/{id}/lock/{lockId}¶
Unlocks the month. Only the module administrator can (otherwise 403). lockId is data.id from the response to locking, or data.lockId from GET /api/vehicles/{id}/carlog?month=YYYY-MM (the lock of the calling user). After unlocking the server recalculates the limit balances of the following locked months.
PHP
$res = innovanet('DELETE', '/api/vehicles/4/lock/57');
Response 200
{ "success": true }
Deadlines¶
A vehicle's deadlines (technical inspection, insurance, motorway vignette, service) follow the deadline types from the settings. For every vehicle and type there is at most one deadline. The portal also shows upcoming deadlines in the next 60 days on the overview.
GET /api/vehicles/{id}/events¶
The vehicle's deadlines. The driver must have access to the vehicle (otherwise 403).
PHP
$res = innovanet('GET', '/api/vehicles/4/events');
Response 200
{
"success": true,
"data": [
{
"event_type_id": 1,
"event_date": "2027-03-31",
"duration_days": 730,
"count_from_date": "2025-03-31"
},
{
"event_type_id": 2,
"event_date": "2026-12-31",
"duration_days": 365,
"count_from_date": null
}
]
}
PUT /api/vehicles/{id}/events¶
Saves the deadline of one type. If a deadline for the vehicle and type pair already exists it is overwritten, otherwise it is created. Values you do not send are set to null, so always send all three. A non-existent type returns 422.
| Field | Type | Required | Description |
|---|---|---|---|
event_type_id |
integer | yes | Deadline type ID from GET /api/vehicles/settings/event-types |
event_date |
date | no | The deadline date or the end of validity |
duration_days |
integer | no | Length of validity in days (for example 365), at least 0 |
count_from_date |
date | no | From when the validity is counted |
Request
{
"event_type_id": 2,
"event_date": "2026-12-31",
"duration_days": 365,
"count_from_date": "2025-12-31"
}
cURL
curl -sS -X PUT "https://api.innovanet.com/api/vehicles/4/events" \
-H "Authorization: Bearer inv_mcp_…" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d "{\"event_type_id\":2,\"event_date\":\"2026-12-31\",\"duration_days\":365,\"count_from_date\":\"2025-12-31\"}"
PHP
$res = innovanet('PUT', '/api/vehicles/4/events', [
'event_type_id' => 2,
'event_date' => '2026-12-31',
'duration_days' => 365,
'count_from_date' => '2025-12-31',
]);
Response 200
{ "success": true }
A non-existent deadline type:
{ "success": false, "error": "The deadline type does not exist" }
Delegations¶
POST /api/vehicles/{id}/delegations¶
Delegates the logbook to another user for a period. The module administrator or an assigned driver of the vehicle (main driver or an entry in user_assignments) can do it, anyone else gets 403. An assigned driver may delegate only within their own period (403). You cannot delegate to yourself (422). The delegated user receives a notification.
| Field | Type | Required | Description |
|---|---|---|---|
user_id |
integer | yes | Master ID of the user who takes over the logbook |
date_from |
date | yes | Start of the delegation |
date_to |
date | yes | End of the delegation, must not be before date_from |
note |
string | no | Note, up to 1000 |
Request
{
"user_id": 18,
"date_from": "2026-11-10",
"date_to": "2026-11-14",
"note": "Cover during vacation"
}
cURL
curl -sS -X POST "https://api.innovanet.com/api/vehicles/4/delegations" \
-H "Authorization: Bearer inv_mcp_…" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d "{\"user_id\":18,\"date_from\":\"2026-11-10\",\"date_to\":\"2026-11-14\"}"
PHP
$res = innovanet('POST', '/api/vehicles/4/delegations', [
'user_id' => 18,
'date_from' => '2026-11-10',
'date_to' => '2026-11-14',
'note' => 'Cover during vacation',
]);
Response 201
{ "success": true, "data": { "id": 8 } }
To yourself:
{ "success": false, "error": "You cannot delegate the logbook to yourself." }
DELETE /api/vehicles/{id}/delegations/{delegationId}¶
Cancels a delegation. The module administrator can cancel any, a driver only one that falls entirely within their period (403). Journeys recorded during the delegation stay in the logbook.
PHP
$res = innovanet('DELETE', '/api/vehicles/4/delegations/8');
Response 200
{ "success": true }
Comments¶
POST /api/vehicles/{id}/comments¶
Adds a comment to a vehicle. The author is the token owner. Requires access to the vehicle (otherwise 403).
| Field | Type | Required | Description |
|---|---|---|---|
body |
string | yes | Comment text, up to 10,000 characters |
Request
{ "body": "Brake pads replaced." }
PHP
$res = innovanet('POST', '/api/vehicles/4/comments', [
'body' => 'Brake pads replaced.',
]);
Response 201
{ "success": true, "data": { "id": 12 } }
DELETE /api/vehicles/{id}/comments/{commentId}¶
Deletes a comment. Only its author or the module administrator can do it (otherwise 403). The comment is only marked as deleted: it stays in GET /api/vehicles/{id} with deleted_at filled in.
PHP
$res = innovanet('DELETE', '/api/vehicles/4/comments/12');
Response 200
{ "success": true }
Attachments¶
Files are sent as multipart/form-data (field file), not as JSON. The innovanet() function sends JSON, so use CURLFile for uploading. The largest file is 50 MB, only common document and image types are allowed.
POST /api/vehicles/{id}/attachments¶
Uploads an attachment to a vehicle (registration certificate, insurance contract, service document). Requires access to the vehicle (otherwise 403).
| Field | Type | Required | Description |
|---|---|---|---|
file |
file | yes | The uploaded file in a multipart request |
cURL
curl -sS -X POST "https://api.innovanet.com/api/vehicles/4/attachments" \
-H "Authorization: Bearer inv_mcp_…" \
-H "Accept: application/json" \
-F "file=@technicky-preukaz.pdf"
PHP
$ch = curl_init('https://api.innovanet.com/api/vehicles/4/attachments');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer inv_mcp_…',
'Accept: application/json',
],
CURLOPT_POSTFIELDS => ['file' => new CURLFile('technicky-preukaz.pdf')],
CURLOPT_RETURNTRANSFER => true,
]);
$json = json_decode(curl_exec($ch), true);
curl_close($ch);
Response 201
{
"success": true,
"data": {
"id": 5,
"file_name": "technicky-preukaz.pdf",
"mime_type": "application/pdf",
"file_size": 183204,
"created_at": "2026-10-20T11:05:00.000000Z"
}
}
A missing or damaged file returns 400. A disallowed type or a file over 50 MB returns an error with a description in error.
GET /api/vehicles/{id}/attachments/{attachmentId}/download¶
Downloads an attachment. The response is the file itself, not JSON (the Content-Disposition header carries the original name). The driver must have access to the vehicle (otherwise 403).
cURL
curl -sS -o technicky-preukaz.pdf \
"https://api.innovanet.com/api/vehicles/4/attachments/5/download" \
-H "Authorization: Bearer inv_mcp_…"
DELETE /api/vehicles/{id}/attachments/{attachmentId}¶
Deletes an attachment and the file from storage. Only the person who uploaded it or the module administrator can do it (otherwise 403).
PHP
$res = innovanet('DELETE', '/api/vehicles/4/attachments/5');
Response 200
{ "success": true }
Report¶
GET /api/vehicles/report¶
The monthly report from locked logbooks. Requires the vehicles permission (otherwise 403). It includes drivers of vehicles whose logbook is kept (carlog_regime other than none) who had the vehicle assigned or delegated in the month. The numbers come from locked months; for a month that is not locked the driver has has_locks = false and the totals are 0.
| Parameter | In query | Type | Required | Description |
|---|---|---|---|---|
month |
yes | string YYYY-MM |
yes | The report month |
type |
yes | string | no | financial (default) or hr |
cURL
curl -sS "https://api.innovanet.com/api/vehicles/report?month=2026-11&type=financial" \
-H "Authorization: Bearer inv_mcp_…" \
-H "Accept: application/json"
PHP
$res = innovanet('GET', '/api/vehicles/report?month=2026-11&type=financial');
Response 200, type=financial – a row per driver: kilometres, private share and costs.
{
"success": true,
"data": {
"rows": [
{
"user_id": 15,
"user_name": "Jana Nováková",
"has_locks": true,
"length": 134,
"length_business": 104,
"length_private": 30,
"private_percentage": 22.39,
"over_fuel": 0.51,
"private_consumption": 2.5,
"overwage": 0
}
],
"month": "2026-11",
"type": "financial"
}
}
Response 200, type=hr – the basis for payroll:
{
"success": true,
"data": {
"rows": [
{
"user_id": 15,
"user_name": "Jana Nováková",
"has_locks": true,
"private_consumption": 2.5,
"consumption_history": "2.50 EUR (30.11.2026)",
"zdanitelny_benefit": 2.5,
"overwage": 0,
"limit_balance": 95.39
}
],
"month": "2026-11",
"type": "hr"
}
}
The zdanitelny_benefit field is the basis of the driver's taxable income. With a positive limit balance it equals private_consumption. With an exhausted limit it is counted only in December (private_consumption − overwage), in other months it is 0. If there is no driver in the month, rows is an empty array.
Errors: a missing or wrong month returns 400 (Parameter month (YYYY-MM) is required.), a wrong type returns 400 (Parameter type must be hr or financial.).
Module settings¶
The paths under /api/vehicles/settings/ manage the module's lists and defaults. Any signed-in user can read them, every write (POST, PUT, DELETE) requires the module administrator (vehicles permission of level 1 or superadmin), otherwise 403. The texts (name, description) are objects with the language keys sk, en, cs.
GET /api/vehicles/settings/event-types¶
The deadline types ordered by name.
PHP
$res = innovanet('GET', '/api/vehicles/settings/event-types');
Response 200
{
"success": true,
"data": [
{
"id": 2,
"name": { "sk": "Diaľničná známka", "en": "Motorway vignette", "cs": "Dálniční známka" },
"description": { "sk": "Ročná známka", "en": "", "cs": "" },
"active": true,
"created_at": "2026-03-02T09:00:00.000000Z",
"updated_at": "2026-03-02T09:00:00.000000Z"
}
]
}
POST /api/vehicles/settings/event-types¶
Creates a deadline type (for example technical inspection, insurance, service).
| Field | Type | Required | Description |
|---|---|---|---|
name |
object | yes | The name per language |
name.sk, name.en, name.cs |
string | no | The name in a language, up to 255 |
description |
object | no | The description per language |
description.sk, description.en, description.cs |
string | no | The description, up to 1000 |
active |
boolean | no | Active type |
Request
{
"name": { "sk": "Poistenie", "en": "Insurance", "cs": "Pojištění" },
"description": { "sk": "Povinné zmluvné poistenie" },
"active": true
}
PHP
$res = innovanet('POST', '/api/vehicles/settings/event-types', [
'name' => ['sk' => 'Poistenie', 'en' => 'Insurance', 'cs' => 'Pojištění'],
'active' => true,
]);
Response 201
{ "success": true, "data": { "id": 3 } }
PUT /api/vehicles/settings/event-types/{eventTypeId}¶
Updates a deadline type. The body is the same as for POST, the name field is required here too.
PHP
$res = innovanet('PUT', '/api/vehicles/settings/event-types/3', [
'name' => ['sk' => 'Havarijné poistenie', 'en' => 'Comprehensive insurance'],
'active' => true,
]);
Response 200
{ "success": true }
DELETE /api/vehicles/settings/event-types/{eventTypeId}¶
Deletes a deadline type. It also deletes the deadlines of this type on all vehicles.
PHP
$res = innovanet('DELETE', '/api/vehicles/settings/event-types/3');
Response 200
{ "success": true }
GET /api/vehicles/settings/limits¶
The drivers' annual limits of private use ordered by driver and year.
PHP
$res = innovanet('GET', '/api/vehicles/settings/limits');
Response 200
{
"success": true,
"data": [
{
"id": 3,
"user_id": 15,
"annual_limit": "120.00",
"year": 2026,
"created_at": "2026-01-05T08:00:00.000000Z",
"updated_at": "2026-01-05T08:00:00.000000Z"
}
]
}
POST /api/vehicles/settings/limits¶
Sets a driver's limit. The limit is in EUR and goes down by the price of private consumption (see above). A limit without a year applies to every year that has no limit of its own. There can be only one limit per driver and year (and one without a year). The server rejects a duplicate with 422 and the error Limit pre tohto vodiča a rok už existuje. (the text follows the language of the account).
| Field | Type | Required | Description |
|---|---|---|---|
user_id |
integer | yes | Master ID of the driver |
annual_limit |
number | yes | Annual limit in EUR, at least 0 |
year |
integer | no | Year 2000 to 2100. Without it, it applies to all years |
Request
{ "user_id": 15, "annual_limit": 120, "year": 2026 }
PHP
$res = innovanet('POST', '/api/vehicles/settings/limits', [
'user_id' => 15,
'annual_limit' => 120,
'year' => 2026,
]);
Response 201
{ "success": true, "data": { "id": 3 } }
PUT /api/vehicles/settings/limits/{limitId}¶
Updates a limit. The annual_limit field is required for an update too, user_id and year are optional. If the resulting driver and year pair already exists on another limit, the response is 422 with the error Limit pre tohto vodiča a rok už existuje.
PHP
$res = innovanet('PUT', '/api/vehicles/settings/limits/3', [
'annual_limit' => 150,
]);
Response 200
{ "success": true }
DELETE /api/vehicles/settings/limits/{limitId}¶
Deletes a limit. A driver without a limit has a limit of 0.
PHP
$res = innovanet('DELETE', '/api/vehicles/settings/limits/3');
Response 200
{ "success": true }
GET /api/vehicles/settings/custom-fields¶
The definitions of the vehicle's custom fields ordered by sort_order. The values are stored on the vehicle in custom_fields, the key is the definition id.
PHP
$res = innovanet('GET', '/api/vehicles/settings/custom-fields');
Response 200
{
"success": true,
"data": [
{
"id": 3,
"name": { "sk": "Číslo leasingovej zmluvy", "en": "Lease contract number", "cs": "Číslo leasingové smlouvy" },
"field_type": "text",
"options": null,
"required": false,
"active": true,
"sort_order": 1,
"created_at": "2026-03-02T09:30:00.000000Z",
"updated_at": "2026-03-02T09:30:00.000000Z"
}
]
}
POST /api/vehicles/settings/custom-fields¶
Creates a custom field.
| Field | Type | Required | Description |
|---|---|---|---|
name |
object | yes | The name per language |
name.sk, name.en, name.cs |
string | no | Up to 255 |
field_type |
string | yes | text, number, date, select or checkbox |
options |
array | no | Options for select: [{ "value": "A", "label": { "sk": "Variant A" } }] |
required |
boolean | no | Required field |
active |
boolean | no | Active field |
sort_order |
integer | no | Order, at least 0 |
Request
{
"name": { "sk": "Číslo leasingovej zmluvy", "en": "Lease contract number" },
"field_type": "text",
"required": false,
"active": true,
"sort_order": 1
}
PHP
$res = innovanet('POST', '/api/vehicles/settings/custom-fields', [
'name' => ['sk' => 'Číslo leasingovej zmluvy', 'en' => 'Lease contract number'],
'field_type' => 'text',
'active' => true,
'sort_order' => 1,
]);
Response 201
{ "success": true, "data": { "id": 3 } }
PUT /api/vehicles/settings/custom-fields/{cfId}¶
Updates a custom field. The name field is required, field_type is optional for an update.
PHP
$res = innovanet('PUT', '/api/vehicles/settings/custom-fields/3', [
'name' => ['sk' => 'Zmluva o lízingu'],
'sort_order' => 2,
]);
Response 200
{ "success": true }
DELETE /api/vehicles/settings/custom-fields/{cfId}¶
Deletes the definition of a custom field.
PHP
$res = innovanet('DELETE', '/api/vehicles/settings/custom-fields/3');
Response 200
{ "success": true }
GET /api/vehicles/settings/preferences¶
The module defaults and the fuel price list. If they have not been set yet, split_km and yearly_carlog_limits are true and fuel_prices is an empty array.
PHP
$res = innovanet('GET', '/api/vehicles/settings/preferences');
Response 200
{
"success": true,
"data": {
"split_km": true,
"yearly_carlog_limits": true,
"fuel_prices": [
{ "fuel_type": "Diesel", "price": 1.72, "unit": "L" },
{ "fuel_type": "Elektro", "price": 0.32, "unit": "kWh" }
]
}
}
PUT /api/vehicles/settings/preferences¶
Changes the defaults. Send only the ones you change.
| Field | Type | Required | Description |
|---|---|---|---|
split_km |
boolean | no | Distinguish business and private km |
yearly_carlog_limits |
boolean | no | Use the drivers' annual limits |
fuel_prices |
array | no | Fuel price list, which replaces the entire existing list. An item: fuel_type (fuel type as on the vehicle, e.g. Diesel, Elektro), price (price per unit, 0 to 100000) and unit (L, kWh or kg). At most 30 items; a fuel type should not repeat in the list (the last item applies) |
The vehicle logbook uses the price of the vehicle's fuel type in a month without refuellings and as the kWh price for an electric vehicle.
Request
{ "split_km": true, "yearly_carlog_limits": false }
PHP
$res = innovanet('PUT', '/api/vehicles/settings/preferences', [
'split_km' => true,
'yearly_carlog_limits' => false,
]);
Response 200
{ "success": true, "message": "Preferences updated", "data": { "fuel_prices": [] } }
Errors¶
| Status | When |
|---|---|
400 |
Wrong month or type in the report, odometer mismatch when locking, missing attachment file |
401 |
The token is missing, invalid or revoked |
403 |
You have no permission, the vehicle is not assigned to you, the token is read-only, you are not the module administrator (deleting a vehicle, settings), the month is locked (creating or editing a journey, creating a refuelling), someone else's comment or attachment, the refuelling is not manual, the module licence is missing (MODULE_NOT_LICENSED) |
404 |
The vehicle, journey, refuelling, lock, delegation, comment, attachment or setting does not exist |
409 |
The month is already locked |
422 |
A field is missing or malformed (with errors), a business journey without a route, a date outside the assignment period, delegating to yourself, a non-existent deadline type, a duplicate driver and year limit |
429 |
More than 120 calls a minute on one token |
500 |
Unexpected server error |
Want to try this feature? Start your innovanet trial →