Off Ramp
Off-ramp
Returns the best offer for the provided country, network, asset, amount and payment channel.
Amount of usd user wants to pay or amount of local currency user wants to receive depending on the currency param value
Currency of the amount param
country ISO code, for example KE for Kenya, NG for Nigeria
type of the payment channel user wants to use, e.g. bank, mobile_money, airtime to receive local currency
GET /api/offramp/best-offer HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
Successful response
{
"quoteId": "660528663163c4652145aaba",
"offer": {
"countryIsoCode": "NG",
"currencyIsoCode": "NGN",
"exchangeRate": 1260.2,
"requiredFields": {
"phoneNumber": {
"type": "phone",
"label": "Phone number",
"required": true
},
"bankCode": {
"required": true,
"type": "enum",
"label": "Bank name",
"options": [
{
"value": "120001:02",
"label": "9Payment Service Bank"
},
{
"value": "801:02",
"label": "Abbey Mortgage Bank"
}
]
},
"buyerBankAccountNumber": {
"type": "string",
"label": "Bank account Number",
"required": true
}
},
"paymentChannel": "bank"
},
"cashout": {
"localCurrencyAmount": 6301,
"usdAmount": 5,
"feeAmountUsd": 0.12,
"feeAmountUsdFonbnk": 0.12,
"feeAmountUsdPartner": 0,
"feeAmountLocalCurrency": 155,
"feeAmountLocalCurrencyFonbnk": 155,
"feeAmountLocalCurrencyPartner": 0,
"cryptoAmount": 5,
"feeAmountCrypto": 0.12,
"feeAmountCryptoFonbnk": 0.12,
"feeAmountCryptoPartner": 0
}
}
Returns a list of supported countries and their payment channels
GET /api/offramp/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",
"name": "Bank"
},
{
"paymentChannel": "airtime",
"name": "Airtime"
}
]
},
{
"countryIsoCode": "KE",
"currencyIsoCode": "KES",
"name": "Kenya",
"paymentChannels": [
{
"paymentChannel": "mobile_money",
"name": "M-PESA",
"carriers": [
{
"id": "618e43914f57e07d255ff353",
"name": "Safaricom Kenya"
}
]
},
{
"paymentChannel": "airtime",
"name": "Airtime"
},
{
"paymentChannel": "paybill",
"name": "Paybill"
}
]
},
{
"countryIsoCode": "UG",
"currencyIsoCode": "UGX",
"name": "Uganda",
"paymentChannels": [
{
"paymentChannel": "mobile_money",
"name": "Mobile money"
},
{
"paymentChannel": "airtime",
"name": "Airtime"
}
]
},
{
"countryIsoCode": "GH",
"currencyIsoCode": "GHS",
"name": "Ghana",
"paymentChannels": [
{
"paymentChannel": "mobile_money",
"name": "Mobile money"
},
{
"paymentChannel": "airtime",
"name": "Airtime"
}
]
},
{
"countryIsoCode": "ZA",
"currencyIsoCode": "ZAR",
"name": "South Africa",
"paymentChannels": [
{
"paymentChannel": "bank",
"name": "Bank"
},
{
"paymentChannel": "airtime",
"name": "Airtime"
}
]
},
{
"countryIsoCode": "TZ",
"currencyIsoCode": "TZS",
"name": "Tanzania",
"paymentChannels": [
{
"paymentChannel": "mobile_money",
"name": "Mobile money"
},
{
"paymentChannel": "airtime",
"name": "Airtime"
}
]
}
]
Returns minimum and maximum amount of order in USD and local currency with applied fees for specific payment channel, country, network and asset.
payment channel type
country ISO code
GET /api/offramp/limits HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
Successful response
{
"minUsd": 1.02,
"maxUsd": 100,
"minLocalCurrency": 1292,
"maxLocalCurrency": 125921
}
Returns a list of supported wallet networks and their assets for crypto wallet orders
GET /api/offramp/assets HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
A list of supported wallet networks and their assets
[
{
"network": "POLYGON",
"asset": "USDC"
},
{
"network": "CELO",
"asset": "USDC"
},
{
"network": "ETHEREUM",
"asset": "USDC"
},
{
"network": "AVALANCHE",
"asset": "USDC"
},
{
"network": "CELO",
"asset": "CUSD"
},
{
"network": "POLYGON",
"asset": "USDT"
},
{
"network": "AVALANCHE",
"asset": "USDT"
},
{
"network": "CELO",
"asset": "USDT"
},
{
"network": "ETHEREUM",
"asset": "USDT"
}
]
Returns a single order by its ID.
ID of the off-ramp order
GET /api/offramp/order/{id} HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
Successful response
{
"_id": "6603f8fc1c3f3f94d6b30818",
"network": "CELO",
"asset": "CUSD",
"paymentChannel": "bank",
"exchangeRate": 1268.6275,
"cashout": {
"localCurrencyAmount": 1294,
"usdAmount": 1.02,
"feeAmountUsd": 0.02,
"feeAmountUsdFonbnk": 0.02,
"feeAmountUsdPartner": 0,
"feeAmountLocalCurrency": 26,
"feeAmountLocalCurrencyFonbnk": 26,
"feeAmountLocalCurrencyPartner": 0,
"cryptoAmount": 1.02,
"feeAmountCrypto": 0.02,
"feeAmountCryptoFonbnk": 0.02,
"feeAmountCryptoPartner": 0
},
"fromAddress": "0x5b7ae3c6c87F4A3F94b35c77233b13191eBFAD20",
"toAddress": "0xe9bBDDCF0E8fcD41Bd1345aa5688B565931B0184",
"status": "offramp_success",
"createdAt": "2024-03-27T10:46:20.513Z",
"expiresAt": "2024-03-27T11:46:20.509Z",
"hash": "0xbda5dd11b17d65249238137f5d542320b66141ac96be3b750804354a6eadfb04",
"statusHistory": [
{
"status": "initiated",
"changedAt": "2024-03-27T10:46:20.522Z"
},
{
"status": "awaiting_transaction_confirmation",
"changedAt": "2024-03-27T10:46:31.007Z"
},
{
"status": "transaction_confirmed",
"changedAt": "2024-03-27T10:46:43.357Z"
},
{
"status": "offramp_pending",
"changedAt": "2024-03-27T10:46:44.568Z"
},
{
"status": "offramp_success",
"changedAt": "2024-03-27T10:50:02.649Z"
}
],
"requiredFields": {
"bankCode": "011:02",
"buyerBankAccountNumber": "3159586782",
"phoneNumber": "2347000000007"
},
"countryIsoCode": "NG",
"currencyIsoCode": "NGN",
"offerRequiredFields": [
{
"label": "Phone number",
"type": "phone",
"value": "2347000000007"
},
{
"label": "Bank name",
"type": "enum",
"value": "First Bank of Nigeria"
},
{
"label": "Bank account Number",
"type": "string",
"value": "3179586682"
}
],
"orderParams": "43"
}
Returns a paginated list of 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
asset of orders
address of a user wallet
phone number of the client, should include country code
email of the client
hash of the user transaction
country ISO code, e.g. NG
type of the payment channel
value of the orderParams query param during order creation
- initiated: The offramp order has been initiated
- awaiting_transaction_confirmation: User sent the transaction hash and system is awaiting confirmation
- transaction_confirmed: User transaction has been confirmed
- transaction_failed: User transaction has failed
- offramp_success: The offramp transaction has been successful
- offramp_pending: The offramp transaction is pending
- offramp_failed: The offramp transaction has failed
- offramp_retry: The offramp transaction is being retried
- refunding: The offramp transaction is being refunded
- refunded: The offramp transaction has been refunded
- refund_failed: The offramp transaction refund has failed
- expired: The offramp order has expired
- cancelled: The offramp order has been cancelled by the user
- validating_transaction: The offramp transaction is being validated
- transaction_invalid: The offramp transaction is invalid
GET /api/offramp/orders HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
Successful response
{
"list": [
{
"_id": "6603f8fc1c3f3f94d6b30818",
"network": "CELO",
"asset": "CUSD",
"exchangeRate": 1268.6275,
"paymentChannel": "bank",
"cashout": {
"localCurrencyAmount": 1294,
"usdAmount": 1.02,
"feeAmountUsd": 0.02,
"feeAmountUsdFonbnk": 0.02,
"feeAmountUsdPartner": 0,
"feeAmountLocalCurrency": 26,
"feeAmountLocalCurrencyFonbnk": 26,
"feeAmountLocalCurrencyPartner": 0,
"cryptoAmount": 1.02,
"feeAmountCrypto": 0.02,
"feeAmountCryptoFonbnk": 0.02,
"feeAmountCryptoPartner": 0
},
"fromAddress": "0x5b7ae3c6c87F4A3F94b35c77233b13191eBFAD20",
"toAddress": "0xe9bBDDCF0E8fcD41Bd1345aa5688B565931B0184",
"status": "offramp_success",
"createdAt": "2024-03-27T10:46:20.513Z",
"expiresAt": "2024-03-27T11:46:20.509Z",
"hash": "0xbda5dd11b17d65249238137f5d542320b66141ac96be3b750804354a6eadfb04",
"statusHistory": [
{
"status": "initiated",
"changedAt": "2024-03-27T10:46:20.509Z"
},
{
"status": "initiated",
"changedAt": "2024-03-27T10:46:20.522Z"
},
{
"status": "awaiting_transaction_confirmation",
"changedAt": "2024-03-27T10:46:31.007Z"
},
{
"status": "transaction_confirmed",
"changedAt": "2024-03-27T10:46:43.357Z"
},
{
"status": "offramp_pending",
"changedAt": "2024-03-27T10:46:44.568Z"
},
{
"status": "offramp_success",
"changedAt": "2024-03-27T10:50:02.649Z"
}
],
"requiredFields": {
"bankCode": "011:02",
"buyerBankAccountNumber": "3159586782",
"phoneNumber": "2347000000007"
},
"countryIsoCode": "NG",
"currencyIsoCode": "NGN",
"offerRequiredFields": [
{
"label": "Phone number",
"type": "phone",
"value": "2347000000007"
},
{
"label": "Bank name",
"type": "enum",
"value": "First Bank of Nigeria"
},
{
"label": "Bank account Number",
"type": "string",
"value": "3179586682"
}
],
"orderParams": "43"
}
],
"nextCursor": "646c7e3ce2597a00921e2c53"
}