Skip to content

User - Subscribers

Base URL: https://your-domain.com

Admin endpoints for managing subscribers. All endpoints require admin/staff authentication.


Fetch All Subscribers

Retrieve a paginated list of subscribers with optional filters and relationship modules.

PropertyValue
EndpointFetch All Subscribers
MethodGET
URL/api/v1/subscribers
AuthenticationBearer Token

Request Headers:

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer your-auth-tokenYes

Query Parameters:

ParameterTypeRequiredDescription
isp_idintegerYesISP ID
branch_idintegerYesBranch ID
offsetintegerNoPagination offset (default: 0)
limitintegerNoResults per page (default: 100)
subscriber_idintegerNoGet single subscriber by ID
salesperson_idintegerNoFilter by salesperson ID
package_idintegerNoFilter by package ID
nas_idintegerNoFilter by NAS ID
searchstringNoSearch by username, email, phone, fullname, or identity
subscriber_typeintegerNoFilter by status (0=Inactive, 1=Pending, 2=Active, 3=Expired, 4=Disabled, 7=Online)
all_module_statusintegerNoLoad all relationship modules at once (1=Yes)

Request Body: None

Success Response (200 OK):

json
{
    "success": true,
    "data": {
        "subscribers": [
            {
                "id": 1,
                "username": "subscriber001",
                "fullname": "John Doe",
                "email": "[email protected]",
                "phone": "01712345678",
                "package_id": 1,
                "package_name": "10MB Package",
                "status": "active",
                "expiration_date": "2025-12-31 23:59:59",
                "balance": 500.00,
                "created_at": "2024-01-15 10:30:00"
            }
        ],
        "total": 150,
        "offset": 0,
        "limit": 100
    }
}

Error Response (401 Unauthorized):

json
{
    "success": false,
    "message": "Unauthenticated"
}

Error Response (403 Forbidden):

json
{
    "success": false,
    "message": "You do not have permission to view subscribers"
}

Get Subscriber Details

Retrieve detailed profile information for a single subscriber.

PropertyValue
EndpointGet Subscriber Details
MethodGET
URL/api/v1/subscribers/details
AuthenticationBearer Token

Query Parameters:

ParameterTypeRequiredDescription
idintegerYesSubscriber ID
isp_idintegerYesISP ID
branch_idintegerYesBranch ID

Request Body: None

Success Response (200 OK):

json
{
    "success": true,
    "data": {
        "id": 1,
        "username": "subscriber001",
        "fullname": "John Doe",
        "email": "[email protected]",
        "phone": "01712345678",
        "address": "123 Main Street",
        "identity": "1234567890",
        "package_id": 1,
        "package_name": "10MB Package",
        "nas_id": 1,
        "static_ip": "192.168.1.100",
        "mac_address": "AA:BB:CC:DD:EE:FF",
        "status": "active",
        "expiration_date": "2025-12-31 23:59:59",
        "balance": 500.00,
        "salesperson_id": 1,
        "salesperson_name": "Sales User",
        "created_at": "2024-01-15 10:30:00"
    }
}

Error Response (404 Not Found):

json
{
    "success": false,
    "message": "Subscriber not found"
}

Create Subscriber

Create a new subscriber account.

PropertyValue
EndpointCreate Subscriber
MethodPOST
URL/api/v1/subscribers/create
AuthenticationBearer Token

Request Headers:

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer your-auth-tokenYes

Request Body:

json
{
    "isp_id": 1,
    "branch_id": 1,
    "username": "subscriber001",
    "fullname": "John Doe",
    "password": "pass123",
    "package_id": 1,
    "salesperson_id": 1,
    "connection_password": "conn123",
    "static_ip": "192.168.1.100",
    "mac_address": "AA:BB:CC:DD:EE:FF",
    "expiration_date": "2025-12-31 23:59:59",
    "email": "[email protected]",
    "phone": "01712345678",
    "nas_id": 1
}
ParameterTypeRequiredDescription
isp_idintegerYesISP ID
branch_idintegerYesBranch ID
usernamestringYesUnique username for login
fullnamestringYesSubscriber's full name
passwordstringYesLogin password
package_idintegerYesPackage ID to assign
salesperson_idintegerNoAssigned salesperson ID
connection_passwordstringNoPPPoE/RADIUS connection password
static_ipstringNoStatic IP address
mac_addressstringNoMAC address for binding
expiration_datedatetimeNoAccount expiration date
emailstringNoEmail address
phonestringNoPhone number
nas_idintegerNoNAS ID for RADIUS

Success Response (201 Created):

json
{
    "success": true,
    "message": "Subscriber created successfully",
    "data": {
        "id": 1,
        "username": "subscriber001"
    }
}

Error Response (422 Validation Error):

json
{
    "success": false,
    "message": "Validation failed",
    "errors": {
        "username": ["The username has already been taken."]
    }
}

Update Subscriber

Update an existing subscriber's information.

PropertyValue
EndpointUpdate Subscriber
MethodPUT
URL/api/v1/subscribers/update
AuthenticationBearer Token

Request Body:

json
{
    "id": 1,
    "isp_id": 1,
    "branch_id": 1,
    "fullname": "John Doe Updated",
    "phone": "01712345679"
}
ParameterTypeRequiredDescription
idintegerYesSubscriber ID
isp_idintegerYesISP ID
branch_idintegerYesBranch ID
Other fieldsvariousNoAny subscriber field to update

Success Response (200 OK):

json
{
    "success": true,
    "message": "Subscriber updated successfully"
}

Error Response (404 Not Found):

