On Ramp
On-ramp
Returns the best offer for the provided country, network, asset, amount and payment channel.
Your client ID
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 code if applicable, e.g. for mobile_money or airtime orders
Successful response
Unique quote id
GET /api/onramp/best-offer?network=POLYGON&asset=USDC¤cy=local&amount=1&countryIsoCode=text&paymentChannel=bank 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",
"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
}
}
},
"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
Your client ID
Successful response
ISO code of the country, e.g. NG for Nigeria, KE for Kenya
ISO code of the local currency, e.g. NGN for Nigerian Naira, KES for Kenyan Shilling
Name of the country, e.g. Nigeria, Kenya
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",
"code": "ke_safaricom"
}
]
},
{
"paymentChannel": "mobile_money",
"description": "M-PESA",
"requiresCarrier": true,
"carriers": [
{
"id": "618e43914f57e07d255ff353",
"name": "Safaricom Kenya",
"code": "ke_safaricom"
}
]
}
]
}
]Returns minimum and maximum amount of order in crypto and local currency and applied fees for specific payment channel, country, network and asset.
Your client ID
Successful response
Minimum amount in USD for the order
Maximum amount in USD for the order
Minimum amount in local currency for the order
Maximum amount in local currency for the order
Minimum amount in crypto for the order
Maximum amount in crypto for the order
GET /api/onramp/limits?network=POLYGON&countryIsoCode=text&paymentChannel=bank 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
Your client ID
Successful response
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.
Your client ID
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
Successful response
Order ID
- swap_initiated: user has created an order
- swap_expired: an order has expired
- swap_buyer_rejected: user has rejected an order
- swap_buyer_confirmed: user has confirmed an order
- swap_seller_rejected: agent has rejected an order, happens when agent don't receive a payment
- swap_seller_confirmed: agent has confirmed an order
- pending: crypto transaction is pending
- complete: crypto transaction is complete
- failed: crypto transaction has failed
Date of order creation
Order ID
User phone number, should include country code
User email address
Amount in local currency
Local currency ISO code, e.g. NGN, KES
Country ISO code, e.g. NG
Payment channel used for the order, e.g. bank, mobile_money, airtime
Amount in USD
Amount in crypto
Blockchain network of the order, e.g. POLYGON, ETHEREUM, STELLAR
Blockchain asset of the order, e.g. USDC, USDT, CUSD
User wallet address
Memo for the Stellar, TON and other networks transactions that support it
Transaction hash if available
Value of the orderParams query param during order creation
URL to resume the order in the pay widget
Carrier ID if applicable, e.g. for mobile money orders
total fee percent (fonbnk fee + partner fee)
fonbnk fee percent
partner fee percent
Total fee amount in USD
Total fee amount in local currency
Fonbnk fee amount in USD
Fonbnk fee amount in local currency
Partner fee amount in USD
Partner fee amount in local currency
Gas fee amount in USD
Gas fee amount in local currency
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": "hello@fonbnk.com",
"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.
Your client ID
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
Successful response
GET /api/onramp/orders?limit=1 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": "hello@fonbnk.com",
"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"
}
]
}Creates a new on-ramp order using a quote ID from the best offer endpoint
Your client ID
Quote ID from the best offer endpoint
Amount based on the currency parameter
Wallet address to receive the crypto
User email address
Optional parameter for order tracking
User's IP address
URL to redirect the user after completion of the transfer, applicable only for orders with transferInstructions.type = "redirect"
Order created successfully
Order ID
- swap_initiated: user has created an order
- swap_expired: an order has expired
- swap_buyer_rejected: user has rejected an order
- swap_buyer_confirmed: user has confirmed an order
- swap_seller_rejected: agent has rejected an order, happens when agent don't receive a payment
- swap_seller_confirmed: agent has confirmed an order
- pending: crypto transaction is pending
- complete: crypto transaction is complete
- failed: crypto transaction has failed
Date of order creation
Order ID
User phone number, should include country code
User email address
Amount in local currency
Local currency ISO code, e.g. NGN, KES
Country ISO code, e.g. NG
Payment channel used for the order, e.g. bank, mobile_money, airtime
Amount in USD
Amount in crypto
Blockchain network of the order, e.g. POLYGON, ETHEREUM, STELLAR
Blockchain asset of the order, e.g. USDC, USDT, CUSD
User wallet address
Memo for the Stellar, TON and other networks transactions that support it
Transaction hash if available
Value of the orderParams query param during order creation
URL to resume the order in the pay widget
Carrier ID if applicable, e.g. for mobile money orders
total fee percent (fonbnk fee + partner fee)
fonbnk fee percent
partner fee percent
Total fee amount in USD
Total fee amount in local currency
Fonbnk fee amount in USD
Fonbnk fee amount in local currency
Partner fee amount in USD
Partner fee amount in local currency
Gas fee amount in USD
Gas fee amount in local currency
POST /api/onramp/order/create HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 292
{
"quoteId": "651e764399a4b360c7eb0178",
"network": "SOLANA",
"amount": 2.1,
"currency": "crypto",
"asset": "USDC",
"address": "53L9ahwHcNnD4F11TqNHQgVUa75WgaCL2WGeiKiK2gCc",
"email": "hello@fonbnk.com",
"orderParams": "user-order-123",
"userIp": "100.102.120.240",
"extraFields": {
"phoneNumber": "234567890123"
}
}Order created successfully
{
"_id": "651e764399a4b360c7eb0178",
"orderId": "651e764399a4b360c7eb0178",
"status": "seller_confirmed",
"phoneNumber": "380962669394",
"paymentChannel": "bank",
"email": "hello@fonbnk.com",
"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"
}Verifies OTP code for an on-ramp order that requires OTP authentication.
Your client ID
ID of the order to verify OTP for
OTP code received by the user
POST /api/onramp/order/otp HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 53
{
"orderId": "651e764399a4b360c7eb0178",
"otp": "123456"
}Confirms an onramp order
The ID of the order to confirm
507f1f77bcf86cd799439011Order confirmed successfully
Order ID
- swap_initiated: user has created an order
- swap_expired: an order has expired
- swap_buyer_rejected: user has rejected an order
- swap_buyer_confirmed: user has confirmed an order
- swap_seller_rejected: agent has rejected an order, happens when agent don't receive a payment
- swap_seller_confirmed: agent has confirmed an order
- pending: crypto transaction is pending
- complete: crypto transaction is complete
- failed: crypto transaction has failed
Date of order creation
Order ID
User phone number, should include country code
User email address
Amount in local currency
Local currency ISO code, e.g. NGN, KES
Country ISO code, e.g. NG
Payment channel used for the order, e.g. bank, mobile_money, airtime
Amount in USD
Amount in crypto
Blockchain network of the order, e.g. POLYGON, ETHEREUM, STELLAR
Blockchain asset of the order, e.g. USDC, USDT, CUSD
User wallet address
Memo for the Stellar, TON and other networks transactions that support it
Transaction hash if available
Value of the orderParams query param during order creation
URL to resume the order in the pay widget
Carrier ID if applicable, e.g. for mobile money orders
total fee percent (fonbnk fee + partner fee)
fonbnk fee percent
partner fee percent
Total fee amount in USD
Total fee amount in local currency
Fonbnk fee amount in USD
Fonbnk fee amount in local currency
Partner fee amount in USD
Partner fee amount in local currency
Gas fee amount in USD
Gas fee amount in local currency
POST /api/onramp/order/confirm HTTP/1.1
Host: sandbox-api.fonbnk.com
Content-Type: application/json
Accept: */*
Content-Length: 38
{
"orderId": "507f1f77bcf86cd799439011"
}Order confirmed successfully
{
"_id": "651e764399a4b360c7eb0178",
"orderId": "651e764399a4b360c7eb0178",
"status": "seller_confirmed",
"phoneNumber": "380962669394",
"paymentChannel": "bank",
"email": "hello@fonbnk.com",
"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"
}Rejects an onramp order
The ID of the order to reject
507f1f77bcf86cd799439011Order rejected successfully
Order ID
- swap_initiated: user has created an order
- swap_expired: an order has expired
- swap_buyer_rejected: user has rejected an order
- swap_buyer_confirmed: user has confirmed an order
- swap_seller_rejected: agent has rejected an order, happens when agent don't receive a payment
- swap_seller_confirmed: agent has confirmed an order
- pending: crypto transaction is pending
- complete: crypto transaction is complete
- failed: crypto transaction has failed
Date of order creation
Order ID
User phone number, should include country code
User email address
Amount in local currency
Local currency ISO code, e.g. NGN, KES
Country ISO code, e.g. NG
Payment channel used for the order, e.g. bank, mobile_money, airtime
Amount in USD
Amount in crypto
Blockchain network of the order, e.g. POLYGON, ETHEREUM, STELLAR
Blockchain asset of the order, e.g. USDC, USDT, CUSD
User wallet address
Memo for the Stellar, TON and other networks transactions that support it
Transaction hash if available
Value of the orderParams query param during order creation
URL to resume the order in the pay widget
Carrier ID if applicable, e.g. for mobile money orders
total fee percent (fonbnk fee + partner fee)
fonbnk fee percent
partner fee percent
Total fee amount in USD
Total fee amount in local currency
Fonbnk fee amount in USD
Fonbnk fee amount in local currency
Partner fee amount in USD
Partner fee amount in local currency
Gas fee amount in USD
Gas fee amount in local currency
POST /api/onramp/order/reject HTTP/1.1
Host: sandbox-api.fonbnk.com
Content-Type: application/json
Accept: */*
Content-Length: 38
{
"orderId": "507f1f77bcf86cd799439011"
}Order rejected successfully
{
"_id": "651e764399a4b360c7eb0178",
"orderId": "651e764399a4b360c7eb0178",
"status": "seller_confirmed",
"phoneNumber": "380962669394",
"paymentChannel": "bank",
"email": "hello@fonbnk.com",
"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"
}Last updated

