List Bookings
Retrieve a comprehensive list of all bookings across the agency or partner's fleet. This endpoint is the central hub for booking management, allowing staff to monitor reservations, track active rentals, and review booking history.
The booking list provides powerful filtering capabilities for different operational needs:
- Operations Staff: Filter by
activestatus to monitor ongoing rentals - Customer Service: Search by client name or booking reference to assist customers
- Fleet Managers: Filter by vehicle to see a specific car's booking history
- Revenue Analysis: Filter by date range for financial reporting
The response includes aggregate statistics in the meta section, giving a quick overview of booking distribution across statuses.
Permission Required
This endpoint requires the bookings.view permission.
Endpoint
INFO
GET /api/v1/dashboard/bookings
Headers
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
agency_id | integer | - | Filter by agency |
vehicle_id | integer | - | Filter by vehicle |
user_id | integer | - | Filter by client |
status | string | - | Filter: upcoming, active, completed, cancelled |
start_date | date | - | Filter by start date (from) |
end_date | date | - | Filter by end date (to) |
search | string | - | Search by booking ID, client name, plate number |
page | integer | 1 | Page number |
per_page | integer | 15 | Items per page |
Example Request
bash
curl -X GET "https://api.daakey.com/api/v1/dashboard/bookings?agency_id=1&status=active" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"Response
Success (200)
json
{
"success": true,
"message": "Bookings retrieved",
"data": [
{
"id": 1,
"reference": "BK-2024-00001",
"status": "active",
"start_date": "2024-01-15T10:00:00Z",
"end_date": "2024-01-15T18:00:00Z",
"actual_start": "2024-01-15T10:05:00Z",
"actual_end": null,
"client": {
"id": 1,
"name": "John Doe",
"email": "john@example.com",
"phone": "+1234567890"
},
"vehicle": {
"id": 1,
"plate_number": "ABC-123",
"brand": "Toyota",
"model": "Corolla"
},
"agency": {
"id": 1,
"name": "Downtown Branch"
},
"pricing": {
"subtotal": 64.00,
"tax": 6.40,
"total": 70.40,
"currency": "USD",
"payment_status": "paid"
},
"created_at": "2024-01-10T00:00:00Z"
},
{
"id": 2,
"reference": "BK-2024-00002",
"status": "upcoming",
"start_date": "2024-01-20T09:00:00Z",
"end_date": "2024-01-22T17:00:00Z",
"actual_start": null,
"actual_end": null,
"client": {
"id": 2,
"name": "Jane Smith",
"email": "jane@example.com",
"phone": "+0987654321"
},
"vehicle": {
"id": 2,
"plate_number": "XYZ-789",
"brand": "Honda",
"model": "CR-V"
},
"agency": {
"id": 1,
"name": "Downtown Branch"
},
"pricing": {
"subtotal": 220.00,
"tax": 22.00,
"total": 242.00,
"currency": "USD",
"payment_status": "authorized"
},
"created_at": "2024-01-12T00:00:00Z"
}
],
"meta": {
"current_page": 1,
"last_page": 10,
"per_page": 15,
"total": 145,
"stats": {
"upcoming": 25,
"active": 12,
"completed": 100,
"cancelled": 8
}
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Booking Status Values
| Status | Description |
|---|---|
upcoming | Confirmed, not yet started |
active | Currently in progress |
completed | Successfully finished |
cancelled | Cancelled by client or admin |
Payment Status Values
| Status | Description |
|---|---|
pending | Awaiting payment |
authorized | Payment authorized, not captured |
paid | Payment captured |
refunded | Full refund issued |
partial_refund | Partial refund issued |