Off-Ramp
Sell crypto for fiat (crypto-to-fiat conversion). Access via zenpays.offRamp.
Methods
getQuotes
Get sell quotes for a crypto-to-fiat currency pair.
- JavaScript
- Python
const quotes = await zenpays.offRamp.getQuotes({
source: 'usdt_tron',
destination: 'NGN',
amount: 100,
paymentMethod: 'bank_transfer',
country: 'NG',
})
quotes = zenpays.off_ramp.get_quotes({
"source": "usdt_tron",
"destination": "NGN",
"amount": 100,
"paymentMethod": "bank_transfer",
"country": "NG",
})
Response
Returns an array of quotes from available providers:
[
{
"onramp": "zenpay",
"paymentMethod": "bank_transfer",
"inputAmount": 100,
"outputAmount": 157500,
"rate": 1575,
"networkFee": 0,
"transactionFee": 1.5,
"totalFee": 1.5,
"recommended": true,
"minAmount": 5,
"maxAmount": 10000
}
]
getRates
Get exchange rates for one or more fiat destinations.
const rates = await zenpays.offRamp.getRates({
source: 'usdt_tron',
destinations: 'NGN,GHS,KES',
amount: 100,
})
createCheckout
Initiate a generic off-ramp checkout session (legacy).
- JavaScript
- Python
const checkout = await zenpays.offRamp.createCheckout({
onramp: 'zenpay',
source: 'usdt_tron',
destination: 'NGN',
amount: 100,
type: 'sell',
paymentMethod: 'bank_transfer',
walletAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f2bD28',
})
checkout = zenpays.off_ramp.create_checkout({
"onramp": "zenpay",
"source": "usdt_tron",
"destination": "NGN",
"amount": 100,
"type": "sell",
"paymentMethod": "bank_transfer",
"walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD28",
})
createSellCheckout
Phase 1 of the two-phase sell flow — generate a crypto deposit address. Requires a ramp intent.
- JavaScript
- Python
const sellCheckout = await zenpays.offRamp.createSellCheckout({
intentId: 'ri_1710345678000_a1b2c3d4e5f6g7h8',
cryptoCurrency: 'USDT',
chain: 'tron',
fiatCurrency: 'USD',
cryptoAmount: 20,
fiatAmount: 19.78,
rate: 0.999,
totalFee: 0.62,
})
sell_checkout = zenpays.off_ramp.create_sell_checkout({
"intentId": "ri_1710345678000_a1b2c3d4e5f6g7h8",
"cryptoCurrency": "USDT",
"chain": "tron",
"fiatCurrency": "USD",
"cryptoAmount": 20,
"fiatAmount": 19.78,
"rate": 0.999,
"totalFee": 0.62,
})
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
intentId | string | Yes | Ramp intent ID |
cryptoCurrency | string | Yes | Crypto to sell (e.g. USDT) |
chain | string | Yes | Blockchain network (e.g. tron, ethereum) |
fiatCurrency | string | Yes | Target fiat currency |
cryptoAmount | number | Yes | Amount of crypto to sell |
fiatAmount | number | Yes | Expected fiat proceeds |
rate | number | Yes | Locked exchange rate |
totalFee | number | Yes | Total fees |
customerEmail | string | No | Customer email (for KYC, optional if kycVerified) |
customerFirstName | string | No | Customer first name |
customerLastName | string | No | Customer last name |
quoteId | string | No | Quote ID from quotes endpoint |
Response
{
"intentId": "ri_1710345678000_a1b2c3d4e5f6g7h8",
"depositAddress": "TLfMkVBKQSy8i1XN2wDCQxkPaL1Dqz7v98",
"memo": null,
"currency": "USDT",
"chain": "tron",
"expectedCryptoAmount": 20,
"fiatAmount": 19.78,
"fiatCurrency": "USD",
"rate": 0.999,
"cryptoDepositId": "d4e5f6a7-b8c9-1234-5678-abcdef012345",
"expiresAt": "2026-03-15T10:00:00.000Z",
"provider": "fireblocks"
}
getSellPayoutPreview
Phase 2a — discover required beneficiary fields and fees for the target currency/country.
- JavaScript
- Python
const preview = await zenpays.offRamp.getSellPayoutPreview({
intentId: 'ri_1710345678000_a1b2c3d4e5f6g7h8',
fiatCurrency: 'USD',
country: 'US',
payoutType: 'bank_transfer',
})
preview = zenpays.off_ramp.get_sell_payout_preview({
"intentId": "ri_1710345678000_a1b2c3d4e5f6g7h8",
"fiatCurrency": "USD",
"country": "US",
"payoutType": "bank_transfer",
})
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
intentId | string | Yes | Ramp intent ID |
fiatCurrency | string | Yes | Target fiat currency |
country | string | No | ISO country code |
payoutType | string | No | Payout method (default: bank_transfer) |
Response
{
"selectedTsp": "zenpay_routing",
"tspDisplayName": "PayCross",
"requiredFields": [
{ "fieldName": "receiverFirstName", "label": "First Name", "type": "string", "required": true },
{ "fieldName": "receiverLastName", "label": "Last Name", "type": "string", "required": true },
{ "fieldName": "receiverAccountNumber", "label": "Account Number", "type": "string", "required": true }
],
"optionalFields": [],
"fiatAmount": 19.78,
"fiatCurrency": "USD",
"fees": { "platform": 0.22, "network": 0, "total": 0.22 }
}
createSellPayout
Phase 2b — submit beneficiary details to trigger the fiat payout.
- JavaScript
- Python
const payout = await zenpays.offRamp.createSellPayout({
intentId: 'ri_1710345678000_a1b2c3d4e5f6g7h8',
cryptoDepositId: 'd4e5f6a7-b8c9-1234-5678-abcdef012345',
fiatCurrency: 'USD',
country: 'US',
selectedTsp: 'zenpay_routing',
beneficiaryDetails: {
receiverFirstName: 'John',
receiverLastName: 'Doe',
receiverAccountNumber: '123456789',
receiverBankName: 'Bank of America',
receiverCountry: 'US',
},
})
payout = zenpays.off_ramp.create_sell_payout({
"intentId": "ri_1710345678000_a1b2c3d4e5f6g7h8",
"cryptoDepositId": "d4e5f6a7-b8c9-1234-5678-abcdef012345",
"fiatCurrency": "USD",
"country": "US",
"selectedTsp": "zenpay_routing",
"beneficiaryDetails": {
"receiverFirstName": "John",
"receiverLastName": "Doe",
"receiverAccountNumber": "123456789",
"receiverBankName": "Bank of America",
"receiverCountry": "US",
},
})
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
intentId | string | Yes | Ramp intent ID |
cryptoDepositId | string | Yes | Deposit ID from sell checkout response |
fiatCurrency | string | Yes | Target fiat currency |
payoutType | string | No | Payout method (default: bank_transfer) |
country | string | No | ISO country code |
selectedTsp | string | No | Provider from payout preview response |
beneficiaryDetails | object | Yes | Dynamic fields from payout preview requiredFields |
Response
{
"payoutId": "po_abc123def456",
"status": "processing",
"amount": 19.78,
"currency": "USD",
"intentId": "ri_1710345678000_a1b2c3d4e5f6g7h8"
}
getTransaction
const txn = await zenpays.offRamp.getTransaction('txn_xxx')
createWidgetUrl
Generate a hosted widget URL for off-ramp.
- JavaScript
- Python
const { url } = await zenpays.offRamp.createWidgetUrl({
mode: 'sell',
defaultFiat: 'usd',
defaultCrypto: 'usdt_tron',
defaultAmount: 100,
networkWallets: 'tron:TLfMkVBKQSy...',
successRedirectUrl: 'https://yoursite.com/success',
failureRedirectUrl: 'https://yoursite.com/failure',
})
// Embed url in iframe or redirect user
result = zenpays.off_ramp.create_widget_url({
"mode": "sell",
"defaultFiat": "usd",
"defaultCrypto": "usdt_tron",
"defaultAmount": 100,
"networkWallets": "tron:TLfMkVBKQSy...",
"successRedirectUrl": "https://yoursite.com/success",
"failureRedirectUrl": "https://yoursite.com/failure",
})
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | No | buy, sell, or buy,sell |
defaultFiat | string | No | Default fiat currency |
defaultCrypto | string | No | Default crypto |
defaultAmount | number | No | Default amount |
networkWallets | string | No | Format: network:address,network:address |
successRedirectUrl | string | No | Redirect on success |
failureRedirectUrl | string | No | Redirect on failure |
email | string | No | Pre-fill customer email |
uuid | string | No | User identifier |