Booking Statistics
Retrieve statistics for bookings.
Endpoint
INFO
GET /api/v1/dashboard/bookings-stats
Headers
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
period | string | month | Period: day, week, month, year |
agency_id | integer | - | Filter by agency |
Example Request
bash
curl -X GET "https://api.daakey.com/api/v1/dashboard/bookings-stats?period=month" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"Response
Success (200)
json
{
"success": true,
"message": "Booking statistics retrieved",
"data": {
"summary": {
"total": 450,
"by_status": {
"upcoming": 25,
"active": 15,
"completed": 400,
"cancelled": 10
}
},
"revenue": {
"total": 75000.00,
"average_per_booking": 166.67,
"trend": "+12%",
"by_day": [
{ "date": "2024-01-01", "bookings": 15, "revenue": 2500.00 },
{ "date": "2024-01-02", "bookings": 18, "revenue": 3000.00 }
]
},
"popular_times": {
"weekday": { "morning": 120, "afternoon": 180, "evening": 100 },
"weekend": { "morning": 80, "afternoon": 150, "evening": 70 }
},
"average_duration_hours": 6.5,
"cancellation_rate": 2.2,
"top_vehicles": [
{ "vehicle_id": 1, "plate_number": "ABC-123", "bookings": 45 },
{ "vehicle_id": 2, "plate_number": "XYZ-789", "bookings": 38 }
],
"currency": "USD"
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}