Skip to main content

Dashboard – Car rental vehicles (v1)

Base path

/api/v1/workspace/:workspaceId/carrental

Actual path: /v1/workspace/:workspaceId/carrental/...

All endpoints below require workspace JWT and staff permission carrental.manage.

Endpoints

MethodPathDescription
GET/:workspaceId/carrental/vehiclesList vehicles (query: status, branchId, categoryId, page, limit).
POST/:workspaceId/carrental/vehiclesCreate vehicle (body: branchId, categoryId, brand, model, year, plateNumber, color, transmission, fuelType, seats, dailyPrice, specs).
GET/:workspaceId/carrental/vehicles/:idGet vehicle by ID.
PATCH/:workspaceId/carrental/vehicles/:idUpdate vehicle.
DELETE/:workspaceId/carrental/vehicles/:idDelete vehicle.
POST/:workspaceId/carrental/vehicles/:id/photosUpload vehicle photo (multipart, field photo).

List vehicles – Response 200

{
"items": [{ "id": "...", "brand": "Toyota", "model": "Corolla", "year": 2023, "dailyPrice": 150, "status": "AVAILABLE", ... }],
"total": 10,
"page": 1,
"limit": 20
}

Create vehicle – Request body

FieldTypeRequiredDescription
branchIdstringYesBranch ID.
categoryIdstringYesVehicle category ID.
brandstringYesBrand name.
modelstringYesModel name.
yearnumberYesYear (≥1900).
plateNumberstringYesPlate number.
colorstringYesColor.
transmissionstringYesAUTO or MANUAL.
fuelTypestringYesGAS, HYBRID, or ELECTRIC.
seatsnumberYesNumber of seats (≥1).
dailyPricenumberYesDaily price (≥0).
specsobjectNoe.g. doors, bags, features.

Common errors

  • 400: Validation failed.
  • 401: Unauthorized.
  • 403: Forbidden – no carrental.manage.
  • 404: Vehicle or workspace not found.
  • 500: Server error.