Skip to main content

Create a float-rate transaction


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

Retrieves a created transaction with a float rate and a unique ID. With this ID, you can track the transaction status and a payin address for user to send money to.

Additionally, the method retrieves a pair of deposit and payout addresses. If the user sends coins to the same address twice, without the second call to createTransaction, Exchange API exchanges and sends them to the user's payout address.

info

The amountExpectedTo value is a payout amount before withholding networkFee. To calculate the exact payout amount, deduct the networkFee value from 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.
amountFromstringtrueThe amount for sending.
extraIdstringfalseThe address additional ID.
fromstringtrueThe payin currency ticker. Enter in lowercase.
tostringtrueThe payout currency ticker. Enter in lowercase.
refundAddressstringfalseThe wallet address for the refund. Required for technical issues during the exchange. The wallet currency must match the from one.
refundExtraIdstringfalseThe additional ID for refundAddress.
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",
"id": "exampleCustomIdValue",
"method": "createTransaction",
"params": {
"address": "cosmos***********8hz",
"extraId": "894*********6261",
"amountFrom": "56",
"from": "xrp",
"to": "atom",
"userMetadata": "{\"param1\": 50, \"param2\": \"string\", \"param3\": \"50.5189\"}"
}
}

Response

Successful response

Consists of a JSON-RPC 2.0 protocol response object.

The result schema:

NameTypeDescription
amountExpectedFromnumberThe amountFrom value from the createTransaction request.
amountExpectedTostringThe amountTo value from the getExchangeAmount response at the moment of createTransaction calling.
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.
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.
refundAddressstringThe wallet address for the refund. Required for technical issues during the exchange. The wallet currency must match the from one.
refundExtraIdstringThe refundAddress extra ID.
statusstringThe transaction status. Always new at the createdAt time. Info
If you reference the same transaction using the getStatus or getTransactions method, you get the waiting status as an equivalent to new.
typestringThe transaction type. Always float 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": "0",
"amountExpectedTo": "0",
"createdAt": 1709126365000000,
"currencyFrom": "xrp",
"currencyTo": "atom",
"id": "hd16********83b4",
"networkFee": "0.004424",
"payinAddress": "rhL5*************uJaY1T",
"payinExtraId": "36*****747",
"payoutAddress": "cosmos***********8hz",
"payoutExtraId": "894*********6261",
"status": "new",
"type": "float"
}
}

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.
Invalid amount: minimal amount is {min_amount}The currency amount for exchange is below the minimum amount.
Error: You reached requests limit {limit} rpsRPS is out of the limit.
-32602Invalid currency: {currency} temporary disabledCripto InterCambio temporarily disabled this currency.
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.
Not enough liquidity in pair {from_currency}->{to_currency}. Max amount is {max_from} {from_currency}.The specified amount is above a maximum volume.
-32603
  • Internal Error
  • Error
Mostly, this is a technical issue on our side. Requires further investigation.
An error encountered during address generation. Please try again laterAn address generation error.