On Ramp

On-ramp

Get best offer

get

Returns the best offer for the provided country, network, asset, amount and payment channel.

Authorizations
Query parameters
networkstring · enumRequired

blockchain network of the order

Possible values:
assetstring · enumRequired

asset of the order

Possible values:
currencystring · enumRequired

Currency of the amount param

Possible values:
amountnumberRequired

Amount of local currency user wants to pay or amount of crypto user wants to receive depending on the currency param value

countryIsoCodestringRequired

country ISO code, e.g. NG, KE etc.

paymentChannelstring · enumRequired

type of the payment channel user wants to use, e.g. bank, mobile_money, airtime to pay local currency

Possible values:
carrierIdstringOptional

carrier ID if applicable, e.g. for mobile_money or airtime orders

includeRequiredFieldsbooleanOptional

if true, response will include required fields for the order

Default: false
Responses
200
Successful response
application/json
get
GET /api/onramp/best-offer HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
200

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
  }
}

Get payment channels

get

Returns a list of supported countries and their payment channels

Authorizations
Responses
200
Successful response
application/json
get
GET /api/onramp/payment-channels HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
200

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"
          }
        ]
      }
    ]
  }
]

Get limits

get

Returns minimum and maximum amount of order in crypto and local currency and applied fees for specific payment channel, country, network and asset.

Authorizations
Query parameters
networkstring · enumRequiredPossible values:
assetstring · enumOptionalPossible values:
countryIsoCodestringRequired
paymentChannelstring · enumRequiredPossible values:
carrierIdstringOptional
Responses
200
Successful response
application/json
get
GET /api/onramp/limits HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
200

Successful response

{
  "minCrypto": 1,
  "maxCrypto": 200,
  "minLocalCurrency": 100,
  "maxLocalCurrency": 20000,
  "minUsd": 1,
  "maxUsd": 200
}

Get list of supported assets

get

Returns a list of supported blockchain assets for the on-ramp orders

Authorizations
Responses
200
Successful response
application/json
get
GET /api/onramp/assets HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
200

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"
  }
]

Get order

get

Returns a single pay widget order by its ID or orderParams query parameter.

Authorizations
Query parameters
orderIdstringOptional

id of the order which you could receive via a webhook or iframe events

orderParamsstringOptional

Value which you provided in the orderParams parameter of the pay widget URL

Responses
200
Successful response
application/json
get
GET /api/onramp/order HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
200

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"
}

Get orders

get

Returns a paginated list of pay widget orders. Filters can be applied to the list by providing query parameters.

Authorizations
Query parameters
cursorstringOptional

this parameter should be provided in order to get a next page from the pagination, it should be taken from "nextCursor" response value

limitintegerRequired

number from 1 to 100, describes how many records should be in each pagination page

networkstring · enumOptional

blockchain network of orders

Possible values:
addressstringOptional
userPhoneNumberstringOptional

phone number of the client, should include country code

userEmailstringOptional

email of the client

paymentChannelstring · enumOptional

type of the payment channel

Possible values:
buySwapStatusstring · enumOptional
  • 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
Possible values:
withdrawalStatusstring · enumOptional

status of a crypto transfer

Possible values:
Responses
200
Successful response
application/json
Responseall of
get
GET /api/onramp/orders HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
200

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"
    }
  ]
}