Session-based internal API for inventory, analytics, and admin controls.
Login first, then reuse the session cookie for all protected endpoints.
curl -sS -c cookie.txt -X POST https://inventory.ahmaddalao.com/api/auth/login \
-H 'Content-Type: application/json' \
-d '{"email":"admin@ahmaddalao.com","password":"YOUR_PASSWORD"}'
| Method | Path | Description |
|---|---|---|
| GET | /api/health | Health check |
| POST | /api/auth/login | Login |
| POST | /api/auth/logout | Logout |
| GET | /api/auth/me | Current user |
| GET | /api/meta/options | Items, storage areas, settings, capabilities |
| GET | /api/dashboard/summary | KPI summary + low stock |
| GET | /api/dashboard/analytics | Trend and analysis datasets |
| GET | /api/settings | Read settings |
| PATCH | /api/settings | Update settings (site, theme, notifications, policy) |
| GET | /api/trash | List deleted items and storage areas (owner/manager) |
| POST | /api/trash/{entity}/{id}/restore | Restore deleted item/storage area |
| DELETE | /api/trash/{entity}/{id} | Owner-only permanent delete from trash |
| GET | /api/audit-logs | Owner-only write audit trail |
| GET | /api/admin/users | List users (owner). Filters: search, role, limit |
| POST | /api/admin/users | Create user (owner) |
| PATCH | /api/admin/users/{id} | Update user (owner) |
| GET | /api/storage-areas | List storage areas |
| POST | /api/storage-areas | Create storage area |
| PATCH | /api/storage-areas/{id} | Update storage area |
| DELETE | /api/storage-areas/{id} | Delete storage area |
| GET | /api/items | List items |
| POST | /api/items | Create item |
| PATCH | /api/items/{id} | Update item |
| DELETE | /api/items/{id} | Delete item |
| GET | /api/inventory/levels | Inventory matrix |
| GET | /api/inventory/movements | Movement history |
| POST | /api/inventory/movements | Apply movement |
curl -sS -b cookie.txt -X POST https://inventory.ahmaddalao.com/api/items \
-H 'Content-Type: application/json' \
-d '{
"sku":"PRD-1001",
"name":"Thermal Paper Roll",
"category":"Supplies",
"unit":"roll",
"reorder_level":30,
"is_active":true
}'
curl -sS -b cookie.txt -X POST https://inventory.ahmaddalao.com/api/inventory/movements \
-H 'Content-Type: application/json' \
-d '{
"movement_type":"transfer",
"item_id":1,
"from_storage_area_id":1,
"to_storage_area_id":2,
"quantity":12,
"reference":"TR-2026-004",
"note":"Rebalance for showroom"
}'