Appearance
Wallet & payments
All paths under /v1. Money in requests: { amountMinor: number, currency }. Money in responses: { amountMinor: string, currency }. Routes marked key require an Idempotency-Key header (IDEMPOTENCY_KEY_REQUIRED), and the same key with a different body is PAYMENT_KEY_REUSED / IDEMPOTENCY_KEY_REUSED. Lists are cursor pages (?cursor&limit, meta.nextCursor).
Ledger model
Double entry. Each entry is signed minor units added to its account; a transaction's entries sum to zero per currency (engine check plus a deferred constraint trigger), ledger rows are append only, and corrections are reversing transactions. Accounts: user_wallet, creator_earnings, platform_revenue, royalty_pool, ad_revenue, provider_clearing (per provider), payout_clearing. Customer wallets, the royalty pool and payout clearing can't go negative.
Wallet (user)
| Method | Path | Body / query | Response | Errors |
|---|---|---|---|---|
| GET | /wallet | { balances: [{ balance, isFrozen }] } | ||
| GET | /wallet/transactions | ?currency + page | page of entries { id, transactionId, amount, balanceAfter, description, referenceType, referenceId, postedAt } | |
| GET | /wallet/limits | ?currency | { tier, dailyOutflow{limit,used}, dailyInflow{limit,used}, transfersPerHour } | |
| GET | /wallet/funding-account | ?currency (NGN) | `{ status: pending | active |
| POST | /wallet/funding-account | { bvn, firstName, lastName, middleName?, accountNumber?, bank? } (legal names as on the BVN; BVN passed to Hyparrow, never stored) | 201 active, or 202 pending (number arrives by webhook); credits become top-ups, net of Hyparrow's deposit fee | WALLET_FUNDING_ACCOUNT_REJECTED, WALLET_FUNDING_ACCOUNT_UNAVAILABLE, WALLET_CURRENCY_UNSUPPORTED, RATE_LIMITED |
| POST | /wallet/top-ups key | { amount, method: card|bank_transfer } | 201 payment (with checkoutUrl / transferAccount) | WALLET_AMOUNT_OUT_OF_BOUNDS, WALLET_LIMIT_EXCEEDED, PAYMENT_PROVIDER_FAILED |
| POST | /wallet/transfers key | { recipientUserId, amount, note? } | 201 { id, senderUserId, recipientUserId, amount, note, createdAt } | WALLET_TRANSFER_SELF, WALLET_RECIPIENT_NOT_FOUND, WALLET_INSUFFICIENT_FUNDS, WALLET_LIMIT_EXCEEDED, WALLET_VELOCITY_EXCEEDED, LEDGER_ACCOUNT_FROZEN |
| GET | /wallet/statement.csv | ?from=YYYY-MM-DD&to=YYYY-MM-DD¤cy? (≤ 1 year) | text/csv | VALIDATION_FAILED |
| GET | /receipts | page | { id, receiptNumber, kind, description, total, method, paymentId, issuedAt } | |
| GET | /receipts/:id | receipt + subtotal, lines[] | RECEIPT_NOT_FOUND |
Payments (payer)
| Method | Path | Body | Response | Errors |
|---|---|---|---|---|
| GET | /me/payments | page | payments | |
| GET | /payments/:id | { id, status, purpose, referenceId, amount, fee, method, description, checkoutUrl, transferAccount, failureCode, expiresAt, createdAt, succeededAt } | PAYMENT_NOT_FOUND | |
| POST | /payments/:id/refresh | payment, after asking the provider | PAYMENT_NOT_FOUND, PAYMENT_PROVIDER_FAILED | |
| POST | /payments/:id/store-purchase key | { token, productId? } (Apple transaction ID / Google purchase token) | payment | PAYMENT_STORE_RECEIPT_INVALID, PAYMENT_STORE_RECEIPT_USED, PAYMENT_METHOD_UNSUPPORTED, PAYMENT_INVALID_TRANSITION |
| POST | /payments/:id/cancel | payment | PAYMENT_INVALID_TRANSITION | |
| POST | /payments/:id/fake-checkout | { outcome } — only with the fake provider | payment |
Statuses: requires_action → processing → succeeded | failed | cancelled, succeeded → refunded; a provider-confirmed late payment on a failed/cancelled intent is still booked.
Hyparrow
Hosts https://api.hyparrow.cloud/api/v1 and https://sandbox.hyparrow.cloud/api/v1 (HYPARROW_ENVIRONMENT; pk_test_ keys are sandbox-only). One-off payments are invoices paid on https://checkout.hyparrow.com/pay/{invoiceId} (card, transfer, USSD, OPay and others are offered there; we never handle card data). Units: invoices and checkout events in naira; transfers, transactions and customer/transfer/wallet events in kobo. Service fee (2.5%, capped) and VAT (7.5%) go on top for the customer by default (HYPARROW_FEE_DIRECTION). Payouts use clientReference = withdrawal ID; transfer fees are booked against platform revenue.
Store price tiers (in-app purchases)
Apple and Google sell only fixed price points, so every in-app purchase uses a staff-managed tier (kind: mart, live_gift, live_ticket, fan_funding, superfan_membership) that maps one amount and currency to an Apple and/or Google product ID, per environment (STORE_PRICE_TIER_ENVIRONMENT).
- Intents paid with
apple_iaporgoogle_playneedstorePriceTierId. The amount must equal the tier's and the tier's kind must match the purpose. POST /payments/:id/store-purchasevalidates the store transaction against the tier's product ID; the client'sproductIdis optional and only cross-checked. Each store transaction ID pays once.- The store's fee (
APPLE_STORE_FEE_PERCENT,GOOGLE_STORE_FEE_PERCENT) is recorded on the intent. Only what the store pays is booked to its clearing account; the platform fee and creator split are taken from that. Store top-ups credit the wallet in full and the platform absorbs the store's cut.
| Method | Path | Auth | Body / query | Response | Errors |
|---|---|---|---|---|---|
| GET | /store-price-tiers | public | ?kind¤cy? | active tiers { id, kind, code, name, price, appleProductId, appleProductType, googleProductId, environment, isActive } | |
| GET | /staff/store-price-tiers | staff payouts:request | page | tiers | |
| POST | /staff/store-price-tiers | staff payouts:approve | { kind, code, name, currency, amountMinor, appleProductId, appleProductType, googleProductId, environment } | 201 tier | STORE_PRICE_TIER_EXISTS |
| PUT | /staff/store-price-tiers/:id | staff payouts:approve | { name, appleProductId, appleProductType, googleProductId } (the price is fixed once created) | tier | STORE_PRICE_TIER_NOT_FOUND, STORE_PRICE_TIER_EXISTS |
| POST | /staff/store-price-tiers/:id/retire, /activate | staff payouts:approve | tier | STORE_PRICE_TIER_NOT_FOUND |
Every staff change is audited. Purchase errors: STORE_PRICE_TIER_REQUIRED, STORE_PRICE_TIER_NOT_FOUND, PAYMENT_AMOUNT_INVALID, PAYMENT_STORE_RECEIPT_INVALID, PAYMENT_STORE_RECEIPT_USED.
Webhooks
| Method | Path | Notes |
|---|---|---|
| POST | /webhooks/payments/hyparrow | Raw body. Verified with X-Hyparrow-Signature-256 (HMAC-SHA256 of timestamp.body, 5-minute window) or else X-Hyparrow-Signature (HMAC-SHA512 of the body); 401 PAYMENT_WEBHOOK_INVALID otherwise. Unsigned deliveries are accepted only for checkout.payment.* (the invoice is always read back before settling). Deduped on X-Webhook-ID; stored as body hash plus typed columns; unknown events become needs_review. Also the invoices' checkoutCallbackUrl. Handled: checkout.payment.pending/completed/failed, customer.transaction.completed, customer.account.migrated/failed, transfer.settled/failed/reversed (a payout fails only on reversed), wallet.funded and subscription.payment.completed (review), wallet.balance.low (alert), payroll.* and test.webhook (ignored). |
| POST | /webhooks/payments/fake | Same format, fake secret, dev only. |
Earnings and withdrawals
| Method | Path | Auth | Body | Response | Errors |
|---|---|---|---|---|---|
| GET | /wallet/banks | user | ?currency | banks | |
| GET | /me/bank-accounts | user | masked accounts (last 4 only) | ||
| POST | /me/bank-accounts | user | { countryCode, currency, bankCode, accountNumber, accountType? } | 201 account (name from bank inquiry) | BANK_ACCOUNT_INVALID, BANK_ACCOUNT_EXISTS, BANK_ACCOUNT_LIMIT |
| POST | /me/bank-accounts/:id/default | user | account | BANK_ACCOUNT_NOT_FOUND | |
| DELETE | /me/bank-accounts/:id | user | { status: "ok" } | BANK_ACCOUNT_NOT_FOUND, WITHDRAWAL_INVALID_TRANSITION | |
| GET | /profiles/:profileId/earnings | owner | { available[], pending[] } | FORBIDDEN | |
| GET | /profiles/:profileId/earnings/transactions | owner | ?currency + page | entries | FORBIDDEN |
| GET | /profiles/:profileId/earnings/statement.csv | owner | ?from&to¤cy? | text/csv | FORBIDDEN |
| GET | /profiles/:profileId/withdrawals | owner | page | withdrawals | FORBIDDEN |
| POST | /profiles/:profileId/withdrawals key | owner | { bankAccountId, amount } | 201 withdrawal | WITHDRAWAL_TIER_REQUIRED (remedy verify), WITHDRAWAL_BELOW_MINIMUM, WITHDRAWAL_CURRENCY_MISMATCH, EARNINGS_INSUFFICIENT, WALLET_LIMIT_EXCEEDED, BANK_ACCOUNT_NOT_FOUND |
| POST | /me/withdrawals/:id/cancel | requester | withdrawal | WITHDRAWAL_NOT_FOUND, WITHDRAWAL_INVALID_TRANSITION |
Withdrawal lifecycle: requested → on_hold | approved → processing → paid | failed, plus rejected, cancelled. The amount is reserved in payout_clearing on request and reversed on failure, rejection or cancel. Holds: new bank account (cooling off), amount at or above the review threshold, first withdrawal.
Staff (staff token; view payouts:request, act payouts:approve; every action is audited)
| Method | Path | Body | Response |
|---|---|---|---|
| GET | /staff/money/overview | balances by account kind and currency, pending payouts, webhook counts, open discrepancies, manual refunds pending, open payments, frozen accounts | |
| GET | /staff/money/accounts | ?kind + page | ledger accounts with balance and version |
| GET | /staff/payments | ?status + page | staff payment views (provider references, refund status) |
| GET | /staff/payments/:id | staff payment view | |
| POST | /staff/payments/:id/refund | { reason: requested|duplicate|fraud, note } | payment; reversing ledger transaction, provider refund or a manual task (PAYMENT_NOT_REFUNDABLE, WALLET_INSUFFICIENT_FUNDS for a spent top-up) |
| POST | /staff/payments/:id/manual-refund-done | { note } | { status: "ok" } |
| GET | /staff/payment-webhooks | ?status + page | stored events |
| POST | /staff/payment-webhooks/:id/review | { note } | { status: "ok" } (WEBHOOK_EVENT_NOT_FOUND) |
| POST | /staff/payment-webhooks/:id/requeue | { status: "ok" } | |
| GET | /staff/reconciliation/runs | page | runs |
| POST | /staff/reconciliation/runs | { kind: ledger_integrity|provider_transactions|provider_balance } | 202 |
| GET | /staff/reconciliation/discrepancies | ?status + page | discrepancies |
| POST | /staff/reconciliation/discrepancies/:id/resolve | { status: resolved|ignored, note } | { status: "ok" } (RECONCILIATION_DISCREPANCY_NOT_FOUND) |
| GET | /staff/withdrawals | ?status + page | withdrawals |
| GET | /staff/withdrawals/:id | withdrawal | |
| POST | /staff/withdrawals/:id/approve | { note? } | withdrawal |
| POST | /staff/withdrawals/:id/reject | { note } | withdrawal (earnings returned) |
| GET | /staff/payout-batches | page | batches |
| GET | /staff/payout-batches/:id | batch with items (PAYOUT_BATCH_NOT_FOUND) | |
| POST | /staff/payout-batches | 201 { batchIds } |
Events and jobs
Events: wallet.payment.succeeded, wallet.payment.failed, wallet.payment.refunded, wallet.transfer.completed, wallet.withdrawal.status_changed, wallet.reconciliation.discrepancy_raised. Jobs: payments-webhook (process stored webhooks), ledger (payments sweep every 5 min, payout run hourly, payout status poll every 10 min, ledger integrity, provider transaction and balance reconciliation daily).
Google Play billing
Off while GOOGLE_PLAY_BILLING_ENABLED=false (default): google_play intents are refused with PAYMENT_METHOD_UNAVAILABLE (actions: wallet, card); GET /payments/methods?platform=ios|android|web lists what a client may offer (Android gets wallet, card and bank transfer); mart inAppPrices keep Google product IDs but report inAppAvailable: false on Android. Apple IAP is unchanged.
Native app money
GET /wallet/settings?currency=NGNreturns{ currency, topUpMin, topUpMax, stepUpAbove|null, iosHostedCheckout { topUp, subscription, mart }, fees { fanFundingBps, liveGiftBps, liveTicketBps } }.- In-app top-ups:
GET /wallet/top-up-packs?platform=ios¤cy=lists[{ code, label, price, productId, productType: "consumable" }]from the staff settingwallet.topUpPacks. Buy withPOST /wallet/top-ups { method: "apple_iap", productId }(Idempotency-Key), run StoreKit withappAccountToken= user ID, thenPOST /payments/:id/store-purchase { token: <transactionId>, productId }. The receipt is checked with the App Store Server API; each transaction pays once (PAYMENT_STORE_RECEIPT_USED). The wallet is credited the full amount; the platform absorbs the store's cut. The first purchase of a pack creates itswallet_topupstore price tier. - iOS rule:
wallet.iosHostedCheckout(default alltrue). When a switch is off, a card or bank transfer payment for that kind from a session signed in on an iPhone answersPAYMENT_METHOD_UNAVAILABLE_ON_PLATFORM(403). The platform is the session's device, not a header.GET /payments/methods?platform=ios&purpose=wallet_topupleaves out the closed methods. - Step-up: transfers, withdrawals and wallet-paid fan funding, live gifts and live tickets at or above
wallet.stepUpAboveMinor[currency]answerAUTH_PROOF_REQUIRED(remedystep_up). Confirm withPOST /me/step-upand one of{ code }(fromPOST /me/reauth-code),{ password }, or{ method: "device", challengeId, signature }; it returns{ stepUpToken, expiresAt, header: "X-Step-Up" }, valid five minutes for this session. Retry the money request withX-Step-Up: <stepUpToken>. - Face ID: create a P-256 key in the Secure Enclave with biometric access control, register its public key once with
PUT /me/devices/current/step-up-key { publicKey }(DER SubjectPublicKeyInfo, base64), then per confirmationPOST /me/step-up/challenge(returns{ challengeId, nonce, expiresAt }, two minutes) and signnonce(UTF-8) with ECDSA SHA-256; send the DER signature base64. Socketfund:sendhas no step-up: large funding goes through REST. POST /wallet/transfersalso takesrecipientProfileIdorrecipientHandle.
Additions for the native apps
GET /wallet/settings?currency=NGNreturns{ currency, topUpMin, topUpMax, stepUpAbove | null, iosHostedCheckout { topUp, subscription, mart }, fees { fanFundingBps, liveGiftBps, liveTicketBps } }(money as{ amountMinor: string, currency }).GET /wallet/top-up-packs?platform=ios¤cy=returns[{ code, label, price, productId, productType: "consumable" }]from the staff settingwallet.topUpPacks. Buy with StoreKit (appAccountToken= user ID) afterPOST /wallet/top-ups { method: "apple_iap", productId }(Idempotency-Key), thenPOST /payments/:id/store-purchase { token: <transactionId>, productId }. Each transaction pays once (PAYMENT_STORE_RECEIPT_USED). The wallet gets the pack's full amount.- Seeded packs (NGN): 1,000, 2,000, 5,000, 10,000, 20,000, 50,000 as
com.plemuz.app.wallet.1000and so on. wallet.iosHostedCheckoutswitches card and bank transfer on iPhone per kind of purchase; refused withPAYMENT_METHOD_UNAVAILABLE_ON_PLATFORM. The device of the signed-in session decides.- Transfers take
recipientUserId,recipientProfileIdorrecipientHandle.
Step-up
Wallet movements at or above wallet.stepUpAboveMinor for their currency (transfers, withdrawals, and wallet-paid fan funding, live gifts and live tickets) answer AUTH_PROOF_REQUIRED unless the request carries X-Step-Up: <token>.
| Method | Path | Body | Response |
|---|---|---|---|
| PUT | /me/devices/current/step-up-key | { publicKey } (P-256 SPKI DER, base64, from the Secure Enclave behind biometrics) | ok |
| POST | /me/step-up/challenge | none | { challengeId, nonce, expiresAt } (2 min, once) |
| POST | /me/step-up | { method: "device", challengeId, signature } (ECDSA SHA-256 over nonce), or { code } from POST /me/reauth-code, or { password } | { stepUpToken, expiresAt, header: "X-Step-Up" } (5 min, this session) |
Socket fund:send carries no step-up; above the threshold use POST /live/streams/:id/funding.
Earnings summary and store refunds
GET /profiles/:profileId/earnings/summary?months=12 (owner) returns [{ month: "YYYY-MM", earned, paidOut }] per currency, newest first. An App Store refund of a one-off purchase refunds its payment, reversing the credit.