sourceWallet field, which tells Mavapay to deduct the source amount directly from your internal wallet instead of expecting an external bank transfer or Lightning payment.
Prefunded Quote Flow
Performing a prefunded payout is a two-step process: Requesting a Quote and Accepting the Quote from your Wallet.Step 1: Create a Prefunded Quote
The quote endpoint calculates the exchange rate and fees. The request is the same as a standard quote, with one addition: thesourceWallet field.
The
sourceWallet field is the only difference between a prefunded quote and a regular quote. It specifies which internal wallet to debit for the source amount. The value must correspond to the sourceCurrency in the quote body (e.g. USDTCENT → USDT, BTCSAT → BTC, NGNKOBO → NGN).Step 2: The Quote Response
Mavapay returns a quote object. Key field to note:id— Use this when accepting the quote from your wallet.
Note: Quotes are typically valid for 5–10 minutes. You must accept before the expiry timestamp.
Step 3: Accept and Settle from Wallet
To finalize the payout, call the accept endpoint. This will immediately deduct thetotalAmountInSourceCurrency from your internal wallet and process the payout to the beneficiary.
- Endpoint:
POST .../wallet/payout/{quoteId}/accept - Payload: The
sourceWalletvalue must match the one used in the original quote.
Key Considerations
- Sufficient Balance: Ensure your internal wallet has enough funds to cover the
totalAmountInSourceCurrency(which includes fees). - Rate Volatility: Because exchange rates change rapidly, the quote
idis short-lived. If it expires, you must generate a new quote. - Denominations: All amounts are in the lowest denomination (cents for USDTCENT, kobo for NGNKOBO, satoshis for BTCSAT).
Related Resources
- Create Quote API — Full quote endpoint reference
- Accept Quote API — Wallet accept endpoint reference
- Beneficiary Formats — Required beneficiary formats for each currency
- Internal Currency Swap — Similar flow for swapping between internal wallets
