Staff Management
All routes under /api/v1/staff require authentication + Owner role.
Roles
| Role | Description |
|---|---|
staff | Regular employee |
owner | Business owner |
Employment Statuses
| Status | Description |
|---|---|
active | Currently employed |
on_leave | Temporarily absent |
inactive | Deactivated |
Shifts
| Shift | Description |
|---|---|
morning | Morning shift |
evening | Evening shift |
full_day | Full day |
weekend | Weekend shift |
GET /staff
List staff with filtering.
Auth: Required + Owner
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
search | string | Search by name/phone |
role | string | Filter by role |
status | string | Employment status |
shift | string | Filter by shift |
ordering | string | Sort order |
page | int | Page number |
size | int | Items per page |
include_stats | boolean | Include performance stats |
Response:
{
"success": true,
"data": {
"items": [ ... ],
"total": 10
}
}POST /staff
Create a new staff member. Temporary password sent via SMS.
Auth: Required + Owner
Request Body:
{
"first_name": "Jane",
"last_name": "Smith",
"phone": "+255712345679",
"email": "jane@example.com",
"role": "staff",
"store_id": "uuid",
"shift": "morning",
"employment_status": "active",
"avatar_hue": 180,
"pin": "1234",
"can_refund": false,
"can_discount": true,
"can_view_reports": false
}Response: StaffResponse object.
GET /staff/kpis
Get store-level staff KPIs.
Auth: Required + Owner
Response:
{
"success": true,
"data": {
"total_staff": 10,
"active_today": 8,
"total_sales_today": 1250000,
"average_sales_per_staff": 156250
}
}GET /staff/:id
Get a single staff member.
Auth: Required + Owner
PATCH /staff/:id
Update a staff member. All fields optional.
Auth: Required + Owner
DELETE /staff/:id
Deactivate a staff member.
Auth: Required + Owner
Response (200):
{
"success": true,
"data": {
"deactivated": true
}
}GET /staff/:id/stats
Get per-cashier performance stats.
Auth: Required + Owner
Response:
{
"success": true,
"data": {
"total_sales": 2500000,
"transaction_count": 85,
"average_ticket": 29412,
"refund_count": 2,
"discount_total": 15000
}
}GET /staff/:id/activity
Get daily activity log.
Auth: Required + Owner
Query: date (YYYY-MM-DD)
Response:
{
"success": true,
"data": {
"date": "2024-01-15",
"items": [
{
"type": "sale",
"time": "09:15:00",
"description": "Sale #1234 - TZS 15,000"
}
]
}
}PATCH /staff/:id/shift
Update shift assignment.
Auth: Required + Owner
Request Body:
{
"shift": "evening",
"employment_status": "active"
}PATCH /staff/:id/permissions
Update POS permissions.
Auth: Required + Owner
Request Body:
{
"can_refund": true,
"can_discount": true,
"can_view_reports": false
}