Appearance
Wallet top-up and withdrawal
Who: listener (top-up, transfer); creator (earnings withdrawal); staff (approval, payouts, refunds); system (webhooks, sweeps, payouts).
Entry points
| Kind | Entry |
|---|---|
| REST (wallet) | GET /wallet, GET /wallet/transactions, GET /wallet/limits, GET /wallet/statement.csv, GET /receipts, GET /receipts/:id |
| REST (top-up) | POST /wallet/top-ups (Idempotency-Key), GET/POST /wallet/funding-account, GET /payments/:id, POST /payments/:id/refresh, /cancel, /store-purchase |
| REST (transfer) | POST /wallet/transfers (Idempotency-Key) |
| REST (withdraw) | GET /wallet/banks, GET/POST /me/bank-accounts, POST /me/bank-accounts/:id/default, DELETE /me/bank-accounts/:id, GET /profiles/:profileId/earnings, .../earnings/transactions, .../earnings/statement.csv, GET/POST /profiles/:profileId/withdrawals, POST /me/withdrawals/:id/cancel |
| REST (KYC) | POST /verifications/kyc/bvn, POST /verifications/kyc/id-document, GET /me/verification |
| Webhook | POST /webhooks/payments/hyparrow |
| Staff | /staff/withdrawals…, /staff/payout-batches…, /staff/payments/:id/refund, /manual-refund-done, /staff/reconciliation/…, /staff/payment-webhooks/… |
| Deep link | wallet, walletTopUp, bankAccounts, receipt, studioEarnings, studioPayout, verifyIdentity |
Flow: card top-up
POST /wallet/top-ups { amount, method: "card" }→ paymentrequires_actionwithcheckoutUrl(Hyparrow invoice).- The person pays on Hyparrow checkout. Webhook
checkout.payment.completedis verified, deduped and stored, thenwallet.webhook-processreads the invoice back and settles.wallet.payments-sweep(5 min) catches missed webhooks. - Settled → ledger
provider_clearing → user_wallet→ receipt →wallet.payment.succeeded→ notificationpayment.receipt(emailwallet.topup).
Flow: bank transfer to a virtual account
POST /wallet/funding-account { bvn, firstName, lastName, … }→ 201active(account number) or 202pending(number arrives bycustomer.account.*webhook). BVN is passed through, never stored.- Any transfer into that account arrives as
customer.transaction.completed→ a top-up net of the deposit fee → receipt. - One-off transfer:
POST /wallet/top-ups { method: "bank_transfer" }returnstransferAccount.
Flow: withdrawal
- Creator verifies identity (tier
bvnorid), addsPOST /me/bank-accounts(name from bank inquiry; notificationwallet.bank_account_added). POST /profiles/:profileId/withdrawals { bankAccountId, amount }→ amount reserved inpayout_clearing; statusrequested, oron_holdfor a new bank account, a large amount or a first withdrawal. Notificationwallet.withdrawal_requested/wallet.withdrawal_on_hold.- Staff
POST /staff/withdrawals/:id/approve(orreject, returning the earnings) →approved. wallet.payouts-run(hourly) batches approved withdrawals → Hyparrow transfer →processing;wallet.payouts-poll(10 min) andtransfer.*webhooks →paidorfailed(reversed). Eventwallet.withdrawal.status_changed.wallet.reconcileruns ledger integrity and provider reconciliation daily.
Exit states
| State | Code | Actions | Client next |
|---|---|---|---|
| Balance credited | — | — | Refresh GET /wallet, show receipt |
| Provider down | PAYMENT_PROVIDER_FAILED | retry | Retry with the same key |
| Out of range / over limit | WALLET_AMOUNT_OUT_OF_BOUNDS, WALLET_LIMIT_EXCEEDED | verify_identity | Verify to raise limits |
| Velocity | WALLET_VELOCITY_EXCEEDED | wait | — |
| Frozen | LEDGER_ACCOUNT_FROZEN | contact_support | — |
| VA pending / down / rejected | WALLET_FUNDING_ACCOUNT_PENDING (wait), WALLET_FUNDING_ACCOUNT_UNAVAILABLE (retry), WALLET_FUNDING_ACCOUNT_REJECTED | as listed | Fix names |
| Payment expired | PAYMENT_EXPIRED | — | Start again |
| KYC needed | WITHDRAWAL_TIER_REQUIRED | verify_identity | Open verifyIdentity |
| Too little | WITHDRAWAL_BELOW_MINIMUM, EARNINGS_INSUFFICIENT | — | — |
| Bank account | BANK_ACCOUNT_INVALID, BANK_ACCOUNT_EXISTS, BANK_ACCOUNT_LIMIT, BANK_ACCOUNT_NOT_FOUND | — | — |
| Transfer | WALLET_TRANSFER_SELF, WALLET_RECIPIENT_NOT_FOUND, WALLET_INSUFFICIENT_FUNDS (top_up) | as listed | — |
Notifications
payment.receipt, payment.refunded, payment.manual_refund_completed, wallet.transfer_sent, wallet.transfer_received, wallet.bank_account_added, wallet.withdrawal_requested, _on_hold, _approved, _rejected, _sent, _failed.
Known gaps
- A failed top-up sends nothing;
payment.failedandwallet.topup_succeededare seeded but never used (M1). - Reconciliation skips the bank side; refunds through Hyparrow are a manual staff task (M11).
- KYC approval or rejection is not notified (I4).
- Wallet history is missing from the data export; bank accounts and the funding account survive erasure (I7, B3).