Skip to content

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.

PropertyValue
EndpointSubscriber Summary
MethodGET
URL/api/v1/reports/subscriber-summary
AuthenticationBearer Token

Request Headers:

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer your-auth-tokenYes

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.

PropertyValue
EndpointRevenue Summary
MethodGET
URL/api/v1/reports/revenue-summary
AuthenticationBearer Token

Query Parameters:

ParameterTypeRequiredDescription
from_datedateNoStart date
to_datedateNoEnd 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.

PropertyValue
EndpointPackage Distribution
MethodGET
URL/api/v1/reports/package-distribution
AuthenticationBearer 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.

PropertyValue
EndpointSalesperson Performance
MethodGET
URL/api/v1/reports/salesperson-performance
AuthenticationBearer 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.

PropertyValue
EndpointExpiring Subscribers
MethodGET
URL/api/v1/reports/expiring-subscribers
AuthenticationBearer Token

Query Parameters:

ParameterTypeRequiredDescription
daysintegerNoDays 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.

PropertyValue
EndpointDaily Collection
MethodGET
URL/api/v1/reports/daily-collection
AuthenticationBearer Token

Query Parameters:

ParameterTypeRequiredDescription
datedateNoSpecific 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
            }
        ]
    }
}

www.onezeroart.com