On Ramp
On-ramp
Returns the best offer for the provided country, network, asset, amount and payment channel.
blockchain network of the order
asset of the order
Currency of the amount param
Amount of local currency user wants to pay or amount of crypto user wants to receive depending on the currency param value
country ISO code, e.g. NG, KE etc.
type of the payment channel user wants to use, e.g. bank, mobile_money, airtime to pay local currency
carrier ID if applicable, e.g. for mobile_money or airtime orders
if true, response will include required fields for the order
false
GET /api/onramp/best-offer HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
Successful response
{
"quoteId": "651e764399a4b360c7eb0178",
"offer": {
"countryIsoCode": "NG",
"currencyIsoCode": "NGN",
"exchangeRate": 1,
"cryptoExchangeRate": 1,
"paymentChannel": "bank"
},
"cashout": {
"localCurrencyAmount": 2100,
"totalAmountUsd": 2.15,
"withdrawAmountUsd": 2.1,
"totalAmountCrypto": 2.15,
"withdrawAmountCrypto": 2.1,
"feePercent": 2.5,
"feePercentFonbnk": 1.5,
"feePercentPartner": 1,
"feeAmountUsd": 0.05,
"feeAmountUsdFonbnk": 0.03,
"feeAmountUsdPartner": 0.02,
"feeAmountLocalCurrency": 50,
"feeAmountLocalCurrencyFonbnk": 30,
"feeAmountLocalCurrencyPartner": 20,
"feeAmountCrypto": 0.05,
"feeAmountCryptoFonbnk": 0.03,
"feeAmountCryptoPartner": 0.02,
"gasAmountUsd": 0,
"gasAmountLocalCurrency": 0
}
}
Returns a list of supported countries and their payment channels
GET /api/onramp/payment-channels HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
Successful response
[
{
"countryIsoCode": "NG",
"currencyIsoCode": "NGN",
"name": "Nigeria",
"paymentChannels": [
{
"paymentChannel": "bank",
"description": "Bank transfer",
"requiresCarrier": false,
"carriers": []
}
]
},
{
"countryIsoCode": "KE",
"currencyIsoCode": "KES",
"name": "Kenya",
"paymentChannels": [
{
"paymentChannel": "airtime",
"description": "Airtime",
"requiresCarrier": true,
"carriers": [
{
"id": "618e43914f57e07d255ff353",
"name": "Safaricom Kenya"
}
]
},
{
"paymentChannel": "mobile_money",
"description": "M-PESA",
"requiresCarrier": true,
"carriers": [
{
"id": "618e43914f57e07d255ff353",
"name": "Safaricom Kenya"
}
]
}
]
}
]
Returns minimum and maximum amount of order in crypto and local currency and applied fees for specific payment channel, country, network and asset.
GET /api/onramp/limits HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
Successful response
{
"minCrypto": 1,
"maxCrypto": 200,
"minLocalCurrency": 100,
"maxLocalCurrency": 20000,
"minUsd": 1,
"maxUsd": 200
}
Returns a list of supported blockchain assets for the on-ramp orders
GET /api/onramp/assets HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
Successful response
[
{
"network": "POLYGON",
"asset": "USDC"
},
{
"network": "CELO",
"asset": "USDC"
},
{
"network": "ETHEREUM",
"asset": "USDC"
},
{
"network": "BASE",
"asset": "USDC"
},
{
"network": "AVALANCHE",
"asset": "USDC"
},
{
"network": "POLYGON",
"asset": "USDC_E"
},
{
"network": "SOLANA",
"asset": "USDC"
},
{
"network": "OPTIMISM",
"asset": "USDC"
},
{
"network": "CELO",
"asset": "CUSD"
},
{
"network": "POLYGON",
"asset": "USDT"
},
{
"network": "AVALANCHE",
"asset": "USDT"
},
{
"network": "CELO",
"asset": "USDT"
},
{
"network": "ETHEREUM",
"asset": "USDT"
},
{
"network": "TON",
"asset": "USDT"
},
{
"network": "STELLAR",
"asset": "USDC"
},
{
"network": "SOLANA",
"asset": "USDT"
},
{
"network": "OPTIMISM",
"asset": "USDT"
},
{
"network": "CELO",
"asset": "CKES"
},
{
"network": "LISK",
"asset": "USDT"
},
{
"network": "BNB",
"asset": "USDT"
},
{
"network": "BNB",
"asset": "USDC"
},
{
"network": "ARBITRUM",
"asset": "USDT"
},
{
"network": "ARBITRUM",
"asset": "USDC"
}
]
Returns a single pay widget order by its ID or orderParams query parameter.
id of the order which you could receive via a webhook or iframe events
Value which you provided in the orderParams parameter of the pay widget URL
GET /api/onramp/order HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
Successful response
{
"_id": "651e764399a4b360c7eb0178",
"orderId": "651e764399a4b360c7eb0178",
"status": "seller_confirmed",
"phoneNumber": "380962669394",
"paymentChannel": "bank",
"email": "[email protected]",
"currencyIsoCode": "NGN",
"countryIsoCode": "NG",
"network": "SOLANA",
"asset": "USDC",
"address": "53L9ahwHcNnD4F11TqNHQgVUa75WgaCL2WGeiKiK2gCc",
"feePercent": 2.5,
"feePercentFonbnk": 1.5,
"feePercentPartner": 1,
"date": "2023-10-05T08:39:31.691Z",
"orderParams": "{id: \"651e764}",
"localCurrencyAmount": 2100,
"amount": 2.1,
"amountCrypto": 2.1,
"hash": "F19TfyGxBgebZt4q8h5bgf9Luabpypm3zSSzWR5ZUp8CKGNvL2r58zqGvWXvKftppiWKszV11jNQtsMUoFppmyb",
"feeAmountUsd": 0.05,
"feeAmountLocalCurrency": 50,
"feeAmountUsdFonbnk": 0.03,
"feeAmountLocalCurrencyFonbnk": 30,
"feeAmountUsdPartner": 0.02,
"feeAmountLocalCurrencyPartner": 20,
"gasAmountUsd": 0,
"gasAmountLocalCurrency": 0,
"resumeUrl": "https://pay.fonbnk.com/swap-status?orderId=651e764399a4b360c7eb0178"
}
Returns a paginated list of pay widget orders. Filters can be applied to the list by providing query parameters.
this parameter should be provided in order to get a next page from the pagination, it should be taken from "nextCursor" response value
number from 1 to 100, describes how many records should be in each pagination page
blockchain network of orders
phone number of the client, should include country code
email of the client
type of the payment channel
- initiated: The buy swap has been initiated
- expired: The buy swap has expired
- buyer_confirmed: The buyer has confirmed the buy swap
- seller_confirmation_pending: The agent is yet to confirm the buy swap
- seller_confirmation_failed: The agent has failed to confirm the buy swap
- seller_confirmed: The agent has confirmed the buy swap
- seller_rejected: The agent has rejected the buy swap
status of a crypto transfer
GET /api/onramp/orders HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
Successful response
{
"nextCursor": "651e764399a4b360c7eb0178",
"list": [
{
"_id": "651e764399a4b360c7eb0178",
"orderId": "651e764399a4b360c7eb0178",
"status": "seller_confirmed",
"phoneNumber": "380962669394",
"email": "[email protected]",
"currencyIsoCode": "NGN",
"countryIsoCode": "NG",
"network": "SOLANA",
"asset": "USDC",
"address": "53L9ahwHcNnD4F11TqNHQgVUa75WgaCL2WGeiKiK2gCc",
"feePercent": 2.5,
"feePercentFonbnk": 1.5,
"feePercentPartner": 1,
"date": "2023-10-05T08:39:31.691Z",
"orderParams": "{id: \"651e764}",
"localCurrencyAmount": 2100,
"amount": 2.1,
"amountCrypto": 2.1,
"hash": "F19TfyGxBgebZt4q8h5bgf9Luabpypm3zSSzWR5ZUp8CKGNvL2r58zqGvWXvKftppiWKszV11jNQtsMUoFppmyb",
"feeAmountUsd": 0.05,
"feeAmountLocalCurrency": 50,
"feeAmountUsdFonbnk": 0.03,
"feeAmountLocalCurrencyFonbnk": 30,
"feeAmountUsdPartner": 0.02,
"feeAmountLocalCurrencyPartner": 20,
"gasAmountUsd": 0,
"gasAmountLocalCurrency": 0,
"resumeUrl": "https://pay.fonbnk.com/swap-status?orderId=651e764399a4b360c7eb0178"
}
]
}