Wallet
The Wallet API provides core financial operations for SmartPay accounts. All monetary operations are atomic and recorded in the transaction ledger.
Key Features
Instant balance queries with PIN verification
Send money to any subscriber by card
Complete audit trail of all operations
Endpoints
POST /api/v1/wallet/balance/{id}
Get current wallet balance (PIN required)
POST /api/v1/wallet/transactions/{id}
Get transaction history
POST /api/v1/wallet/transfer-p2p
Send money by card serial
POST /api/v1/wallet/transfer
Transfer between accounts
POST /api/v1/wallet/fund-from-vult
Top up from VULT wallet
POST /api/v1/wallet/account-statement
Generate PDF/CSV statement
Transaction Types
| Type | Description | Direction |
|---|---|---|
transfer_p2p | Person to person transfer | Debit/Credit |
agent_cashin | Cash deposit via agent | Credit |
agent_cashout | Cash withdrawal via agent | Debit |
pos_payment | POS terminal purchase | Debit |
vult_fund | Funding from VULT | Credit |
vult_transfer | Transfer to VULT | Debit |
fee | Transaction fee | Debit |
reversal | Transaction reversal | Credit/Debit |
Transaction Object
{
"id": "txn_abc123",
"type": "transfer_p2p",
"status": "completed",
"amount": 5000000,
"amount_formatted": "50,000.00 SLE",
"fee": 75000,
"fee_formatted": "750.00 SLE",
"currency": "SLE",
"direction": "debit",
"counterparty": {
"id": "sub_xyz789",
"name": "Jane Smith",
"card_serial": "OLIV0002"
},
"balance_after": 12500000,
"memo": "Payment for services",
"created_at": "2025-01-15T10:30:00Z"
}
Transfer Flow
Sender provides recipient card serial, amount, and PIN
- Verify sender PIN
- Check sender balance (amount + fee)
- Validate recipient exists and is active
- Run compliance checks
Atomic operation:
- Debit sender (amount + fee)
- Credit recipient (amount)
- Record fee
Both parties receive WhatsApp confirmation
Balance Security
Balance queries require PIN verification to prevent unauthorized access.
All balance and history queries need 4-digit PIN
Failed PIN attempts are tracked and limited
Common Workflows
Send Money to Friend
- Get recipient's card serial number
- Call
POST /api/v1/wallet/transfer-p2p - Include sender ID, recipient card, amount, PIN
- Both parties receive WhatsApp notifications
Check Balance
- Call
POST /api/v1/wallet/balance/{subscriber_id} - Include PIN in request body
- Returns current balance and currency
View Transaction History
- Call
POST /api/v1/wallet/transactions/{subscriber_id} - Include PIN, limit, and offset
- Returns paginated transaction list
Generate Statement
- Call
POST /api/v1/wallet/account-statement - Specify date range and format (PDF/CSV)
- Returns download URL for statement file
Fees
Transaction fees are configured per transaction type. See Fee Settings for configuration.
| Transaction | Default Fee |
|---|---|
| P2P Transfer | 1.5% (sender) |
| Agent Cash-In | 0.5% (agent) |
| POS Payment | 1.0% (processor) |
| VULT Fund | 0% |