Available Vehicles
Retrieve a list of vehicles available for booking.
Endpoint
INFO
GET /api/v1/dashboard/vehicles-available
Headers
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
station_id | integer | - | Filter by station |
category | string | - | Filter by category |
start_date | string | - | Availability start (ISO 8601) |
end_date | string | - | Availability end (ISO 8601) |
Example Request
bash
curl -X GET "https://api.daakey.com/api/v1/dashboard/vehicles-available?station_id=1&start_date=2024-01-20T10:00:00Z&end_date=2024-01-20T18:00:00Z" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"Response
Success (200)
json
{
"success": true,
"message": "Available vehicles retrieved",
"data": [
{
"id": 1,
"plate_number": "ABC-123",
"brand": "Toyota",
"model": "Corolla",
"year": 2023,
"category": "sedan",
"station": {
"id": 1,
"name": "Downtown Station"
},
"fuel_level": 85,
"pricing": {
"hourly_rate": 15.00,
"daily_rate": 80.00,
"estimated_total": 120.00
},
"image": "https://api.daakey.com/storage/vehicles/1/thumb.jpg"
},
{
"id": 3,
"plate_number": "GHI-789",
"brand": "Honda",
"model": "Civic",
"year": 2022,
"category": "sedan",
"station": {
"id": 1,
"name": "Downtown Station"
},
"fuel_level": 70,
"pricing": {
"hourly_rate": 14.00,
"daily_rate": 75.00,
"estimated_total": 112.00
},
"image": "https://api.daakey.com/storage/vehicles/3/thumb.jpg"
}
],
"meta": {
"period": {
"start": "2024-01-20T10:00:00Z",
"end": "2024-01-20T18:00:00Z",
"hours": 8
},
"total_available": 2
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Notes
- Returns only vehicles that are fully available for the period
- Estimated total is calculated based on the duration