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 code if applicable, e.g. for mobile_money or airtime orders
Successful response
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",
"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
Successful response
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.
Successful response
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
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.
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
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
Successful response
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"
}
]
}
Creates a new on-ramp order using a quote ID from the best offer endpoint
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
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": "[email protected]",
"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": "[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"
}
Verifies OTP code for an on-ramp order that requires OTP authentication.
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
507f1f77bcf86cd799439011
Order confirmed successfully
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": "[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"
}
Rejects an onramp order
The ID of the order to reject
507f1f77bcf86cd799439011
Order rejected successfully
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": "[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"
}