json
{
    "success": false,
    "message": "Subscriber not found"
}

Delete Subscriber

Permanently delete a subscriber account.

PropertyValue
EndpointDelete Subscriber
MethodDELETE
URL/api/v1/subscribers/delete
AuthenticationBearer Token

Query Parameters:

ParameterTypeRequiredDescription
idintegerYesSubscriber ID
isp_idintegerYesISP ID
branch_idintegerYesBranch ID
user_idintegerYesAdmin user ID performing deletion

Request Body: None

Success Response (200 OK):

json
{
    "success": true,
    "message": "Subscriber deleted successfully"
}

Error Response (404 Not Found):

json
{
    "success": false,
    "message": "Subscriber not found"
}

Activate/Invoice Subscriber

Activate a subscriber and generate an invoice with optional custom expiry date.

PropertyValue
EndpointActivate Subscriber
MethodPOST
URL/api/v1/subscribers/activation
AuthenticationBearer Token

Request Body:

json
{
    "subscriber_id": 1,
    "payment_amount": 1000,
    "payment_method": 1,
    "isp_id": 1,
    "branch_id": 1,
    "user_id": 1,
    "custom_expiry_datetime": "2026-12-31 23:59:59"
}
ParameterTypeRequiredDescription
subscriber_idintegerYesSubscriber ID
payment_amountdecimalYesPayment amount
payment_methodintegerYesPayment method ID
isp_idintegerYesISP ID
branch_idintegerYesBranch ID
user_idintegerYesAdmin user ID
custom_expiry_datetimedatetimeNoCustom expiry date

Success Response (200 OK):

json
{
    "success": true,
    "message": "Subscriber activated successfully",
    "data": {
        "invoice_id": 123,
        "new_expiration_date": "2026-12-31 23:59:59"
    }
}

Error Response (400 Bad Request):

json
{
    "success": false,
    "message": "Insufficient balance"
}

Mass Activation

Bulk activate multiple subscribers in a single request.

PropertyValue
EndpointMass Activation
MethodPOST
URL/api/v1/subscribers/mass-activation
AuthenticationBearer Token

Request Body:

json
{
    "isp_id": 1,
    "branch_id": 1,
    "user_id": 1,
    "selected_subscribers": "1,2,3",
    "package_id": "current_package",
    "payment_type": 1,
    "custom_expiry_datetime": "2025-12-31 23:59:59"
}
ParameterTypeRequiredDescription
isp_idintegerYesISP ID
branch_idintegerYesBranch ID
user_idintegerYesAdmin user ID
selected_subscribersstringYesComma-separated subscriber IDs
package_idmixedYesPackage ID or "current_package"
payment_typeintegerYes1=Subscriber Balance, 2=Salesperson Balance, 3=Smart
custom_expiry_datetimedatetimeNoCustom expiry date for all

Success Response (200 OK):

json
{
    "success": true,
    "message": "3 subscribers activated successfully",
    "data": {
        "activated": 3,
        "failed": 0
    }
}

Package Migration

Migrate a subscriber to a new package.

PropertyValue
EndpointPackage Migration
MethodPOST
URL/api/v1/subscribers/migration
AuthenticationBearer Token

Request Body:

json
{
    "subscriber_id": 1,
    "new_package_id": 2,
    "isp_id": 1,
    "branch_id": 1,
    "user_id": 1
}

Success Response (200 OK):

json
{
    "success": true,
    "message": "Package migrated successfully",
    "data": {
        "old_package": "10MB Package",
        "new_package": "20MB Package"
    }
}

Attributes

Subscriber attribute management for RADIUS (radcheck/radreply).


Get Subscriber Attributes

Retrieve all RADIUS attributes for a subscriber.

PropertyValue
EndpointGet Subscriber Attributes
MethodGET
URL/api/v1/subscribers/attributes
AuthenticationBearer Token

Query Parameters:

ParameterTypeRequiredDescription
subscriber_idintegerYesSubscriber ID
isp_idintegerYesISP ID
branch_idintegerYesBranch ID

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "attribute": "Framed-IP-Address",
            "op": ":=",
            "value": "192.168.1.100"
        }
    ]
}

Add Subscriber Attribute

Add a new RADIUS attribute to a subscriber.

PropertyValue
EndpointAdd Subscriber Attribute
MethodPOST
URL/api/v1/subscribers/attributes
AuthenticationBearer Token

Request Body:

json
{
    "subscriber_id": 1,
    "attribute": "Framed-IP-Address",
    "value": "192.168.1.100",
    "op": ":="
}

Success Response (201 Created):

json
{
    "success": true,
    "message": "Attribute added successfully",
    "data": {
        "id": 1
    }
}

Update Subscriber Attribute

Update an existing RADIUS attribute.

PropertyValue
EndpointUpdate Subscriber Attribute
MethodPUT
URL/api/v1/subscribers/attributes
AuthenticationBearer Token

Request Body:

json
{
    "id": 1,
    "value": "192.168.1.101"
}

Success Response (200 OK):

json
{
    "success": true,
    "message": "Attribute updated successfully"
}

Delete Subscriber Attribute

Delete a RADIUS attribute from a subscriber.

PropertyValue
EndpointDelete Subscriber Attribute
MethodDELETE
URL/api/v1/subscribers/attributes
AuthenticationBearer Token

Query Parameters:

ParameterTypeRequiredDescription
idintegerYesAttribute ID

Success Response (200 OK):

json
{
    "success": true,
    "message": "Attribute deleted successfully"
}

www.onezeroart.com