Appearance
User - Inventory
Base URL:
https://your-domain.com
Admin endpoints for managing inventory items. All endpoints require admin/staff authentication.
Fetch All Inventory
Retrieve all inventory items.
| Property | Value |
|---|---|
| Endpoint | Fetch All Inventory |
| Method | GET |
| URL | /api/v1/inventory |
| 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": "Router",
"type": "equipment",
"quantity": 10,
"assigned": 5,
"available": 5
}
]
}Fetch Inventory Item
Retrieve details of a specific inventory item.
| Property | Value |
|---|---|
| Endpoint | Fetch Inventory Item |
| Method | GET |
| URL | /api/v1/inventory/{id} |
| Authentication | Bearer Token |
Success Response (200 OK):
json
{
"success": true,
"data": {
"id": 1,
"name": "Router",
"type": "equipment",
"quantity": 10,
"assigned": 5,
"available": 5,
"unit_price": 2500
}
}Create Inventory Item
Add a new inventory item.
| Property | Value |
|---|---|
| Endpoint | Create Inventory Item |
| Method | POST |
| URL | /api/v1/inventory |
| Authentication | Bearer Token |
Request Body:
json
{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"name": "Router",
"type": "equipment",
"quantity": 10
}| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Item name |
type | string | Yes | Item type |
quantity | integer | Yes | Initial quantity |
Success Response (201 Created):
json
{
"success": true,
"message": "Inventory item created successfully",
"data": {
"id": 1
}
}Update Inventory Item
Update an existing inventory item.
| Property | Value |
|---|---|
| Endpoint | Update Inventory Item |
| Method | PUT |
| URL | /api/v1/inventory/{id} |
| Authentication | Bearer Token |
Request Body:
json
{
"quantity": 15
}Success Response (200 OK):
json
{
"success": true,
"message": "Inventory item updated successfully"
}Delete Inventory Item
Delete an inventory item.
| Property | Value |
|---|---|
| Endpoint | Delete Inventory Item |
| Method | DELETE |
| URL | /api/v1/inventory/{id} |
| Authentication | Bearer Token |
Success Response (200 OK):
json
{
"success": true,
"message": "Inventory item deleted successfully"
}Assign Inventory
Assign an inventory item to a subscriber.
| Property | Value |
|---|---|
| Endpoint | Assign Inventory |
| Method | POST |
| URL | /api/v1/inventory/{id}/assign |
| Authentication | Bearer Token |
Request Body:
json
{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"subscriber_id": 1
}Success Response (200 OK):
json
{
"success": true,
"message": "Inventory assigned successfully"
}Unassign Inventory
Remove inventory assignment from a subscriber.
| Property | Value |
|---|---|
| Endpoint | Unassign Inventory |
| Method | POST |
| URL | /api/v1/inventory/{id}/unassign |
| Authentication | Bearer Token |
Request Body:
json
{
"isp_id": 1,
"branch_id": 1,
"user_id": 1
}Success Response (200 OK):
json
{
"success": true,
"message": "Inventory unassigned successfully"
}