You need an API key and a reachable
callbackUrl — see the Quickstart if you haven’t set those up. For this flow you also need a funded payout balance in the disbursement currency, and a customer record for the recipient.1. Get a Rate Quote
Fetch the current offramp rate to show the customer how much fiat they’ll receive. Call Get Offramp Exchange Rate with the crypto token and target fiat currency.2. Create the Offramp
Call Create Offramp Request with yourcallbackUrl. The API responds with a PENDING transaction and a depositAddress — this is the on-chain address the customer must send crypto to. Display this address (and optionally a QR code) to them.
3. Customer Sends Crypto
The customer sends the exact amount to thedepositAddress from their own wallet. Kotani Pay monitors the address and advances the transaction to CRYPTO_RECEIVED once the required confirmations are reached. No further action is needed from your server at this step.
4. Fiat is Disbursed
Once crypto is confirmed, Kotani Pay initiates the fiat disbursement. The recipient gets an SMS confirmation from the mobile money network when funds arrive.5. Kotani Pay Notifies You
Kotani Pay POSTs to yourcallbackUrl at each terminal state:
SUCCESS— fiat delivered to the recipientFAILED— disbursement failedREFUNDED— crypto returned to sender after a failed fiat disbursementREFUND_FAILED— crypto refund failed; contact support
If you have a webhook secret configured, the callback arrives in a signed envelope with
X-Kotani-Signature, X-Kotani-Event, and X-Kotani-Integrator headers. Without a secret, the transaction fields are posted directly to your callbackUrl. See Webhooks for both modes, and the offramp payload for every field you receive with a worked example.6. Poll for Status
- Get Offramp Status (by Reference ID) — full transaction status
- Get Refund Status — refund status if fiat disbursement failed
Refund Handling
If the automatic refund fails, you can retry:- Single retry — Retry Failed Refund
- Lightning offramps — if the refund requires a bolt11 invoice, the customer provides one and you submit it. See Offramp Refunds
Cancel a Transaction
A transaction can only be cancelled while still inPENDING — before any crypto is received on-chain.
Cancel Offramp Transaction
Monitoring from the Dashboard
- Log in to backoffice.kotanipay.com
- Use the country and currency selector to filter by market
- Navigate to Offramp in the left sidebar