Create a new vehicle
POST/v1/vehicles
Registers a new vehicle in the system. If no supplierId is provided, the first company of the fleet will be used. Vehicle type and capacity information can be specified.
Request
- application/json
Body
required
plateNumber stringrequired
vehicleTypeId stringrequired
supplierId string
make string
The make of the vehicle. Require if the model is provided.
model string
The model of the vehicle.
year number
The release year of the vehicle.
color string
passengers number
luggage number
Responses
- 201
- 400
Vehicle successfully created
- application/json
- Schema
- Example (from schema)
Schema
_id stringrequired
The ID of the vehicle
plateNumber stringrequired
The plate number of the vehicle
vehicleTypeId stringrequired
The vehicle type ID of the vehicle
vehicleTypeName stringrequired
The vehicle type name of the vehicle
supplierId stringrequired
The supplier ID of the vehicle
make string
The make of the vehicle. Require if the model is provided.
model string
The model of the vehicle
year number
The year of the vehicle
color string
The color of the vehicle
passengers number
The passengers of the vehicle
luggage number
The luggage of the vehicle
createdDate date-time
The created date of the vehicle
latestUpdate date-time
The latest update date of the vehicle
{
"_id": "672d07188234567890123456",
"plateNumber": "ABC-123",
"vehicleTypeId": "507f1f77bcf86cd799439013",
"vehicleTypeName": "Car",
"supplierId": "507f1f77bcf86cd799439013",
"make": "Toyota",
"model": "Camry",
"year": 2023,
"color": "Black",
"passengers": 1,
"luggage": 1,
"createdDate": "2025-01-01T00:00:00.000Z",
"latestUpdate": "2025-01-01T00:00:00.000Z"
}
Invalid input data
Loading...