List Bookings
Retrieve a paginated list of all bookings made by the authenticated client. This endpoint returns booking history including upcoming reservations, currently active rentals, completed trips, and cancelled bookings.
The booking list is typically used to:
- Display a "My Trips" or "Booking History" screen in the app
- Show upcoming reservations on the home screen
- Allow users to access details of past rentals
- Enable rebooking of previously used vehicles
Each booking includes essential information such as the vehicle details, pickup location, dates, pricing, and current status. Use the status filter to show only relevant bookings (e.g., upcoming trips on the home screen, or completed trips in the history section).
Endpoint
INFO
GET /api/v1/client/bookings
Headers
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
X-Agency-Signature | {signature} | Yes |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
status | string | all | Filter by status: upcoming, active, completed, cancelled |
page | integer | 1 | Page number |
per_page | integer | 15 | Items per page (max: 50) |
Example Request
bash
curl -X GET "https://api.daakey.com/api/v1/client/bookings?status=upcoming&page=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-H "X-Agency-Signature: {signature}"Response
Success (200)
json
{
"success": true,
"message": "Bookings retrieved",
"data": [
{
"id": 1,
"status": "upcoming",
"start_date": "2024-01-20T10:00:00Z",
"end_date": "2024-01-20T18:00:00Z",
"vehicle": {
"id": 1,
"plate_number": "ABC-123",
"brand": "Toyota",
"model": "Corolla",
"image": "https://api.daakey.com/storage/vehicles/1/thumb.jpg"
},
"pickup_location": {
"name": "Downtown Station",
"address": "123 Main St"
},
"pricing": {
"subtotal": 64.00,
"tax": 6.40,
"total": 70.40,
"currency": "USD"
},
"created_at": "2024-01-15T00:00:00Z"
},
{
"id": 2,
"status": "completed",
"start_date": "2024-01-10T09:00:00Z",
"end_date": "2024-01-10T17:00:00Z",
"vehicle": {
"id": 2,
"plate_number": "XYZ-789",
"brand": "Honda",
"model": "Civic",
"image": "https://api.daakey.com/storage/vehicles/2/thumb.jpg"
},
"pickup_location": {
"name": "Airport Terminal",
"address": "456 Airport Blvd"
},
"pricing": {
"subtotal": 80.00,
"tax": 8.00,
"total": 88.00,
"currency": "USD"
},
"created_at": "2024-01-05T00:00:00Z"
}
],
"meta": {
"agency_id": 123,
"agency_code": "AGENCY123",
"current_page": 1,
"last_page": 3,
"per_page": 15,
"total": 42
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Booking Status Values
| Status | Description |
|---|---|
upcoming | Booking confirmed, not yet started |
active | Booking in progress |
completed | Booking finished successfully |
cancelled | Booking was cancelled |