Get a fixed rate
posthttps://api.criptointercambio.com/v2/#getFixRateRetrieves 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:
| Name | Type | Required | Description |
|---|---|---|---|
from | string | true | The payin currency code. Enter in lowercase. |
to | string | true | The 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:
| Name | Type | Description |
|---|---|---|
expiredAt | timestamp | The fixed-rate expiration time. |
from | string | The payin currency code. |
to | string | The payout currency code. |
id | string | The 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. InfoThe id param requires storage on your side. The createFixTransaction method uses it as the rateId while calling. |
max | string | The maximum exchangeable amount. |
maxFrom | string | The maximum exchangeable amount for payin. |
maxTo | string | The maximum exchangeable amount for payout. |
min | string | The minimum exchangeable amount. |
minFrom | string | The minimum exchangeable amount for payin. |
minTo | string | The minimum exchangeable amount for payout. |
networkFee | string | The 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. |
result | string | The 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
| Code | Message | Description |
|---|---|---|
-32600 | Invalid amount: maximal amount is {max_amount} | The currency amount for exchange is above the maximum amount. |
-32602 | Invalid currency: {currency} temporary disabled | Cripto InterCambio temporarily disabled this currency. |
Invalid currency: {currency} temporary disabled for fix rate transactions | Cripto InterCambio temporarily disabled this currency for fixed-rate transactions. | |
Invalid currency: {currency} is temporary disabled on API as input currency | Cripto InterCambio temporarily disabled this currency for payin. | |
Invalid currency: {currency} is temporary disabled on API as output currency | Cripto InterCambio temporarily disabled this currency for payout. | |
Invalid currency: {currency} not found |
| |
Parameter {param} is invalid | The specified request param is invalid. | |
-32603 |
| Mostly, this is a technical issue on our side. Requires further investigation. |