Skip to main content
POST
/
api
/
v3
/
offramp
Offramp Request
curl --request POST \
  --url https://sandbox-api.kotanipay.com/api/v3/offramp \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "cryptoAmount": 123,
  "currency": "KES",
  "chain": "ETHEREUM",
  "token": "CUSD",
  "referenceId": "<string>",
  "senderAddress": "<string>",
  "callbackUrl": "<string>",
  "rateId": "<string>",
  "refund_config": {
    "bolt11": "lnbc1500n1p0xyz...",
    "payment_hash": "a1b2c3d4e5f6...",
    "amount_msat": 150000000,
    "expires_at": "2024-11-22T13:00:00Z",
    "generate_invoice_url": "https://api.yourapp.com/lightning/generate-refund-invoice",
    "address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
  }
}
'
{
  "success": true,
  "message": "Offramp has been successfully created",
  "data": {
    "referenceId": "<string>",
    "fiatAmount": 123,
    "fiatTransactionAmount": 123,
    "cryptoAmount": 123,
    "fiatCurrency": "KES",
    "customerKey": "<string>",
    "fiatWalletId": "<string>",
    "senderAddress": "<string>",
    "transactionHash": "<string>",
    "transactionHashAmount": 123,
    "status": "<string>",
    "onchainStatus": "<string>",
    "rate": {},
    "escrowAddress": "<string>",
    "usingIntegratedWallet": true,
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "onchainError": {},
    "transactionError": {}
  }
}

Documentation Index

Fetch the complete documentation index at: https://developers.kotanipay.com/llms.txt

Use this file to discover all available pages before exploring further.

This endpoint will create an offramp request for a customer to convert crypto to fiat.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
cryptoAmount
number
required

The crypto amount

currency
enum<string>
required

Fiat currency

Available options:
KES,
GHS,
TZS,
UGX,
ZMW,
XAF,
XOF,
CDF,
RWF,
ETB,
ZAR
chain
enum<string>
required

Chain

Available options:
ETHEREUM,
CELO,
AVALANCHE,
POLYGON,
ARBITRUM,
OPTIMISM,
STELLAR,
TRON,
FUSE,
LIGHTNING,
SOLANA,
PROVENANCE,
CARDANO,
HEDERA,
BASE,
LISK,
VICTION,
SCROLL
token
enum<string>
required

Stable Coin or Token

Available options:
CUSD,
USDC,
USDT,
USDT0,
SAT,
BTC,
HASH,
FUSE,
HBAR,
USDGLO,
CKES,
CGHS,
MSAT,
XLM,
ADA
referenceId
string
required

Reference ID

mobileMoneyReceiver
object

Mobile Money receiver details

bankReceiver
object

Bank receiver details

lipaNaMpesaReceiver
object

Lipa na M-Pesa (Till/Buy Goods) receiver — Kenya only

paybillReceiver
object

Paybill receiver — Kenya only

senderAddress
string

Sender address (optional - if not provided, will use integrator crypto wallet)

callbackUrl
string

Callback Url

rateId
string

Rate ID

refund_config
object

Optional refund destination for this transaction. For Lightning: provide a bolt11 invoice so Kotani can refund immediately if fiat disbursement fails, without waiting for you to submit one manually. Include generate_invoice_url so Kotani can refresh the invoice if it expires. For on-chain chains: provide address as the fallback refund destination. If omitted, Kotani notifies you via webhook and email when a refund is needed and you submit via POST /offramp/submit-refund-invoice/:referenceId.

Response

Offramp Response

success
boolean
Example:

true

message
string
Example:

"Offramp has been successfully created"

data
object