Appearance
User - Reports
Base URL:
https://your-domain.com
Admin endpoints for generating reports. All endpoints require admin/staff authentication.
Subscriber Summary
Get summary statistics of subscribers by status.
| Property | Value |
|---|---|
| Endpoint | Subscriber Summary |
| Method | GET |
| URL | /api/v1/reports/subscriber-summary |
| Authentication | Bearer Token |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer your-auth-token | Yes |
Success Response (200 OK):
json
{
"success": true,
"data": {
"total": 500,
"active": 350,
"expired": 100,
"pending": 30,
"disabled": 20,
"new_this_month": 25
}
}Revenue Summary
Get revenue statistics for the current period.
| Property | Value |
|---|---|
| Endpoint | Revenue Summary |
| Method | GET |
| URL | /api/v1/reports/revenue-summary |
| Authentication | Bearer Token |
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
from_date | date | No | Start date |
to_date | date | No | End date |
Success Response (200 OK):
json
{
"success": true,
"data": {
"total_revenue": 450000,
"total_collection": 420000,
"outstanding": 30000,
"monthly_trend": [
{"month": "Jan", "revenue": 150000},
{"month": "Feb", "revenue": 160000}
]
}
}Package Distribution
Get subscriber distribution by package.
| Property | Value |
|---|---|
| Endpoint | Package Distribution |
| Method | GET |
| URL | /api/v1/reports/package-distribution |
| Authentication | Bearer Token |
Success Response (200 OK):
json
{
"success": true,
"data": [
{
"package_id": 1,
"package_name": "10MB Package",
"subscriber_count": 150,
"percentage": 30
}
]
}Salesperson Performance
Get performance statistics for sales staff.
| Property | Value |
|---|---|
| Endpoint | Salesperson Performance |
| Method | GET |
| URL | /api/v1/reports/salesperson-performance |
| Authentication | Bearer Token |
Success Response (200 OK):
json
{
"success": true,
"data": [
{
"user_id": 5,
"name": "Sales Person 1",
"new_subscribers": 15,
"total_collection": 50000,
"renewals": 30
}
]
}Expiring Subscribers
Get list of subscribers expiring within specified days.
| Property | Value |
|---|---|
| Endpoint | Expiring Subscribers |
| Method | GET |
| URL | /api/v1/reports/expiring-subscribers |
| Authentication | Bearer Token |
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
days | integer | No | Days until expiry (default: 7) |
Success Response (200 OK):
json
{
"success": true,
"data": [
{
"id": 1,
"name": "John Doe",
"username": "subscriber001",
"package": "10MB Package",
"expire_date": "2024-01-20",
"days_left": 5
}
]
}Daily Collection
Get daily collection report.
| Property | Value |
|---|---|
| Endpoint | Daily Collection |
| Method | GET |
| URL | /api/v1/reports/daily-collection |
| Authentication | Bearer Token |
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
date | date | No | Specific date (default: today) |
Success Response (200 OK):
json
{
"success": true,
"data": {
"date": "2024-01-15",
"total_collection": 15000,
"payment_count": 25,
"by_user": [
{
"user_id": 5,
"name": "Collector 1",
"amount": 8000
}
]
}
}