Agents
Agents are field operators who provide cash-in/cash-out services to subscribers. SmartPay supports a hierarchical agent network with super-agents and sub-agents.
Agent Hierarchy
Regional managers
- Register sub-agents
- Fund sub-agent float
- View network performance
- Higher commission tier
Field agents
- Process cash-in/cash-out
- Receive float from super-agent
- Earn per-transaction commission
- Mobile-based operations
Endpoints
POST /api/v1/agents
Register new super/sub agent
GET /api/v1/agents/{id}
Get agent details
GET /api/v1/agents
List agents with filters
GET /api/v1/agents/lookup
Find agent by phone number
POST /api/v1/agents/{id}/fund
Add float to agent account
POST /api/v1/agents/cashin
Credit subscriber wallet
POST /api/v1/agents/transfer
Transfer to sub-agent
GET /api/v1/agents/{id}/balance
Check agent float balance
Agent Object
{
"id": "agent_abc123",
"type": "super_agent",
"business_name": "ABC Money Services",
"first_name": "John",
"last_name": "Doe",
"phone_number": "+23277123456",
"email": "john@abcmoney.sl",
"location": "Freetown",
"status": "active",
"float_balance": 5000000,
"float_balance_formatted": "5,000,000.00 SLE",
"commission_tier": "standard",
"settlement_mode": "instant",
"parent_agent_id": null,
"sub_agent_count": 12,
"created_at": "2025-01-01T10:00:00Z"
}
Agent Status
Can process transactions
Temporarily disabled
Permanently deactivated
Agent Lifecycle
Admin or super-agent registers new agent with business details
System creates agent account and user credentials
SmartPay or super-agent adds initial float balance
Agent processes cash-in/cash-out for subscribers
Agent settles with SmartPay or super-agent periodically
Cash-In Flow
Customer brings cash to agent location
Agent looks up subscriber by phone or card
Agent enters amount and PIN to process
Agent float debited, subscriber credited
Both receive WhatsApp notification
Commission Structure
| Agent Type | Cash-In | Cash-Out |
|---|---|---|
| Super-Agent | 0.3% | 0.5% |
| Sub-Agent | 0.2% | 0.3% |
Commission is earned from fees charged to subscribers and credited instantly to agent balance.
Common Workflows
Register New Sub-Agent
- Super-agent logs into dashboard
- Navigate to Agent Management
- Call
POST /api/v1/agentswithagent_type: "sub_agent" - Include
parent_agent_idreferencing super-agent - New agent receives credentials via WhatsApp
Fund Sub-Agent Float
- Super-agent checks own balance
- Call
POST /api/v1/agents/{sub_agent_id}/fund - Amount transferred from super to sub-agent
- Both balances updated atomically
Process Customer Cash-In
- Agent looks up subscriber by phone
- Collects cash from customer
- Call
POST /api/v1/agents/cashin - Agent float decreases, subscriber wallet increases
- Commission credited to agent
Permissions
| Role | Can Register | Can Fund | Can View |
|---|---|---|---|
| System Admin | Super + Sub | Any agent | All |
| Super-Agent | Sub only | Own sub-agents | Own network |
| Sub-Agent | None | None | Own profile |