Skip to main content

Get a fixed rate


posthttps://api.criptointercambio.com/v2/#getFixRate

Retrieves a fixed-rate exchange estimation for the provided amount.

warning

A deprecated method. Use the getFixRateForAmount instead.


Request

Header parameters

Requires authentication headers.

Body parameters

Consists of a JSON-RPC 2.0 protocol request object.

The params schema:

NameTypeRequiredDescription
fromstringtrueThe payin currency code. Enter in lowercase.
tostringtrueThe payout currency code. Enter in lowercase.

Sample request

{
"jsonrpc": "2.0",
"id": "exampleCustomIdValue",
"method": "getFixRate",
"params": [
{
"from": "xrp",
"to": "atom"
},
{
"from": "atom",
"to": "xrp"
}
]
}

Response

Successful response

Consists of a JSON-RPC 2.0 protocol response object.

The result schema:

NameTypeDescription
expiredAttimestampThe fixed-rate expiration time.
fromstringThe payin currency code.
tostringThe payout currency code.
idstringThe exchange rate ID. You should use the id for 1 minute. It is enough to start the exchange. After expiration, id is not actual for creation. Info
The id param requires storage on your side. The createFixTransaction method uses it as the rateId while calling.
maxstringThe maximum exchangeable amount.
maxFromstringThe maximum exchangeable amount for payin.
maxTostringThe maximum exchangeable amount for payout.
minstringThe minimum exchangeable amount.
minFromstringThe minimum exchangeable amount for payin.
minTostringThe minimum exchangeable amount for payout.
networkFeestringThe network commission from a sent amount. For one-step exchanges, displayed in the payout currency. For two-step exchanges, displayed in BTC or in USDT.
resultstringThe exchange rate before withholding the network fee.
Warning
To calculate the exact amount that the user will get, multiply the amount that the user wants to send to the result and deduct the value of the networkFee.

Sample successful response

{
"jsonrpc": "2.0",
"id": "exampleCustomIdValue",
"result": [
{
"expiredAt": 1768479809,
"from": "xrp",
"to": "atom",
"id": "kUs**************Wr#H",
"max": "3715.334407",
"maxFrom": "3715.334407",
"maxTo": "3100.000000",
"min": "37.842952",
"minFrom": "37.842952",
"minTo": "31.575395",
"networkFee": "0.002431",
"result": "0.02556948"
},
{
"expiredAt": 1768479809,
"from": "atom",
"to": "xrp",
"id": "eDn!*************FTL",
"max": "3100.000000",
"maxFrom": "3100.000000",
"maxTo": "3715.334407",
"min": "31.575395",
"minFrom": "31.575395",
"minTo": "37.842952",
"networkFee": "0.025064",
"result": "1.135929441329"
}
]
}

Error response

Consists of a JSON-RPC 2.0 protocol error response object.

Sample error response

{
"jsonrpc": "2.0",
"id": "exampleCustomIdValue",
"error": {
"code": -32600,
"message": "Error: You reached requests limit 10 rps"
}
}

Error codes

CodeMessageDescription
-32600Invalid amount: maximal amount is {max_amount} The currency amount for exchange is above the maximum amount.
-32602Invalid currency: {currency} temporary disabledCripto InterCambio temporarily disabled this currency.
Invalid currency: {currency} temporary disabled for fix rate transactionsCripto InterCambio temporarily disabled this currency for fixed-rate transactions.
Invalid currency: {currency} is temporary disabled on API as input currencyCripto InterCambio temporarily disabled this currency for payin.
Invalid currency: {currency} is temporary disabled on API as output currencyCripto InterCambio temporarily disabled this currency for payout.
Invalid currency: {currency} not found
  • Cripto InterCambio does not list this currency.
  • The currency ticker is invalid.
Parameter {param} is invalidThe specified request param is invalid.
-32603
  • Internal Error
  • Error
Mostly, this is a technical issue on our side. Requires further investigation.