Skip to main content

Create a fixed-rate transaction


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

Retrieves 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:

NameTypeRequiredDescription
addressstringtrueThe payout address.
amountFromstringfalseThe amount for sending.
amountTostringfalseThe amount for receiving.
extraIdstringfalseThe address additional ID.
fromstringtrueThe payin currency ticker. Enter in lowercase.
tostringtrueThe payout currency ticker. Enter in lowercase.
rateIdstringtrueThe rate ID from the getFixRate or getFixRateForAmount responses.
refundAddressstringtrueThe wallet address for the refund. Required for technical issues during the exchange. The wallet currency must match the from one.
refundExtraIdstringfalseThe refundAddress additional ID.
userMetadatastringfalseThe 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:

NameTypeDescription
amountExpectedFromnumberThe amountFrom value from createFixTransaction request.
amountExpectedTostringThe amountTo value from getFixRateForAmount response.
This is the estimated payout amount before withholding the networkFee.
createdAttimestampThe transaction creation time.
currencyTostringThe payout currency ticker.
currencyFromstringThe payin currency ticker.
idstringThe transaction ID. Can be used in getStatus method.
networkFeestringThe network fee from a sent amount. Displayed in the payout currency.
payinAddressstringThe wallet address for sending coins.
payinExtraIdstringThe 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.
payoutAddressstringThe wallet address for sending the exchange result.
payoutExtraIdstringThe payoutAddress extra ID.
payTillstringThe time until the user has to make the payment.
refundAddressstringThe wallet address for the refund. The currency of the refund wallet must match with the from currency.
refundExtraIdstringThe payoutAddress extra ID.
statusstringThe transaction status. Always new for created transactions. Info
If you check the same transaction using the getStatus or getTransactions method, you get the waiting status as an equivalent to new.
typestringThe 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

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.
Error: Invalid addressThe specified payout address is invalid.
Error: Invalid refund addressThe specified refund address is invalid.
Error: rateId was expired or already used. Use method getFixRateForAmount to generate new rateIdThe generated rateId is invalid. Requires generating a new one.
-32603
  • Internal Error
  • Error
Mostly, this is a technical issue on our side. Requires further investigation.