API Integration
Integrate Alternet ISP Billing with your ERP/CRM system using our RESTful API
Get Started in 5 Minutes
1. Get API Key
Login to your dashboard and generate an API key
2. Make First Request
Test with our sandbox environment
3. Go Live
Switch to production and integrate with your system
Your API Keys
Please login to manage API keys
Login to ContinueCreate New API Key
Authentication
All API requests require authentication using an API key. Include the key in the request header:
X-API-Key: your_api_key_here
Making Your First API Call
curl -X GET "https://alternetispbilling.com/api/v1/customers" \ -H "X-API-Key: YOUR_API_KEY" \ -H "Accept: application/json"
<?php
$apiKey = 'YOUR_API_KEY';
$url = 'https://alternetispbilling.com/api/v1/customers';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: ' . $apiKey,
'Accept: application/json'
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
import requests
api_key = 'YOUR_API_KEY'
url = 'https://alternetispbilling.com/api/v1/customers'
headers = {
'X-API-Key': api_key,
'Accept': 'application/json'
}
response = requests.get(url, headers=headers)
data = response.json()
print(data)
const apiKey = 'YOUR_API_KEY';
const url = 'https://alternetispbilling.com/api/v1/customers';
fetch(url, {
method: 'GET',
headers: {
'X-API-Key': apiKey,
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
API Reference
Explore all available endpoints and their responses.
Customers
Retrieve a paginated list of customers. Can filter by service type, status, router, and more.
Query Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| page | integer | No | 1 | Page number for pagination |
| per_page | integer | No | 50 | Items per page (max: 100) |
| service_type | string | No | All | Filter by service: Hotspot, PPPoE, Static |
| status | string | No | All | Filter by status: Active, Inactive, Deactivated, Expired |
| router_id | integer | No | All | Filter by router ID |
| search | string | No | Search by name, phone, username, or email | |
| apartment_id | integer | No | Filter by apartment building | |
| order_by | string | No | created_at | Sort by: username, fullname, created_at, expiration |
| order_direction | string | No | desc | asc or desc |
curl -X GET "https://alternetispbilling.com/api/v1/customers?page=1&per_page=50&service_type=PPPoE&status=Active" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Accept: application/json"
Response:
{
"success": true,
"message": "Customers retrieved successfully",
"data": {
"current_page": 1,
"data": [
{
"id": 123,
"username": "CUST001",
"fullname": "John Doe",
"email": "john@example.com",
"phonenumber": "254712345678",
"address": "123 Main Street, Kabul",
"service_type": "PPPoE",
"status": "Active",
"pppoe_username": "johndoe",
"pppoe_ip": "192.168.1.100",
"mac_address": "D4:CA:6D:9B:45:01",
"created_at": "2024-01-01 10:00:00",
"active_package": {
"id": 40,
"customer_id": 72,
"plan_id": 222,
"recharged_on": "2026-01-07",
"recharged_time": "23:14:00",
"expiration": "2026-02-07",
"time": "00:00:00",
"status": "on",
"type": "PPPoE",
"plan": {
"id": 222,
"name_plan": "10MBPS@1000",
"type": "PPPoE",
"enabled": 1,
"display_publicly": 1,
"isFup": 0,
"is_free_plan": 0,
"price": 1000,
"shared_users": 1,
"validity": 1,
"validity_unit": "Months",
"limit_type": "Time_Limit",
"data_limit": 0,
"data_unit": "MB"
}
}
],
"first_page_url": "https://alternetispbilling.com/api/v1/customers?page=1",
"from": 1,
"last_page": 5,
"last_page_url": "https://alternetispbilling.com/api/v1/customers?page=5",
"links": [
{"url": null, "label": "« Previous", "active": false},
{"url": "https://alternetispbilling.com/api/v1/customers?page=1", "label": "1", "active": true},
{"url": "https://alternetispbilling.com/api/v1/customers?page=2", "label": "2", "active": false},
{"url": "https://alternetispbilling.com/api/v1/customers?page=3", "label": "3", "active": false},
{"url": "https://alternetispbilling.com/api/v1/customers?page=4", "label": "4", "active": false},
{"url": "https://alternetispbilling.com/api/v1/customers?page=5", "label": "5", "active": false},
{"url": "https://alternetispbilling.com/api/v1/customers?page=2", "label": "Next »", "active": false}
],
"next_page_url": "https://alternetispbilling.com/api/v1/customers?page=2",
"path": "https://alternetispbilling.com/api/v1/customers",
"per_page": 50,
"prev_page_url": null,
"to": 50,
"total": 245
}
}
{
"success": false,
"message": "Unauthorized - Invalid API key",
"code": "AUTH_001",
"timestamp": "2024-01-15T10:30:00Z"
}
// OR rate limit error
{
"success": false,
"message": "Rate limit exceeded. Please wait 60 seconds.",
"code": "RATE_001",
"retry_after": 60,
"timestamp": "2024-01-15T10:30:00Z"
}
// OR validation error
{
"success": false,
"message": "Validation failed",
"errors": {
"per_page": ["The per page must not be greater than 100."]
},
"code": "VALID_001",
"timestamp": "2024-01-15T10:30:00Z"
}
Retrieve detailed information about a specific customer including active package, transactions, and usage data.
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | Customer ID (path parameter) |
curl -X GET "https://alternetispbilling.com/api/v1/customers/123" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Accept: application/json"
Response:
{
"success": true,
"data": {
"id": 72,
"fullname": "KiongolybenB11",
"phonenumber": "0758877699",
"service_type": "PPPoE",
"status": "Active",
"username": "AB0758877699",
"email": "KiongolybenB11@gmail.com",
"mac_address": null,
"pppoe_username": "KiongolybenB11",
"pppoe_ip": "192.168.89.239",
"address": "Thika",
"created_at": "2025-06-30T03:08:04.000000Z",
"active_packages": [
{
"id": 40,
"customer_id": 72,
"plan_id": 222,
"username": "AB0758877699",
"namebp": "10MBPS@1000",
"recharged_on": "2026-01-07",
"expiration": "2026-02-07",
"time": "00:00:00",
"status": "on",
"type": "PPPoE",
"plan": {
"id": 222,
"name_plan": "10MBPS@1000",
"type": "PPPoE",
"price": 1000,
"validity": 1,
"validity_unit": "Months",
"typebp": "Unlimited"
}
}
],
"transactions": [
{
"user_id": 72,
"plan_name": "10MBPS@1000",
"method": "M-Pesa",
"reference": "UA70N39WTH",
"amount": 1000,
"created_at": "2026-01-07T23:14:00.000000Z"
}
]
}
}
{
"success": false,
"message": "Customer not found",
"code": "CUST_404",
"timestamp": "2024-01-15T10:30:00Z"
}
// OR access denied
{
"success": false,
"message": "You don't have permission to access this customer",
"code": "PERM_001",
"timestamp": "2024-01-15T10:30:00Z"
}
Recharge a customer's subscription to extend their service. Can use existing plan or specify a new plan.
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | Customer ID |
Request Body:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| plan_id | integer | No | Current plan | Plan ID to recharge with (use current plan if not specified) |
| add_transaction | boolean | No | true | Create a transaction record for this recharge |
| send_sms | boolean | No | false | Send SMS notification to customer |
curl -X POST "https://alternetispbilling.com/api/v1/customers/123/recharge" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"plan_id": 1,
"send_sms": true,
"add_transaction": true
}'
Response:
{
"success": true,
"message": "Customer recharged successfully",
"data": {
"new_expiration": "2026-01-12",
"plan_name": "10MBPS@1000",
"customer_id": 3234,
"username": "AZSC0679"
}
}
{
"success": false,
"message": "Failed to recharge customer: Customer not found",
"code": "CUST_404",
"timestamp": "2024-01-15T10:30:00Z"
}
Important Notes:
- If no plan_id is provided, uses customer's current plan
- Automatically calculates expiration based on plan validity
- Updates customer status to "Active" if not already
- Syncs changes with Mikrotik router automatically
Create a new customer with service plan. Supports PPPoE and Static IP services.
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
| fullname R | string | Yes | Customer's full name (3-45 chars) |
| phonenumber R | string | Yes | Phone number (digits only) |
| service_type R | string | Yes | Hotspot, PPPoE, or Static |
| plan_id R | integer | Yes | Plan ID from available plans |
| router_id R | integer | Yes | Router ID where customer will be added |
| password R | string | Yes | Password (min 3 chars) |
| string | No | Email address | |
| address | string | No | Physical address |
| pppoe_username | string | For PPPoE | PPPoE username (3-32 chars, unique) |
| pppoe_password | string | For PPPoE | PPPoE password (3-32 chars) |
{
"fullname": "KlybenB11",
"phonenumber": "07XXXXXXXX",
"service_type": "PPPoE",
"username": "AB0758877699",
"email": "Ki11@gmail.com",
"mac_address": null,
"pppoe_username": "KlybenB",
"pppoe_ip": "192.168.89.239",
"address": "Thika",
"plan_id": 222,
"router_id": 50,
"password": "123456",
"pppoe_password": "123456"
}
{
"fullname": "KinB11",
"phonenumber": "07XXXXXXXX",
"service_type": "Static",
"username": "AB0799",
"email": "KinB11@gmail.com",
"mac_address": null,
"pppoe_ip": "192.168.89.239",
"address": "Thika",
"plan_id": 222,
"router_id": 50,
"password": "123456"
}
Response:
{
"success": true,
"message": "Customer created successfully",
"data": {
"customer_id": 3284,
"username": "AB07XXXXXXXX",
"pppoe_username": "KiWERlybenB",
"expiration_date": "2026-02-11"
}
}
Update customer details. Changing username/PPPoE credentials will sync with Mikrotik.
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
| fullname | string | No | Customer's full name |
| phonenumber | string | No | Phone number |
| string | No | Email address | |
| address | string | No | Physical address |
| status | string | No | Active, Inactive, Deactivated |
| password | string | No | New password (will sync with device) |
| pppoe_username | string | No | New PPPoE username (will sync with device) |
| pppoe_password | string | No | New PPPoE password (will sync with device) |
curl -X PUT "https://alternetispbilling.com/api/v1/customers/123" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"fullname": "KiongolybenB11",
"phonenumber": "07XXXXXXXX",
"service_type": "PPPoE",
"username": "AB07XXXXXXXX",
"email": "Ki11@gmail.com",
"mac_address": null,
"pppoe_username": "KioybenB",
"pppoe_ip": "192.168.89.239",
"address": "Thika",
"plan_id": 222,
"router_id": 50,
"password": "123456",
"pppoe_password": "123456"
}'
Response:
{
"success": true,
"message": "Customer updated successfully"
}
Immediately suspend customer service. Removes from Mikrotik and sets status to Deactivated.
curl -X POST "https://alternetispbilling.com/api/v1/customers/123/suspend" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"notes": "Suspended via ERP system"
}'
Response:
{
"success": true,
"message": "Customer service suspended successfully"
}
Reactivate a suspended customer. Re-syncs with Mikrotik and sets status to Active.
curl -X POST "https://alternetispbilling.com/api/v1/customers/123/activate" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"notes": "Payment received, service restored"
}'
Response:
{
"success": true,
"message": "Customer service activated successfully"
}
Retrieve all available service plans filtered by type, router, or status.
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| service_type | string | No | Filter by: Hotspot, PPPoE, Static |
| router_id | integer | No | Filter by router |
| enabled | boolean | No | Filter by enabled status |
| is_fup | boolean | No | Filter FUP plans only |
curl -X GET "https://alternetispbilling.com/api/v1/plans?service_type=PPPoE&enabled=true" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Accept: application/json"
Response:
{
"success": true
}
Retrieve transaction history with filtering and pagination.
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| customer_id | integer | No | Filter by customer |
| type | string | No | Filter by type: Recharge, Payment, Refund, Adjustment |
| start_date | date | No | Start date (YYYY-MM-DD) |
| end_date | date | No | End date (YYYY-MM-DD) |
| min_amount | number | No | Minimum amount |
| max_amount | number | No | Maximum amount |
curl -X GET "https://alternetispbilling.com/api/v1/transactions?start_date=2024-01-01&end_date=2024-01-15&type=Recharge" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Accept: application/json"
Response:
{
"success": true,
"data": {
"current_page": 1,
"data": [
{
"customer_id": 2485,
"plan_name": "6 Hrs",
"method": "M-Pesa",
"reference": "UADOO3M38B",
"amount": 30,
"created_at": "2026-01-13T14:55:08.000000Z"
}
],
"total": 245,
"summary": {
"total_amount": "240206.00",
"total_count": 6150,
"today_amount": 0
}
}
}
Create a new bandwidth profile for rate limiting customers.
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
| name_bw R | string | Yes | Bandwidth profile name (max 255 chars, unique) |
| rate_down R | number | Yes | Download rate value |
| rate_down_unit R | string | Yes | Kbps or Mbps |
| rate_up R | number | Yes | Upload rate value |
| rate_up_unit R | string | Yes | Kbps or Mbps |
curl -X POST "https://alternetispbilling.com/api/v1/bandwidths" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name_bw": "10Mbps Business",
"rate_down": 10,
"rate_down_unit": "Mbps",
"rate_up": 10,
"rate_up_unit": "Mbps"
}'
Response:
{
"success": true,
"message": "Bandwidth profile created successfully",
"data": {
"id": 5,
"adminId": 1,
"name_bw": "10Mbps Business",
"rate_down": 10,
"rate_down_unit": "Mbps",
"rate_up": 10,
"rate_up_unit": "Mbps",
"isDeleted": 0,
"created_at": "2024-01-15 15:00:00",
"updated_at": "2024-01-15 15:00:00"
}
}
Update an existing bandwidth profile.
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | Bandwidth profile ID |
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
| name_bw | string | No | Bandwidth profile name |
| rate_down | number | No | Download rate value |
| rate_down_unit | string | No | Kbps or Mbps |
| rate_up | number | No | Upload rate value |
| rate_up_unit | string | No | Kbps or Mbps |
curl -X PUT "https://alternetispbilling.com/api/v1/bandwidths/5" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name_bw": "15Mbps Business",
"rate_down": 15,
"rate_up": 15
}'
Response:
{
"success": true,
"message": "Bandwidth profile updated successfully",
"data": {
"id": 5,
"adminId": 1,
"name_bw": "15Mbps Business",
"rate_down": 15,
"rate_down_unit": "Mbps",
"rate_up": 15,
"rate_up_unit": "Mbps",
"isDeleted": 0,
"updated_at": "2024-01-15 15:05:00"
}
}
Delete a bandwidth profile (soft delete). Cannot delete if in use by active plans.
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | Bandwidth profile ID |
curl -X DELETE "https://alternetispbilling.com/api/v1/bandwidths/5" \
-H "X-API-Key: YOUR_API_KEY"
Response:
{
"success": true,
"message": "Bandwidth profile deleted successfully"
}
Note:
Cannot delete bandwidth profiles that are currently being used by active plans.
Retrieve a paginated list of vouchers with various filters.
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | No | Page number |
| per_page | integer | No | Items per page (max: 50) |
| search | string | No | Search by voucher code |
| status | integer | No | 0=active, 1=used |
| router_id | integer | No | Filter by router |
| plan_id | integer | No | Filter by plan |
| type | string | No | Hotspot |
curl -X GET "https://alternetispbilling.com/api/v1/vouchers?status=0&type=Hotspot&per_page=20" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Accept: application/json"
Response:
{
"success": true,
"data": {
"current_page": 1,
"data": [
{
"id": 891,
"type": "Hotspot",
"id_plan": 539,
"code": "1842",
"client": "E86F384AF8",
"status": "1",
"used_date": "2026-01-12 10:14:43",
"created_at": "2026-01-12T10:13:33.000000Z"
}
],
"total": 50
}
}
Generate one or more vouchers with specified properties.
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
| type R | string | Yes | Hotspot or PPPOE |
| router_id R | integer | Yes | Router ID |
| plan_id R | integer | Yes | Plan ID |
| numbervoucher R | integer | Yes | Number of vouchers to generate (1-100) |
| voucher_format R | string | Yes | numbers, up, low, rand |
| lengthcode R | integer | Yes | Code length (2-10) |
| clientsCount R | integer | Yes | Number of clients allowed (1-99999) |
| customer_id | integer | No | Assign to specific customer |
curl -X POST "https://alternetispbilling.com/api/v1/vouchers" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "Hotspot",
"router_id": 1,
"plan_id": 3,
"numbervoucher": 10,
"voucher_format": "rand",
"lengthcode": 8,
"clientsCount": 1,
"customer_id": null
}'
Response:
{
"success": true,
"message": "10 voucher(s) generated successfully",
"data": {
"vouchers": [
{
"code": "I6CRYPLM",
"id": 893
},
{
"code": "ZKVH2IW2",
"id": 894
},
{
"code": "O3G6QEHA",
"id": 895
},
{
"code": "NR0H0SG4",
"id": 896
},
{
"code": "TWBZ5EAW",
"id": 897
},
{
"code": "PGQP2UU3",
"id": 898
},
{
"code": "2RYVWCS0",
"id": 899
},
{
"code": "XA9QKEBH",
"id": 900
},
{
"code": "0IN2AMXR",
"id": 901
},
{
"code": "CNTWXLU8",
"id": 902
}
],
"plan_name": "3 Hours",
"router_name": "ThikaAP1"
}
}
Delete multiple vouchers at once.
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
| voucher_ids R | array | Yes | Array of voucher IDs to delete |
curl -X DELETE "https://alternetispbilling.com/api/v1/vouchers/bulk/delete" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"voucher_ids": [101, 102, 103]
}'
Response:
{
"success": true,
"message": "3 voucher(s) deleted successfully"
}
Create a new service plan for Hotspot, PPPoE, or Static IP services.
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
| name_plan R | string | Yes | Plan name (max 40 chars) |
| type R | string | Yes | Hotspot, PPPoE, or Static |
| id_bw R | integer | Yes | Bandwidth profile ID |
| price R | number | Yes | Plan price (min: 0) |
| validity R | integer | Yes | Validity period (min: 1) |
| validity_unit R | string | Yes | Mins, Hrs, Days, Months, Period |
| router_id | integer | Yes | Router ID |
| typebp | string | No | Unlimited or Limited (default: Unlimited) |
| limit_type | string | For Limited | Time_Limit, Data_Limit, or Both_Limit |
| time_limit | integer | For Time_Limit | Time limit value |
| data_limit | integer | For Data_Limit | Data limit value |
| pool | integer | For PPPoE/Static | IP pool ID |
{
"name_plan": "Monthly Unlimited",
"type": "Hotspot",
"id_bw": 1,
"price": 1500.00,
"validity": 30,
"validity_unit": "Days",
"router_id": 1,
"typebp": "Unlimited",
"enabled": true,
"display_publicly": true
}
{
"name_plan": "Daily 5GB",
"type": "Hotspot",
"id_bw": 2,
"price": 100.00,
"validity": 1,
"validity_unit": "Days",
"router_id": 1,
"typebp": "Limited",
"limit_type": "Data_Limit",
"data_limit": 5,
"data_unit": "GB",
"enabled": true
}
{
"name_plan": "Business 50Mbps",
"type": "PPPoE",
"id_bw": 3,
"price": 5000.00,
"validity": 30,
"validity_unit": "Days",
"router_id": 1,
"pool": 1,
"typebp": "Unlimited",
"shared_users": 5,
"enabled": true
}
Response:
{
"success": true,
"message": "Plan created successfully",
"data": {
"plan_id": 676,
"name": "Monthly Unlimited",
"type": "Hotspot",
"price": 1500,
"validity": "30 Days"
}
}
Update an existing service plan.
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | Plan ID |
Request Body:
| Field | Type | Description |
|---|---|---|
| name_plan | string | Plan name |
| id_bw | integer | Bandwidth profile ID |
| price | number | Plan price |
| validity | integer | Validity period |
| validity_unit | string | Validity unit |
| typebp | string | Unlimited or Limited |
| enabled | boolean | Enable/disable plan |
| display_publicly | boolean | Show in public portal |
curl -X PUT "https://alternetispbilling.com/api/v1/plans/10" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name_plan": "Monthly Unlimited Pro",
"price": 1800.00,
"enabled": true,
"display_publicly": true
}'
Response:
{
"success": true,
"message": "Plan updated successfully",
"data": {
"id": 10,
"name_plan": "Monthly Unlimited Pro",
"type": "Hotspot",
"price": 1800.00,
"validity": 30,
"validity_unit": "Days",
"enabled": true,
"updated_at": "2024-01-15 15:10:00"
}
}
Create a copy of an existing plan, optionally with a different router.
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | Original plan ID |
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
| new_name R | string | Yes | Name for the duplicated plan |
| router_id | integer | No | Router ID for the new plan (default: same as original) |
curl -X POST "https://alternetispbilling.com/api/v1/plans/10/duplicate" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"new_name": "Monthly Unlimited - Backup",
"router_id": 2
}'
Response:
{
"success": true,
"message": "Plan duplicated successfully",
"data": {
"original_plan_id": 10,
"new_plan_id": 11,
"new_name": "Monthly Unlimited - Backup"
}
}
Retrieve hotspot access logs with filtering and statistics.
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | No | Page number |
| per_page | integer | No | Items per page (default: 50) |
| router_id | integer | No | Filter by router ID |
| device | string | No | Filter by device type |
| from_date | date | No | Start date (YYYY-MM-DD, default: today) |
| to_date | date | No | End date (YYYY-MM-DD, default: today) |
| type | string | No | Filter by log type |
| mac_address | string | No | Filter by MAC address |
curl -X GET "https://alternetispbilling.com/api/v1/hotspot-access-logs?from_date=2024-01-15&to_date=2024-01-15&router_id=1&type=accessed" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Accept: application/json"
Response:
{
"success": true,
"data": {
"current_page": 1,
"data": [
{
"id": 1001,
"routerId": 1,
"routerName": "Main Router",
"mac_address": "D4:CA:6D:9B:45:01",
"username": "CUST001",
"fullname": "John Doe",
"device": "Android Phone",
"type": "accessed",
"created_at": "2024-01-15 14:30:00"
}
],
"total": 125
},
"statistics": {
"total": 125,
"accessed": 85,
"triggered_payment": 25,
"got_login_credentials": 10,
"logged_in": 80,
"failed_to_log_in": 5
},
"date_range": {
"from": "2024-01-15",
"to": "2024-01-15"
}
}
Complete API Reference
| Method | Endpoint | Description | Authentication |
|---|---|---|---|
| GET | /api/v1/customers | List all customers with filters | Required |
| POST | /api/v1/customers | Create new customer | Required |
| GET | /api/v1/customers/{id} | Get customer details | Required |
| PUT | /api/v1/customers/{id} | Update customer | Required |
| DELETE | /api/v1/customers/{id} | Delete customer (soft delete) | Required |
| POST | /api/v1/customers/{id}/recharge | Recharge subscription | Required |
| POST | /api/v1/customers/bulk/recharge | Bulk recharge multiple customers | Required |
| POST | /api/v1/customers/{id}/suspend | Suspend service | Required |
| POST | /api/v1/customers/{id}/activate | Activate service | Required |
| GET | /api/v1/plans | List available plans | Required |
| GET | /api/v1/routers | List routers | Required |
| GET | /api/v1/bandwidths | List bandwidth profiles | Required |
| GET | /api/v1/pools | List IP pools | Required |
| GET | /api/v1/transactions | List transactions | Required |
| GET | /api/v1/bandwidths | List bandwidth profiles | Required |
| POST | /api/v1/bandwidths | Create bandwidth profile | Required |
| PUT | /api/v1/bandwidths/{id} | Update bandwidth profile | Required |
| DELETE | /api/v1/bandwidths/{id} | Delete bandwidth profile | Required |
| GET | /api/v1/vouchers | List vouchers | Required |
| POST | /api/v1/vouchers | Create vouchers | Required |
| DELETE | /api/v1/vouchers/{id} | Delete voucher | Required |
| DELETE | /api/v1/vouchers/bulk/delete | Bulk delete vouchers | Required |
| POST | /api/v1/plans | Create service plan | Required |
| PUT | /api/v1/plans/{id} | Update service plan | Required |
| DELETE | /api/v1/plans/{id} | Delete service plan | Required |
| POST | /api/v1/plans/{id}/duplicate | Duplicate service plan | Required |
| POST | /api/v1/plans/{id}/sync | Sync plan with router | Required |
| GET | /api/v1/hotspot-access-logs | List hotspot access logs | Required |
Response Codes:
- 200: Success
- 201: Created
- 400: Bad Request
- 401: Unauthorized
- 403: Forbidden
- 404: Not Found
- 429: Too Many Requests
- 500: Server Error
API Pricing Plans
Free Tier
Perfect for testing
- 100 requests per month
- 60 requests/minute rate limit
- Customer read access
- Basic statistics
Professional
For growing businesses
- 10,000 requests per month
- 300 requests/minute rate limit
- Full customer management
- Email support
- $0.01 per additional request
Enterprise
For large-scale operations
- Unlimited requests
- 1000 requests/minute rate limit
- Priority support
- SLA guarantee (99.9%)
- Custom integrations
- Advanced analytics