On Ramp

On-ramp

Get list of supported assets

get
/api/pay-widget-merchant/assets

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

Authorizations
x-client-idstringRequired
Responses
200

Successful response

application/json
get
/api/pay-widget-merchant/assets
GET /api/pay-widget-merchant/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
/api/pay-widget-merchant/order

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

Authorizations
x-client-idstringRequired
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
/api/pay-widget-merchant/order
GET /api/pay-widget-merchant/order HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
200

Successful response

{
  "_id": "651e764399a4b360c7eb0178",
  "walletType": "SOLANA",
  "asset": "USDC",
  "walletAddress": "53L9ahwHcNnD4F11TqNHQgVUa75WgaCL2WGeiKiK2gCc",
  "feePercent": 2.5,
  "fonbnkFeePercent": 1.5,
  "partnerFeePercent": 1,
  "gasUsdAmount": 0,
  "merchantId": "645a20cbaf1d31dbd52c0fda",
  "createdAt": "2023-10-05T08:39:31.691Z",
  "buySwap": {
    "_id": "651e764399a4b360c7eb016d",
    "buyerUserPhone": "380962669394",
    "sellerUserPhone": "380960000000",
    "amount": 210,
    "airtimeAmount": 2100,
    "status": "seller_confirmed",
    "provider": "bank_transfer",
    "expiresAt": "2023-10-05T09:39:31.492Z",
    "createdAt": "2023-10-05T08:39:31.500Z",
    "buyerConfirmedAt": "2023-10-05T08:39:37.027Z",
    "countryIsoCode": "NG"
  },
  "withdrawal": {
    "_id": "651e7653db37ee6b74883fe1",
    "status": "complete",
    "withdrawAmount": 2,
    "withdrawCryptoAmount": 2,
    "transactionHash": "F19TfyGxBgebZt4q8h5bgf9Luabpypm3zSSzWR5ZUp8CKGNvL2r58zqGvWXvKftppiWKszV11jNQtsMUoFppmyb"
  },
  "feeAmount": 0.05,
  "localCurrencyFeeAmount": 50,
  "fonbnkFeeAmount": 0.03,
  "localCurrencyFonbnkFeeAmount": 30,
  "partnerFeeAmount": 0.02,
  "localCurrencyPartnerFeeAmount": 20,
  "networkFeeAmount": 0,
  "localCurrencyNetworkFeeAmount": 0,
  "resumeUrl": "https://pay.fonbnk.com/swap-status?orderId=651e764399a4b360c7eb0178"
}

Get orders

get
/api/pay-widget-merchant/orders

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

Authorizations
x-client-idstringRequired
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

walletTypestring · enumOptional

wallet type of orders

Possible values:
walletAddressstringOptional
userPhoneNumberstringOptional

phone number of the client, should include country code

userEmailstringOptional

email of the client

swapProviderstring · enumOptionalPossible 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
/api/pay-widget-merchant/orders
GET /api/pay-widget-merchant/orders?limit=1 HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
200

Successful response

