Create a fixed-rate transaction
posthttps://api.criptointercambio.com/v2/#createFixTransactionRetrieves a created transaction with a fixed rate and a unique ID. With this ID, you can track the transaction status and a payin address for user to send money to.
info
The amountExpectedTo value is a payout amount before withholding networkFee. To calculate the exact payout amount, deduct the networkFee value from the amountExpectedTo.
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 |
|---|---|---|---|
address | string | true | The payout address. |
amountFrom | string | false | The amount for sending. |
amountTo | string | false | The amount for receiving. |
extraId | string | false | The address additional ID. |
from | string | true | The payin currency ticker. Enter in lowercase. |
to | string | true | The payout currency ticker. Enter in lowercase. |
rateId | string | true | The rate ID from the getFixRate or getFixRateForAmount responses. |
refundAddress | string | true | The wallet address for the refund. Required for technical issues during the exchange. The wallet currency must match the from one. |
refundExtraId | string | false | The refundAddress additional ID. |
userMetadata | string | false | The escaped JSON. Info The userMetadata param can include any additional settings for customization. To use this feature, contact us at [email protected]. |
Sample request
{
"jsonrpc": "2.0",
"method": "createFixTransaction",
"id": "exampleCustomIdValue",
"params": {
"address": "rUjd8***********uxFvQC6dwe",
"amountFrom": "90",
"extraId": "107*****18",
"from": "atom",
"to": "xrp",
"rateId": "%WP*************doL@3",
"refundAddress": "cosmos1s*************7ax4kzye8hz",
"refundExtraId": "55747*******6224",
"userMetadata": "{\"param1\": 25, \"param2\": \"string\", \"param3\": \"25.52\"}"
}
}
Response
Successful response
Consists of a JSON-RPC 2.0 protocol response object.
The result schema:
| Name | Type | Description |
|---|---|---|
amountExpectedFrom | number | The amountFrom value from createFixTransaction request. |
amountExpectedTo | string | The amountTo value from getFixRateForAmount response. This is the estimated payout amount before withholding the networkFee. |
createdAt | timestamp | The transaction creation time. |
currencyTo | string | The payout currency ticker. |
currencyFrom | string | The payin currency ticker. |
id | string | The transaction ID. Can be used in getStatus method. |
networkFee | string | The network fee from a sent amount. Displayed in the payout currency. |
payinAddress | string | The wallet address for sending coins. |
payinExtraId | string | The payinAddress extra ID. Info If the payinExtraId param returns as not null, the user should send the funds to the payinAddress with the extraId. Otherwise, the user has to get a refund through technical support. |
payoutAddress | string | The wallet address for sending the exchange result. |
payoutExtraId | string | The payoutAddress extra ID. |
payTill | string | The time until the user has to make the payment. |
refundAddress | string | The wallet address for the refund. The currency of the refund wallet must match with the from currency. |
refundExtraId | string | The payoutAddress extra ID. |
status | string | The transaction status. Always new for created transactions. InfoIf you check the same transaction using the getStatus or getTransactions method, you get the waiting status as an equivalent to new. |
type | string | The transaction type. Always fixed in the createTransaction response. |
warning
The trackUrl param is deprecated. Retrieve the actual status and transaction data from the getStatus and getTransactions methods.
Sample successful response
{
"jsonrpc": "2.0",
"id": "exampleCustomIdValue",
"result": {
"amountExpectedFrom": "90",
"amountExpectedTo": "104.884278",
"createdAt": 1768310846000000,
"currencyFrom": "atom",
"currencyTo": "xrp",
"id": "mret********x8l",
"networkFee": "0.025066",
"payinAddress": "cosmos1s*************7ax4kzye8hz",
"payinExtraId": "28**********623",
"payoutAddress": "rUjd************vQC6dwe",
"payoutExtraId": "107******18",
"payTill": "2022-10-31T16:41:55.000000271+00:00",
"refundAddress": "cosmos1s*************7ax4kzye8hz",
"refundExtraId": "55747*******6224",
"status": "new",
"type": "fixed"
}
}
Error response
Consists of a JSON-RPC 2.0 protocol error response object.
Sample error response
{
"jsonrpc": "2.0",
"id": "exampleCustomIdValue",
"error": {
"code": -32602,
"message": "Error: Invalid address"
}
}
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. | |
Error: Invalid address | The specified payout address is invalid. | |
Error: Invalid refund address | The specified refund address is invalid. | |
Error: rateId was expired or already used. Use method getFixRateForAmount to generate new rateId | The generated rateId is invalid. Requires generating a new one. | |
-32603 |
| Mostly, this is a technical issue on our side. Requires further investigation. |