Before initializing a buy transaction, you'll need to know the available fiat currencies and cryptocurrencies. Make a GET request to this endpoint
Copy https://api.localramp.co/v1/transaction/buy/currencies
Copy x-auth-token: <PUBLIC_KEY>
Copy {
"status": "success",
"data": {
"sender_currency": [
{
"fiat": "NGN",
"name": "Nigeria",
"max_decimal": 2,
"country_code": "NG"
},
{
"fiat": "KES",
"name": "Kenya",
"max_decimal": 2,
"country_code": "KE"
},
{
"fiat": "ZMW",
"name": "Zambia",
"max_decimal": 2,
"country_code": "ZM"
}
],
"receiver_currency": [
{
"coin": "NEAR_BSC",
"name": "NEAR Protocol - BNB Smart Chain (BEP20)",
"address_regex": "^(0x)[0-9A-Fa-f]{40}$",
"memo_regex": "",
"requires_tag": false,
"max_decimal": 8,
"integer_multiple": "0.00000001",
"is_stable": false,
"estimated_arrival_time": "5"
},
{
"coin": "NEAR_NEAR",
"name": "NEAR Protocol - NEAR Protocol",
"address_regex": "^[a-z0-9_-]{1}[a-z0-9_.-]{0,62}[a-z0-9_-]{1}$",
"memo_regex": "",
"requires_tag": false,
"max_decimal": 8,
"integer_multiple": "0.00000001",
"is_stable": false,
"estimated_arrival_time": "20"
}
]
}
}
Note the decimal place for tokens. If a token has a max_decimal
value of 8, the API would accept decimal strings between 1 to 8 decimal places e.g "0.1", "2.345", "670.45628394"
Coins are represented as "coin_network". USDT on the Tron and Binance smart chain would be represented as "USDT_TRX" and "USDT_BSC" respectively.