{
  "nextCursor": "651e764399a4b360c7eb0178",
  "list": [
    {
      "_id": "651e764399a4b360c7eb0178",
      "walletType": "SOLANA",
      "asset": "USDC",
      "walletAddress": "53L9ahwHcNnD4F11TqNHQgVUa75WgaCL2WGeiKiK2gCc",
      "feePercent": 2.5,
      "fonbnkFeePercent": 1.5,
      "partnerFeePercent": 1,
      "gasUsdAmount": 0,
      "merchantId": "645a20cbaf1d31dbd52c0fda",
      "createdAt": "2023-10-05T08:39:31.691Z",
      "buySwap": {
        "_id": "651e764399a4b360c7eb016d",
        "buyerUserPhone": "380962669394",
        "sellerUserPhone": "380960000000",
        "amount": 210,
        "airtimeAmount": 2100,
        "status": "seller_confirmed",
        "provider": "bank_transfer",
        "expiresAt": "2023-10-05T09:39:31.492Z",
        "createdAt": "2023-10-05T08:39:31.500Z",
        "buyerConfirmedAt": "2023-10-05T08:39:37.027Z",
        "countryIsoCode": "NG"
      },
      "withdrawal": {
        "_id": "651e7653db37ee6b74883fe1",
        "status": "complete",
        "withdrawAmount": 2,
        "withdrawCryptoAmount": 2,
        "transactionHash": "F19TfyGxBgebZt4q8h5bgf9Luabpypm3zSSzWR5ZUp8CKGNvL2r58zqGvWXvKftppiWKszV11jNQtsMUoFppmyb"
      },
      "feeAmount": 0.05,
      "localCurrencyFeeAmount": 50,
      "fonbnkFeeAmount": 0.03,
      "localCurrencyFonbnkFeeAmount": 30,
      "partnerFeeAmount": 0.02,
      "localCurrencyPartnerFeeAmount": 20,
      "networkFeeAmount": 0,
      "localCurrencyNetworkFeeAmount": 0,
      "resumeUrl": "https://pay.fonbnk.com/swap-status?orderId=651e764399a4b360c7eb0178"
    }
  ]
}

Get price

get
/api/pay-widget-merchant/price

Returns expected price in USDC, cUSD etc. for a given amount of mobile money and vice versa.

Authorizations
x-client-idstringRequired
Query parameters
networkstring · enumRequiredPossible values:
assetstring · enumRequiredPossible values:
currencystring · enumRequiredPossible values:
amountnumberRequired
countrystringRequired

country ISO code, e.g. NG

providerstring · enumRequiredPossible values:
carrierIdstringOptional
Responses
200

Successful response

application/json
get
/api/pay-widget-merchant/price
GET /api/pay-widget-merchant/price?network=POLYGON&asset=USDC&currency=usdc&amount=1&country=text&provider=bank_transfer HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
200

Successful response

{
  "quoteId": "651e764399a4b360c7eb0178",
  "cryptoTotalAmount": 5.12,
  "cryptoWithdrawAmount": 5,
  "cryptoFeeAmount": 0.12,
  "cryptoGasAmount": 0,
  "localCurrencyAmount": 5120,
  "feePercent": 2.5,
  "fonbnkFeePercent": 1.5,
  "partnerFeePercent": 1,
  "totalAmount": 5.12,
  "withdrawAmount": 5,
  "feeAmount": 0.12,
  "localCurrencyFeeAmount": 120,
  "fonbnkFeeAmount": 0.07,
  "localCurrencyFonbnkFeeAmount": 70,
  "partnerFeeAmount": 0.05,
  "localCurrencyPartnerFeeAmount": 50,
  "networkFeeAmount": 0,
  "localCurrencyNetworkFeeAmount": 0,
  "usdcTotalAmount": 5.12,
  "usdcWithdrawAmount": 5,
  "usdcFeeAmount": 0.12,
  "usdcGasAmount": 0
}

Get providers

get
/api/pay-widget-merchant/providers

Returns a list of providers. Optionally includes limitations data.

Authorizations
x-client-idstringRequired
Query parameters
includeLimitsbooleanOptional

Should limitations data be included in the response. Defaults to true. If limitations are not included the request will be much faster.

Default: true
networkstring · enumOptionalPossible values:
Responses
200

Successful response

application/json
get
/api/pay-widget-merchant/providers
GET /api/pay-widget-merchant/providers HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
200

Successful response

