Hosted checkout is enabled per account and country. Ask your account manager to switch it on. You need an API key and a reachable
callbackUrl.How it works
- Quote. Ask for a hosted quote with the chain you want to deliver on. You get exactly what the customer receives, every fee, and an estimate in local currency.
- Create. Create the onramp with that quote’s
rateId. You get back aredirectUrl. - Customer pays. Send the customer to
redirectUrl. They pay in local currency on the hosted page. - Crypto delivered. As soon as the payment completes, the crypto is sent to the wallet. We notify your
callbackUrland you can poll the status.
1. Get a hosted quote
Call Get Onramp Exchange Rate withchain and hostedCheckout: true.
Request: POST /api/v3/rate/onramp
Response
Reading the quote
Show the customer
receiveAmount and estimatedFiatAmount before they pay. On a hosted quote the top-level fiatAmount, transactionAmount and fee are local-currency estimates; the hosted figures are the exact ones.
What fiatAmount means
- By default (
sourceomitted orfiat),fiatAmountis the local amount to convert. The fees are added on top, so the customer pays more thanfiatAmount: in the example, 1300 KES converts to 10 USDT and the customer pays about 1386 KES. - With
source: "crypto",fiatAmountholds the crypto amount the customer must receive. Use this when the customer needs an exact amount, for example"fiatAmount": 10, "source": "crypto"for exactly 10 USDT.
Earning on hosted onramps
The customer’s payment never passes through your wallets, so to earn on a hosted onramp ask your account manager to set a partner fee on your account (a percentage of the crypto amount). It appears in the quote ashosted.partnerFee, the customer pays it with everything else, and hosted.partnerFeeLocal is credited to your fiat wallet in the onramp currency as soon as the customer has paid. Nothing else is credited to your wallets on a hosted onramp.
2. Create the onramp
Call Create Onramp withhostedCheckout: true, the quote’s rateId, and no mobileMoney or bankCheckout. Create it within 60 seconds of the quote.
Request: POST /api/v3/onramp
redirectUrl to send the customer to, and the same hosted block as the quote.
currency,tokenandchainmust match the quote.receiverAddressmust be a valid address forchain(a0x...address on EVM chains, a base58 address on Solana). An invalid address is refused here, before the customer pays.- Without a
rateId, the onramp is quoted fromfiatAmountat that moment.
3. The customer pays
Redirect the customer toredirectUrl. They see the amount in their local currency, choose how to pay (for example M-Pesa), and confirm. A payment usually completes within a few minutes.
4. Crypto is delivered
As soon as the payment completes, the crypto is sent toreceiverAddress. Delivery usually confirms within a few minutes, depending on the chain.
You receive a callback on your
callbackUrl when the onramp reaches a final state, and you can poll Get Onramp Status at any time. The status response’s rate.hosted holds the same breakdown as the quote.
Chains, tokens and network fees
The quote always returns the current fee in
hosted.networkFee. Use the quote, not this table, for what you show the customer.
Minimum amounts
The customer must receive more than the chain’s network fee. A quote or onramp below that is refused before the customer pays, and the message tells you the smallestfiatAmount that works:
fiatAmount, not the total.
Errors
Testing checklist
Use small amounts and a wallet you control.- Quote 100 KES on
SOLANA: it is refused with the minimum. - Quote about 300 KES on
CELOwithhostedCheckout: true. Notehosted.receiveAmountandhosted.estimatedFiatAmount. - Within 60 seconds, create the onramp with that
rateIdand a Celo0x...address. - Open
redirectUrl. The page should ask for roughlyestimatedFiatAmountin local currency. - Pay, then check the wallet receives exactly
hosted.receiveAmount, and that your callback arrives withonchainStatusSUCCESSFULand atransactionHash.