This API version is deprecated
Please use the latest version for continued support and access to new features. View latest API documentation
Vehicle API
Create vehicle.
Adds a new vehicle to the Travis system.
Endpoint
POST - https://api.travisroadservices.com/v1/vehicles
Copy
Request body
Fields
| Field | Type | Required | Description |
|---|---|---|---|
licensePlate
|
string | Yes | License plate of the vehicle, communicated to service partners to identify the vehicle. |
fleetNumber
|
string | No | Fleet number for filtering or display within the customer fleet. |
vehicleType
|
integer | No | Vehicle type ID (e.g. truck, semi-trailer), retrieved via the vehicle types API. |
isDefaultVehicle
|
boolean | No | Indicates whether this is the default vehicle for single-driver users. |
vehicleDepot
|
string (iri-reference) | No | Vehicle depot to which this vehicle is assigned for invoicing purposes. |
fuelCard
|
string (iri-reference) | No | Fuel card linked to this vehicle for payment processing. |
Example
Response body
Response 201
VehicleResource resource created
Fields
| Field | Type | Description |
|---|---|---|
id
|
integer | Unique identifier of the vehicle. |
licensePlate
|
string | License plate of the vehicle, communicated to service partners to identify the vehicle. |
fleetNumber
|
string | Fleet number for filtering or display within the customer fleet. |
vehicleType
|
integer | Vehicle type ID (e.g. truck, semi-trailer), retrieved via the vehicle types API. |
isDefaultVehicle
|
boolean | Indicates whether this is the default vehicle for single-driver users. |
vehicleDepot
|
object | Vehicle depot to which this vehicle is assigned for invoicing purposes. |
id
|
string | |
import
|
object | Import record associated with this vehicle if created via bulk import. |
id
|
string (uuid) | Unique identifier of the import. |
fuelCard
|
object | Fuel card linked to this vehicle for payment processing. |
id
|
integer | |
cardNumber
|
string | |
isMainCard
|
boolean | |
status
|
string |
Example
Response 400
Invalid input
Fields
| Field | Type | Description |
|---|---|---|
title
|
string | A short, human-readable summary of the problem. |
detail
|
string | A human-readable explanation specific to this occurrence of the problem. |
status
|
integer | The HTTP status code applicable to this problem. |
instance
|
string | A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. |
type
|
string | A URI reference that identifies the problem type |
Example
Response 401
No response body - No bearer token set verify if your token is added as bearer tokenResponse 403
No response body - You don't have access to this API resourceResponse 422
An error occurred
Fields
| Field | Type | Description |
|---|---|---|
status
|
integer | The HTTP status code (422). |
violations
|
array | A list of constraint violations that caused the error. |
detail
|
string | A human-readable description of the validation errors. |
type
|
string | A URI reference identifying the validation error type. |
title
|
string | A short summary of the error. |
instance
|
string | A URI reference identifying the specific occurrence of the error. |
Example