[
  {
    "countryIsoCode": "NG",
    "currencyIsoCode": "NGN",
    "providers": [
      {
        "name": "bank_transfer",
        "description": "Bank transfer",
        "requiresCarrier": false,
        "carriers": [],
        "limits": {
          "POLYGON": {
            "cryptoLimits": {
              "min": 1,
              "max": 200
            },
            "localCurrencyLimits": {
              "type": "open_range",
              "min": 1714,
              "max": 348047,
              "step": 1,
              "withCents": false
            },
            "fees": {
              "feePercent": 2.5,
              "fonbnkFeePercent": 2.5,
              "partnerFeePercent": 0,
              "gasAmount": 0,
              "minFee": 0.01
            }
          },
          "STELLAR": {
            "cryptoLimits": {
              "min": 1,
              "max": 200
            },
            "localCurrencyLimits": {
              "type": "open_range",
              "min": 1730,
              "max": 348064,
              "step": 1,
              "withCents": false
            },
            "fees": {
              "feePercent": 2.5,
              "fonbnkFeePercent": 2.5,
              "partnerFeePercent": 0,
              "gasAmount": 0.01,
              "minFee": 0.01
            }
          },
          "AVALANCHE": {
            "cryptoLimits": {
              "min": 1,
              "max": 200
            },
            "localCurrencyLimits": {
              "type": "open_range",
              "min": 1797,
              "max": 348132,
              "step": 1,
              "withCents": false
            },
            "fees": {
              "feePercent": 2.5,
              "fonbnkFeePercent": 2.5,
              "partnerFeePercent": 0,
              "gasAmount": 0.05,
              "minFee": 0.01
            }
          },
          "SOLANA": {
            "cryptoLimits": {
              "min": 1,
              "max": 200
            },
            "localCurrencyLimits": {
              "type": "open_range",
              "min": 1714,
              "max": 348047,
              "step": 1,
              "withCents": false
            },
            "fees": {
              "feePercent": 2.5,
              "fonbnkFeePercent": 2.5,
              "partnerFeePercent": 0,
              "gasAmount": 0,
              "minFee": 0.01
            }
          },
          "BASE": {
            "cryptoLimits": {
              "min": 1,
              "max": 200
            },
            "localCurrencyLimits": {
              "type": "open_range",
              "min": 1714,
              "max": 348047,
              "step": 1,
              "withCents": false
            },
            "fees": {
              "feePercent": 2.5,
              "fonbnkFeePercent": 2.5,
              "partnerFeePercent": 0,
              "gasAmount": 0,
              "minFee": 0.01
            }
          },
          "TON": {
            "cryptoLimits": {
              "min": 1,
              "max": 200
            },
            "localCurrencyLimits": {
              "type": "open_range",
              "min": 1747,
              "max": 348081,
              "step": 1,
              "withCents": false
            },
            "fees": {
              "feePercent": 2.5,
              "fonbnkFeePercent": 2.5,
              "partnerFeePercent": 0,
              "gasAmount": 0.02,
              "minFee": 0.01
            }
          },
          "CELO": {
            "cryptoLimits": {
              "min": 1,
              "max": 200
            },
            "localCurrencyLimits": {
              "type": "open_range",
              "min": 1714,
              "max": 348047,
              "step": 1,
              "withCents": false
            },
            "fees": {
              "feePercent": 2.5,
              "fonbnkFeePercent": 2.5,
              "partnerFeePercent": 0,
              "gasAmount": 0,
              "minFee": 0.01
            }
          }
        }
      }
    ]
  },
  {
    "countryIsoCode": "KE",
    "currencyIsoCode": "KES",
    "providers": [
      {
        "name": "carrier",
        "description": "Airtime",
        "requiresCarrier": true,
        "carriers": [
          {
            "id": "618e43914f57e07d255ff353",
            "name": "Safaricom Kenya",
            "limits": {
              "POLYGON": {
                "cryptoLimits": {
                  "min": 1,
                  "max": 1.47
                },
                "localCurrencyLimits": {
                  "type": "open_range",
                  "min": 157,
                  "max": 230,
                  "step": 1,
                  "withCents": false
                },
                "fees": {
                  "feePercent": 2.5,
                  "fonbnkFeePercent": 2.5,
                  "partnerFeePercent": 0,
                  "gasAmount": 0,
                  "minFee": 0.01
                }
              },
              "STELLAR": {
                "cryptoLimits": {
                  "min": 1,
                  "max": 1.46
                },
                "localCurrencyLimits": {
                  "type": "open_range",
                  "min": 158,
                  "max": 230,
                  "step": 1,
                  "withCents": false
                },
                "fees": {
                  "feePercent": 2.5,
                  "fonbnkFeePercent": 2.5,
                  "partnerFeePercent": 0,
                  "gasAmount": 0.01,
                  "minFee": 0.01
                }
              },
              "AVALANCHE": {
                "cryptoLimits": {
                  "min": 1,
                  "max": 1.42
                },
                "localCurrencyLimits": {
                  "type": "open_range",
                  "min": 164,
                  "max": 230,
                  "step": 1,
                  "withCents": false
                },
                "fees": {
                  "feePercent": 2.5,
                  "fonbnkFeePercent": 2.5,
                  "partnerFeePercent": 0,
                  "gasAmount": 0.05,
                  "minFee": 0.01
                }
              },
              "SOLANA": {
                "cryptoLimits": {
                  "min": 1,
                  "max": 1.47
                },
                "localCurrencyLimits": {
                  "type": "open_range",
                  "min": 157,
                  "max": 230,
                  "step": 1,
                  "withCents": false
                },
                "fees": {
                  "feePercent": 2.5,
                  "fonbnkFeePercent": 2.5,
                  "partnerFeePercent": 0,
                  "gasAmount": 0,
                  "minFee": 0.01
                }
              },
              "CELO": {
                "cryptoLimits": {
                  "min": 1,
                  "max": 1.47
                },
                "localCurrencyLimits": {
                  "type": "open_range",
                  "min": 157,
                  "max": 230,
                  "step": 1,
                  "withCents": false
                },
                "fees": {
                  "feePercent": 2.5,
                  "fonbnkFeePercent": 2.5,
                  "partnerFeePercent": 0,
                  "gasAmount": 0,
                  "minFee": 0.01
                }
              },
              "BASE": {
                "cryptoLimits": {
                  "min": 1,
                  "max": 1.47
                },
                "localCurrencyLimits": {
                  "type": "open_range",
                  "min": 157,
                  "max": 230,
                  "step": 1,
                  "withCents": false
                },
                "fees": {
                  "feePercent": 2.5,
                  "fonbnkFeePercent": 2.5,
                  "partnerFeePercent": 0,
                  "gasAmount": 0,
                  "minFee": 0.01
                }
              },
              "TON": {
                "cryptoLimits": {
                  "min": 1,
                  "max": 1.45
                },
                "localCurrencyLimits": {
                  "type": "open_range",
                  "min": 160,
                  "max": 230,
                  "step": 1,
                  "withCents": false
                },
                "fees": {
                  "feePercent": 2.5,
                  "fonbnkFeePercent": 2.5,
                  "partnerFeePercent": 0,
                  "gasAmount": 0.02,
                  "minFee": 0.01
                }
              }
            }
          }
        ]
      },
      {
        "name": "mpesa",
        "description": "M-PESA",
        "requiresCarrier": true,
        "carriers": [
          {
            "id": "618e43914f57e07d255ff353",
            "name": "Safaricom Kenya",
            "limits": {
              "POLYGON": {
                "cryptoLimits": {
                  "min": 1,
                  "max": 200
                },
                "localCurrencyLimits": {
                  "type": "open_range",
                  "min": 153,
                  "max": 30506,
                  "step": 1,
                  "withCents": false
                },
                "fees": {
                  "feePercent": 2.5,
                  "fonbnkFeePercent": 2.5,
                  "partnerFeePercent": 0,
                  "gasAmount": 0,
                  "minFee": 0.01
                }
              },
              "AVALANCHE": {
                "cryptoLimits": {
                  "min": 1,
                  "max": 200
                },
                "localCurrencyLimits": {
                  "type": "open_range",
                  "min": 161,
                  "max": 30513,
                  "step": 1,
                  "withCents": false
                },
                "fees": {
                  "feePercent": 2.5,
                  "fonbnkFeePercent": 2.5,
                  "partnerFeePercent": 0,
                  "gasAmount": 0.05,
                  "minFee": 0.01
                }
              },
              "STELLAR": {
                "cryptoLimits": {
                  "min": 1,
                  "max": 200
                },
                "localCurrencyLimits": {
                  "type": "open_range",
                  "min": 155,
                  "max": 30508,
                  "step": 1,
                  "withCents": false
                },
                "fees": {
                  "feePercent": 2.5,
                  "fonbnkFeePercent": 2.5,
                  "partnerFeePercent": 0,
                  "gasAmount": 0.01,
                  "minFee": 0.01
                }
              },
              "SOLANA": {
                "cryptoLimits": {
                  "min": 1,
                  "max": 200
                },
                "localCurrencyLimits": {
                  "type": "open_range",
                  "min": 153,
                  "max": 30506,
                  "step": 1,
                  "withCents": false
                },
                "fees": {
                  "feePercent": 2.5,
                  "fonbnkFeePercent": 2.5,
                  "partnerFeePercent": 0,
                  "gasAmount": 0,
                  "minFee": 0.01
                }
              },
              "CELO": {
                "cryptoLimits": {
                  "min": 1,
                  "max": 200
                },
                "localCurrencyLimits": {
                  "type": "open_range",
                  "min": 153,
                  "max": 30506,
                  "step": 1,
                  "withCents": false
                },
                "fees": {
                  "feePercent": 2.5,
                  "fonbnkFeePercent": 2.5,
                  "partnerFeePercent": 0,
                  "gasAmount": 0,
                  "minFee": 0.01
                }
              },
              "BASE": {
                "cryptoLimits": {
                  "min": 1,
                  "max": 200
                },
                "localCurrencyLimits": {
                  "type": "open_range",
                  "min": 153,
                  "max": 30506,
                  "step": 1,
                  "withCents": false
                },
                "fees": {
                  "feePercent": 2.5,
                  "fonbnkFeePercent": 2.5,
                  "partnerFeePercent": 0,
                  "gasAmount": 0,
                  "minFee": 0.01
                }
              },
              "TON": {
                "cryptoLimits": {
                  "min": 1,
                  "max": 200
                },
                "localCurrencyLimits": {
                  "type": "open_range",
                  "min": 156,
                  "max": 30509,
                  "step": 1,
                  "withCents": false
                },
                "fees": {
                  "feePercent": 2.5,
                  "fonbnkFeePercent": 2.5,
                  "partnerFeePercent": 0,
                  "gasAmount": 0.02,
                  "minFee": 0.01
                }
              }
            }
          }
        ]
      }
    ]
  }
]

Get limits

get
/api/pay-widget-merchant/limits

Returns minimum and maximum amount of order in crypto and local currency and applied fees.

Authorizations
x-client-idstringRequired
Query parameters
networkstring · enumRequiredPossible values:
assetstring · enumOptionalPossible values:
countrystringRequired
providerstring · enumRequiredPossible values:
carrierIdstringOptional
Responses
200

Successful response

application/json
get
/api/pay-widget-merchant/limits
GET /api/pay-widget-merchant/limits?network=POLYGON&country=text&provider=bank_transfer HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Accept: */*
200

Successful response

{
  "cryptoLimits": {
    "min": 1,
    "max": 200
  },
  "localCurrencyLimits": {
    "type": "open_range",
    "min": 1702,
    "max": 343959,
    "step": 1,
    "withCents": false
  },
  "fees": {
    "feePercent": 2.5,
    "fonbnkFeePercent": 2.5,
    "partnerFeePercent": 0,
    "gasAmount": 0,
    "minFee": 0.01
  }
}

Last updated