Agency Statistics
Retrieve statistics for agencies.
WARNING
Requires super-admin or partner role.
Endpoint
INFO
GET /api/v1/dashboard/agencies-stats
Headers
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
partner_id | integer | - | Filter by partner |
period | string | month | Period: day, week, month, year |
Example Request
bash
curl -X GET "https://api.daakey.com/api/v1/dashboard/agencies-stats?period=month" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"Response
Success (200)
json
{
"success": true,
"message": "Agency statistics retrieved",
"data": {
"summary": {
"total_agencies": 15,
"active_agencies": 12,
"inactive_agencies": 3
},
"top_agencies": [
{
"id": 1,
"name": "Downtown Branch",
"partner": "Acme Car Rentals",
"vehicles_count": 25,
"bookings_count": 150,
"revenue": 25000.00,
"utilization_rate": 78.5
},
{
"id": 2,
"name": "Airport Branch",
"partner": "Acme Car Rentals",
"vehicles_count": 50,
"bookings_count": 280,
"revenue": 45000.00,
"utilization_rate": 82.3
}
],
"by_partner": [
{
"partner_id": 1,
"partner_name": "Acme Car Rentals",
"agencies_count": 5,
"total_revenue": 75000.00
}
],
"currency": "USD"
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}