Appearance
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.
| Property | Value |
|---|---|
| Endpoint | Fetch All Subscribers |
| Method | GET |
| URL | /api/v1/subscribers |
| Authentication | Bearer Token |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer your-auth-token | Yes |
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
isp_id | integer | Yes | ISP ID |
branch_id | integer | Yes | Branch ID |
offset | integer | No | Pagination offset (default: 0) |
limit | integer | No | Results per page (default: 100) |
subscriber_id | integer | No | Get single subscriber by ID |
salesperson_id | integer | No | Filter by salesperson ID |
package_id | integer | No | Filter by package ID |
nas_id | integer | No | Filter by NAS ID |
search | string | No | Search by username, email, phone, fullname, or identity |
subscriber_type | integer | No | Filter by status (0=Inactive, 1=Pending, 2=Active, 3=Expired, 4=Disabled, 7=Online) |
all_module_status | integer | No | Load 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.
| Property | Value |
|---|---|
| Endpoint | Get Subscriber Details |
| Method | GET |
| URL | /api/v1/subscribers/details |
| Authentication | Bearer Token |
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Subscriber ID |
isp_id | integer | Yes | ISP ID |
branch_id | integer | Yes | Branch 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.
| Property | Value |
|---|---|
| Endpoint | Create Subscriber |
| Method | POST |
| URL | /api/v1/subscribers/create |
| Authentication | Bearer Token |
Request Headers:
| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
Accept | application/json | Yes |
Authorization | Bearer your-auth-token | Yes |
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
}| Parameter | Type | Required | Description |
|---|---|---|---|
isp_id | integer | Yes | ISP ID |
branch_id | integer | Yes | Branch ID |
username | string | Yes | Unique username for login |
fullname | string | Yes | Subscriber's full name |
password | string | Yes | Login password |
package_id | integer | Yes | Package ID to assign |
salesperson_id | integer | No | Assigned salesperson ID |
connection_password | string | No | PPPoE/RADIUS connection password |
static_ip | string | No | Static IP address |
mac_address | string | No | MAC address for binding |
expiration_date | datetime | No | Account expiration date |
email | string | No | Email address |
phone | string | No | Phone number |
nas_id | integer | No | NAS 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.
| Property | Value |
|---|---|
| Endpoint | Update Subscriber |
| Method | PUT |
| URL | /api/v1/subscribers/update |
| Authentication | Bearer Token |
Request Body:
json
{
"id": 1,
"isp_id": 1,
"branch_id": 1,
"fullname": "John Doe Updated",
"phone": "01712345679"
}| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Subscriber ID |
isp_id | integer | Yes | ISP ID |
branch_id | integer | Yes | Branch ID |
| Other fields | various | No | Any 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.
| Property | Value |
|---|---|
| Endpoint | Delete Subscriber |
| Method | DELETE |
| URL | /api/v1/subscribers/delete |
| Authentication | Bearer Token |
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Subscriber ID |
isp_id | integer | Yes | ISP ID |
branch_id | integer | Yes | Branch ID |
user_id | integer | Yes | Admin 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.
| Property | Value |
|---|---|
| Endpoint | Activate Subscriber |
| Method | POST |
| URL | /api/v1/subscribers/activation |
| Authentication | Bearer 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"
}| Parameter | Type | Required | Description |
|---|---|---|---|
subscriber_id | integer | Yes | Subscriber ID |
payment_amount | decimal | Yes | Payment amount |
payment_method | integer | Yes | Payment method ID |
isp_id | integer | Yes | ISP ID |
branch_id | integer | Yes | Branch ID |
user_id | integer | Yes | Admin user ID |
custom_expiry_datetime | datetime | No | Custom 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.
| Property | Value |
|---|---|
| Endpoint | Mass Activation |
| Method | POST |
| URL | /api/v1/subscribers/mass-activation |
| Authentication | Bearer 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"
}| Parameter | Type | Required | Description |
|---|---|---|---|
isp_id | integer | Yes | ISP ID |
branch_id | integer | Yes | Branch ID |
user_id | integer | Yes | Admin user ID |
selected_subscribers | string | Yes | Comma-separated subscriber IDs |
package_id | mixed | Yes | Package ID or "current_package" |
payment_type | integer | Yes | 1=Subscriber Balance, 2=Salesperson Balance, 3=Smart |
custom_expiry_datetime | datetime | No | Custom 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.
| Property | Value |
|---|---|
| Endpoint | Package Migration |
| Method | POST |
| URL | /api/v1/subscribers/migration |
| Authentication | Bearer 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.
| Property | Value |
|---|---|
| Endpoint | Get Subscriber Attributes |
| Method | GET |
| URL | /api/v1/subscribers/attributes |
| Authentication | Bearer Token |
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
subscriber_id | integer | Yes | Subscriber ID |
isp_id | integer | Yes | ISP ID |
branch_id | integer | Yes | Branch 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.
| Property | Value |
|---|---|
| Endpoint | Add Subscriber Attribute |
| Method | POST |
| URL | /api/v1/subscribers/attributes |
| Authentication | Bearer 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.
| Property | Value |
|---|---|
| Endpoint | Update Subscriber Attribute |
| Method | PUT |
| URL | /api/v1/subscribers/attributes |
| Authentication | Bearer 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.
| Property | Value |
|---|---|
| Endpoint | Delete Subscriber Attribute |
| Method | DELETE |
| URL | /api/v1/subscribers/attributes |
| Authentication | Bearer Token |
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Attribute ID |
Success Response (200 OK):
json
{
"success": true,
"message": "Attribute deleted successfully"
}