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:
Required Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
isp_id | integer | Yes | ISP ID |
branch_id | integer | Yes | Branch ID |
Pagination Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
offset | integer | No | Pagination offset (default: 0) |
limit | integer | No | Results per page (default: 100) |
Filter Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
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) |
expiring_in | integer | No | Filter expiring subscribers (1=1 day, 2=3 days, 3=1 week, 4=2 weeks) |
grace_period_status | integer | No | Filter by grace period status (0=No, 1=Yes) |
department | integer | No | Filter by department ID |
Location Filter Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
country | integer | No | Filter by country ID |
province | integer | No | Filter by province ID |
city | integer | No | Filter by city ID |
area | integer | No | Filter by area ID |
subarea | integer | No | Filter by subarea ID |
Module Loading Parameters
Use all_module_status=1 to load all relationships at once, or enable individual modules for optimized performance:
| Parameter | Type | Required | Description |
|---|---|---|---|
all_module_status | integer | No | Load ALL relationship modules at once (1=Yes) |
package_module | integer | No | Load package data (1=Yes) |
salesperson_module | integer | No | Load salesperson data (1=Yes) |
nas_module | integer | No | Load NAS data (1=Yes) |
radacct_module | integer | No | Load RADIUS accounting data (1=Yes) |
radchecks_module | integer | No | Load RADIUS check attributes (1=Yes) |
radreply_module | integer | No | Load RADIUS reply attributes (1=Yes) |
radusergroup_module | integer | No | Load RADIUS user group data (1=Yes) |
ip_pool_module | integer | No | Load IP pool and address data (1=Yes) |
balance_module | integer | No | Load current balance data (1=Yes) |
area_module | integer | No | Load area hierarchy data (1=Yes) |
invoice_module | integer | No | Load invoices data (1=Yes) |
ledger_module | integer | No | Load ledger entries (1=Yes) |
payment_module | integer | No | Load payments data (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"
}cURL Example:
bash
# Basic fetch with required parameters
curl -X GET "https://your-domain.com/api/v1/subscribers?isp_id=1&branch_id=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token"
# With pagination and filters
curl -X GET "https://your-domain.com/api/v1/subscribers?isp_id=1&branch_id=1&offset=0&limit=50&subscriber_type=2&package_id=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token"
# With module loading
curl -X GET "https://your-domain.com/api/v1/subscribers?isp_id=1&branch_id=1&package_module=1&balance_module=1&area_module=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token"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"
}cURL Example:
bash
curl -X GET "https://your-domain.com/api/v1/subscribers/details?id=1&isp_id=1&branch_id=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token"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",
"previous_balance": 0,
"email": "[email protected]",
"phone": "01712345678",
"identity": "1234567890",
"address": "123 Main Street",
"nas_id": 1,
"connection_type": 0,
"profile_status": 0,
"country": 1,
"province": 1,
"city": 1,
"area": 1,
"subarea": 1,
"department": 1,
"latitude": "23.8103",
"longitude": "90.4125",
"auto_renew_status": 1,
"discount": 0,
"discount_type": 0,
"sms_status": 1,
"email_status": 1,
"mac_lock_status": 0,
"total_data_quota": 0,
"total_session_quota": 0,
"join_date": "2025-01-01",
"onu_note": "ONU installed",
"box_number": "BOX-001",
"box_address": "Building A",
"switch_board": "SW-01",
"switch_port": "Port 1",
"electric_socket": "Socket A",
"cable_type": "Fiber",
"uplink_port": "UP-01",
"fiber_code": "FC-001",
"fiber_color": "Blue"
}Required Parameters
| 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 |
Connection Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
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 |
nas_id | integer | No | NAS ID for RADIUS |
connection_type | integer | No | Connection type (0=PPPoE, 1=Hotspot, etc.) |
mac_lock_status | integer | No | MAC lock status (0=Disabled, 1=Enabled) |
Profile Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
expiration_date | datetime | No | Account expiration date (format: YYYY-MM-DD HH:mm:ss) |
previous_balance | decimal | No | Opening balance amount |
profile_status | integer | No | Initial status (0=Inactive, 1=Pending, 2=Active) |
auto_renew_status | integer | No | Auto-renewal (0=Disabled, 1=Enabled) |
discount | decimal | No | Discount amount |
discount_type | integer | No | Discount type (0=Fixed, 1=Percentage) |
join_date | date | No | Join date (format: YYYY-MM-DD) |
Contact Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | No | Email address |
phone | string | No | Phone number |
identity | string | No | National ID / Passport number |
address | string | No | Full address |
sms_status | integer | No | SMS notifications (0=Disabled, 1=Enabled) |
email_status | integer | No | Email notifications (0=Disabled, 1=Enabled) |
Location Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
country | integer | No | Country ID |
province | integer | No | Province ID |
city | integer | No | City ID |
area | integer | No | Area ID |
subarea | integer | No | Subarea ID |
department | integer | No | Department ID |
latitude | string | No | GPS latitude coordinate |
longitude | string | No | GPS longitude coordinate |
Quota Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
total_data_quota | integer | No | Total data quota in MB (0=Unlimited) |
total_session_quota | integer | No | Total session quota in minutes (0=Unlimited) |
Infrastructure Parameters (ONU/Fiber)
| Parameter | Type | Required | Description |
|---|---|---|---|
onu_note | string | No | ONU installation notes |
box_number | string | No | Distribution box number |
box_address | string | No | Distribution box location |
switch_board | string | No | Switch board identifier |
switch_port | string | No | Switch port number |
electric_socket | string | No | Electric socket identifier |
cable_type | string | No | Cable type (Fiber, UTP, etc.) |
uplink_port | string | No | Uplink port identifier |
fiber_code | string | No | Fiber cable code |
fiber_color | string | No | Fiber cable color |
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."]
}
}cURL Example:
bash
curl -X POST "https://your-domain.com/api/v1/subscribers/create" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token" \
-d '{
"isp_id": 1,
"branch_id": 1,
"username": "subscriber001",
"fullname": "John Doe",
"password": "pass123",
"package_id": 1,
"email": "[email protected]",
"phone": "01712345678",
"nas_id": 1,
"salesperson_id": 1
}'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"
}cURL Example:
bash
curl -X PUT "https://your-domain.com/api/v1/subscribers/update" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token" \
-d '{
"id": 1,
"isp_id": 1,
"branch_id": 1,
"fullname": "John Doe Updated",
"phone": "01712345679"
}'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"
}cURL Example:
bash
curl -X DELETE "https://your-domain.com/api/v1/subscribers/delete?id=1&isp_id=1&branch_id=1&user_id=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token"Activate/Invoice Subscriber
Activate a subscriber and generate an invoice with optional custom expiry date. Supports package change during activation - pass a different package_id to activate with a new package.
| Property | Value |
|---|---|
| Endpoint | Activate Subscriber |
| Method | POST |
| URL | /api/v1/subscribers/activation |
| Authentication | Bearer Token |
Request Body:
json
{
"subscriber_id": 1,
"package_id": 5,
"payment_amount": 1000,
"payment_method": 1,
"cut_subscriber_balance": 1,
"custom_expiry_datetime": "2026-12-31 23:59:59"
}Required Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
subscriber_id | integer | Yes | Subscriber ID to activate |
Optional Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
package_id | integer | No | New package ID for package change during activation. If not provided, uses subscriber's current package. Must be assigned to the subscriber's salesperson. |
payment_amount | decimal | No | Payment amount to add to subscriber balance before activation |
payment_method | integer | No | Payment method ID (default: 1=Cash). Common values: 1=Cash, 4=Subscriber Balance, 6=Bkash, etc. |
cut_subscriber_balance | integer | No | Set to 1 to pay from subscriber balance. This overrides payment_method to 4. Requires sufficient balance. |
custom_expiry_datetime | datetime | No | Custom expiry date (format: YYYY-MM-DD HH:MM:SS). Must be a future date. |
Package Change
To change a subscriber's package during activation:
- Pass the new
package_idin the request - The system will validate the package exists and belongs to the same ISP/Branch
- The system will validate the salesperson has this package assigned
- All billing and accounting will be calculated based on the new package
- On successful activation, the subscriber's package will be updated
Success Response (200 OK):
json
{
"status": "success",
"message": "Subscriber Activated Successfully.",
"subscriber_id": 1,
"subscriber_username": "john_doe",
"invoice_data": {
"id": 123,
"billing_total_amount": 1000,
"billing_due_amount": 0,
"invoice_status": 1
},
"subscriber_data": {
"id": 1,
"username": "john_doe",
"package_id": 5,
"profile_status": 2,
"expiration_date": "2026-12-31 23:59:59"
}
}Error Responses:
json
// Subscriber not found
{
"status": "error",
"message": "Subscriber Not Found"
}
// Package not found (when package_id provided)
{
"status": "error",
"message": "Package Not Found"
}
// Package ISP/Branch mismatch
{
"status": "error",
"message": "Package Does Not Belong To Subscriber ISP/Branch"
}
// Salesperson doesn't have package assigned
{
"status": "error",
"message": "Invalid Salesperson or Package Data"
}
// Insufficient subscriber balance
{
"status": "error",
"message": "Insufficient Subscriber Balance Required (1000)"
}
// Invalid custom expiry date
{
"status": "error",
"message": "Custom Expiration Date/Time Invalid! Must Be A Future Date."
}
// Due invoice exists
{
"status": "error",
"message": "Due Invoice Already Exist (Wait 1 Hour to Generate New One Or Pay On Due Invoice)",
"invoice_id": 122,
"due_amount": 500,
"subscriber_id": 1
}cURL Examples:
bash
# Basic activation with current package
curl -X POST "https://your-domain.com/api/v1/subscribers/activation" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token" \
-d '{
"subscriber_id": 1,
"payment_amount": 1000,
"cut_subscriber_balance": 1
}'
# Activation with package change
curl -X POST "https://your-domain.com/api/v1/subscribers/activation" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token" \
-d '{
"subscriber_id": 1,
"package_id": 5,
"payment_amount": 1500,
"cut_subscriber_balance": 1
}'
# Activation with custom expiry date
curl -X POST "https://your-domain.com/api/v1/subscribers/activation" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token" \
-d '{
"subscriber_id": 1,
"custom_expiry_datetime": "2026-12-31 23:59:59"
}'Mass Activation
Bulk activate multiple subscribers in a single request. This endpoint replicates the exact logic from MassActivationController for 95%+ compatibility with web view functionality.
| 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
}
}cURL Example:
bash
curl -X POST "https://your-domain.com/api/v1/subscribers/mass-activation" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token" \
-d '{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"selected_subscribers": "1,2,3",
"package_id": "current_package",
"payment_type": 1
}'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"
}
}cURL Example:
bash
curl -X POST "https://your-domain.com/api/v1/subscribers/migration" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token" \
-d '{
"subscriber_id": 1,
"new_package_id": 2,
"isp_id": 1,
"branch_id": 1,
"user_id": 1
}'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"
}
]
}cURL Example:
bash
curl -X GET "https://your-domain.com/api/v1/subscribers/attributes?subscriber_id=1&isp_id=1&branch_id=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token"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
}
}cURL Example:
bash
curl -X POST "https://your-domain.com/api/v1/subscribers/attributes" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token" \
-d '{
"subscriber_id": 1,
"attribute": "Framed-IP-Address",
"value": "192.168.1.100",
"op": ":="
}'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"
}cURL Example:
bash
curl -X PUT "https://your-domain.com/api/v1/subscribers/attributes" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token" \
-d '{
"id": 1,
"value": "192.168.1.101"
}'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"
}cURL Example:
bash
curl -X DELETE "https://your-domain.com/api/v1/subscribers/attributes?id=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token"