Skip to content

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) ​

MethodPathBody / queryResponseErrors
GET/wallet{ balances: [{ balance, isFrozen }] }
GET/wallet/transactions?currency + pagepage 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: pendingactive
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 feeWALLET_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&currency? (≤ 1 year)text/csvVALIDATION_FAILED
GET/receiptspage{ id, receiptNumber, kind, description, total, method, paymentId, issuedAt }
GET/receipts/:idreceipt + subtotal, lines[]RECEIPT_NOT_FOUND

Payments (payer) ​

MethodPathBodyResponseErrors
GET/me/paymentspagepayments
GET/payments/:id{ id, status, purpose, referenceId, amount, fee, method, description, checkoutUrl, transferAccount, failureCode, expiresAt, createdAt, succeededAt }PAYMENT_NOT_FOUND
POST/payments/:id/refreshpayment, after asking the providerPAYMENT_NOT_FOUND, PAYMENT_PROVIDER_FAILED
POST/payments/:id/store-purchase key{ token, productId? } (Apple transaction ID / Google purchase token)paymentPAYMENT_STORE_RECEIPT_INVALID, PAYMENT_STORE_RECEIPT_USED, PAYMENT_METHOD_UNSUPPORTED, PAYMENT_INVALID_TRANSITION
POST/payments/:id/cancelpaymentPAYMENT_INVALID_TRANSITION
POST/payments/:id/fake-checkout{ outcome } — only with the fake providerpayment

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_iap or google_play need storePriceTierId. The amount must equal the tier's and the tier's kind must match the purpose.
  • POST /payments/:id/store-purchase validates the store transaction against the tier's product ID; the client's productId is 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.
MethodPathAuthBody / queryResponseErrors
GET/store-price-tierspublic?kind&currency?active tiers { id, kind, code, name, price, appleProductId, appleProductType, googleProductId, environment, isActive }
GET/staff/store-price-tiersstaff payouts:requestpagetiers
POST/staff/store-price-tiersstaff payouts:approve{ kind, code, name, currency, amountMinor, appleProductId, appleProductType, googleProductId, environment }201 tierSTORE_PRICE_TIER_EXISTS
PUT/staff/store-price-tiers/:idstaff payouts:approve{ name, appleProductId, appleProductType, googleProductId } (the price is fixed once created)tierSTORE_PRICE_TIER_NOT_FOUND, STORE_PRICE_TIER_EXISTS
POST/staff/store-price-tiers/:id/retire, /activatestaff payouts:approvetierSTORE_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 ​

MethodPathNotes
POST/webhooks/payments/hyparrowRaw 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/fakeSame format, fake secret, dev only.

Earnings and withdrawals ​

MethodPathAuthBodyResponseErrors
GET/wallet/banksuser?currencybanks
GET/me/bank-accountsusermasked accounts (last 4 only)
POST/me/bank-accountsuser{ 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/defaultuseraccountBANK_ACCOUNT_NOT_FOUND
DELETE/me/bank-accounts/:iduser{ status: "ok" }BANK_ACCOUNT_NOT_FOUND, WITHDRAWAL_INVALID_TRANSITION
GET/profiles/:profileId/earningsowner{ available[], pending[] }FORBIDDEN
GET/profiles/:profileId/earnings/transactionsowner?currency + pageentriesFORBIDDEN
GET/profiles/:profileId/earnings/statement.csvowner?from&to&currency?text/csvFORBIDDEN
GET/profiles/:profileId/withdrawalsownerpagewithdrawalsFORBIDDEN
POST/profiles/:profileId/withdrawals keyowner{ bankAccountId, amount }201 withdrawalWITHDRAWAL_TIER_REQUIRED (remedy verify), WITHDRAWAL_BELOW_MINIMUM, WITHDRAWAL_CURRENCY_MISMATCH, EARNINGS_INSUFFICIENT, WALLET_LIMIT_EXCEEDED, BANK_ACCOUNT_NOT_FOUND
POST/me/withdrawals/:id/cancelrequesterwithdrawalWITHDRAWAL_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) ​

