Appearance
User - Branches
Base URL:
https://your-domain.com
Admin endpoints for managing ISP branches. All endpoints require admin authentication.
Fetch All Branches
Retrieve all branches for the ISP.
| Property | Value |
|---|---|
| Endpoint | Fetch All Branches |
| Method | GET |
| URL | /api/v1/branches |
| Authentication | Bearer Token |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer your-auth-token | Yes |
Success Response (200 OK):
json
{
"success": true,
"data": [
{
"id": 1,
"name": "Main Branch",
"address": "123 Main Street",
"subscriber_count": 250,
"user_count": 10
}
]
}Fetch Branch
Retrieve details of a specific branch.
| Property | Value |
|---|---|
| Endpoint | Fetch Branch |
| Method | GET |
| URL | /api/v1/branches/{id} |
| Authentication | Bearer Token |
Success Response (200 OK):
json
{
"success": true,
"data": {
"id": 1,
"name": "Main Branch",
"address": "123 Main Street",
"phone": "01712345678",
"subscriber_count": 250,
"user_count": 10
}
}Create Branch
Create a new branch.
| Property | Value |
|---|---|
| Endpoint | Create Branch |
| Method | POST |
| URL | /api/v1/branches |
| Authentication | Bearer Token |
Request Body:
json
{
"isp_id": 1,
"user_id": 1,
"name": "New Branch",
"address": "456 New Street"
}| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Branch name |
address | string | No | Branch address |
Success Response (201 Created):
json
{
"success": true,
"message": "Branch created successfully",
"data": {
"id": 2
}
}Update Branch
Update an existing branch.
| Property | Value |
|---|---|
| Endpoint | Update Branch |
| Method | PUT |
| URL | /api/v1/branches/{id} |
| Authentication | Bearer Token |
Request Body:
json
{
"name": "Updated Branch"
}Success Response (200 OK):
json
{
"success": true,
"message": "Branch updated successfully"
}Delete Branch
Delete a branch from the system.
| Property | Value |
|---|---|
| Endpoint | Delete Branch |
| Method | DELETE |
| URL | /api/v1/branches/{id} |
| Authentication | Bearer Token |
Success Response (200 OK):
json
{
"success": true,
"message": "Branch deleted successfully"
}Error Response (400 Bad Request):
json
{
"success": false,
"message": "Cannot delete branch with active subscribers"
}