MethodPathBodyResponse
GET/staff/money/overviewbalances by account kind and currency, pending payouts, webhook counts, open discrepancies, manual refunds pending, open payments, frozen accounts
GET/staff/money/accounts?kind + pageledger accounts with balance and version
GET/staff/payments?status + pagestaff payment views (provider references, refund status)
GET/staff/payments/:idstaff 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 + pagestored 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/runspageruns
POST/staff/reconciliation/runs{ kind: ledger_integrity|provider_transactions|provider_balance }202
GET/staff/reconciliation/discrepancies?status + pagediscrepancies
POST/staff/reconciliation/discrepancies/:id/resolve{ status: resolved|ignored, note }{ status: "ok" } (RECONCILIATION_DISCREPANCY_NOT_FOUND)
GET/staff/withdrawals?status + pagewithdrawals
GET/staff/withdrawals/:idwithdrawal
POST/staff/withdrawals/:id/approve{ note? }withdrawal
POST/staff/withdrawals/:id/reject{ note }withdrawal (earnings returned)
GET/staff/payout-batchespagebatches
GET/staff/payout-batches/:idbatch with items (PAYOUT_BATCH_NOT_FOUND)
POST/staff/payout-batches201 { 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=NGN returns { currency, topUpMin, topUpMax, stepUpAbove|null, iosHostedCheckout { topUp, subscription, mart }, fees { fanFundingBps, liveGiftBps, liveTicketBps } }.
  • In-app top-ups: GET /wallet/top-up-packs?platform=ios&currency= lists [{ code, label, price, productId, productType: "consumable" }] from the staff setting wallet.topUpPacks. Buy with POST /wallet/top-ups { method: "apple_iap", productId } (Idempotency-Key), run StoreKit with appAccountToken = user ID, then POST /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 its wallet_topup store price tier.
  • iOS rule: wallet.iosHostedCheckout (default all true). When a switch is off, a card or bank transfer payment for that kind from a session signed in on an iPhone answers PAYMENT_METHOD_UNAVAILABLE_ON_PLATFORM (403). The platform is the session's device, not a header. GET /payments/methods?platform=ios&purpose=wallet_topup leaves out the closed methods.
  • Step-up: transfers, withdrawals and wallet-paid fan funding, live gifts and live tickets at or above wallet.stepUpAboveMinor[currency] answer AUTH_PROOF_REQUIRED (remedy step_up). Confirm with POST /me/step-up and one of { code } (from POST /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 with X-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 confirmation POST /me/step-up/challenge (returns { challengeId, nonce, expiresAt }, two minutes) and sign nonce (UTF-8) with ECDSA SHA-256; send the DER signature base64. Socket fund:send has no step-up: large funding goes through REST.
  • POST /wallet/transfers also takes recipientProfileId or recipientHandle.

Additions for the native apps ​

  • GET /wallet/settings?currency=NGN returns { 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&currency= returns [{ code, label, price, productId, productType: "consumable" }] from the staff setting wallet.topUpPacks. Buy with StoreKit (appAccountToken = user ID) after POST /wallet/top-ups { method: "apple_iap", productId } (Idempotency-Key), then POST /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.1000 and so on.
  • wallet.iosHostedCheckout switches card and bank transfer on iPhone per kind of purchase; refused with PAYMENT_METHOD_UNAVAILABLE_ON_PLATFORM. The device of the signed-in session decides.
  • Transfers take recipientUserId, recipientProfileId or recipientHandle.

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>.

MethodPathBodyResponse
PUT/me/devices/current/step-up-key{ publicKey } (P-256 SPKI DER, base64, from the Secure Enclave behind biometrics)ok
POST/me/step-up/challengenone{ 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.

Plemuz API v2