Create private transaction
After a successful call of createPrivateSendTransaction method, you get a unique ID to track the transaction status and a payin address for user to send money to.
info
The amount value should be understood as an expected payout amount to the user before withholding the serviceFee.
HTTP request
post
/v2/#createPrivateSendTransactionRequest
Header parameters
Requires authentication.
Body parameters
Requires JSON-RPC 2.0 protocol request body.
The params parameter schema:
| Name | Type | Required | Description |
|---|---|---|---|
| currency | string | true | Currency ticker (in lowercase). |
| amount | string | true | Amount of currency that user is going to send. |
| address | string | true | Recipient address. |
| addressExtraId | string | false | Additional ID for address for currencies that use additional ID for transaction processing. |
| userMetadata | string | false | Escaped JSON. You can use userMetadata to include any additional parameters for customization purposes. To use this feature, please contact us at [email protected]. |
Sample request payload
application/json
{
"jsonrpc": "2.0",
"id": "test",
"method": "createPrivateSendTransaction",
"params": {
"currency": "eth",
"address": "<<valid eth address>>",
"amount": "0.2934325"
}
}
Sample cURL
curl --location --request POST 'https://api.changelly.com/v2' \
--header 'X-Api-Key: {{apiKey}}' \
--header 'X-Api-Signature: {{sign}}' \
--data-raw '{
"jsonrpc": "2.0",
"id": "test",
"method": "createPrivateSendTransaction",
"params": {
"currency": "eth",
"address": "<<valid eth address>>",
"amount": "0.2934325"
}
}'
Response
Response parameters
Requires JSON-RPC 2.0 protocol response body.
The result parameter schema:
| Name | Type | Description |
|---|---|---|
| id | string | Transaction ID. Could be used in getStatus method. |
| currency | string | Payin currency ticker. |
| amount | string | The estimated payout amount before withholding the network fee. |
| payoutAddress | string | Recipient address. |
| addressExtraId | string | Additional ID for address for currencies that use additional ID for transaction processing. |
| payinAddress | string | Address for a user to send coins to. |
| payinExtraId | string | Additional ID for payinAddress in case it is required. Note: If the payinExtraId parameter is returned in the response and is not null, it is required for user to send the funds to the payinAddress specifying extraId. Otherwise, the transactions will not be processed and the user will need to get a refund through technical support. |
| status | string | Transaction status. Will always be new when transaction is created. |
| serviceFee | string | Commission taken by Changelly and the network from the amount sent to the user. Displayed in payout currency. |
| createdAt | integer | Time in timestamp format (microseconds) when the transaction was created. |
Sample response
application/json
{
"jsonrpc": "2.0",
"id": "test",
"result": {
"id": "uiib******khs9n",
"currency": "eth",
"amount": "0.2934325",
"payoutAddress": "0x576e****************1499a9",
"payinAddress": "0x0c7c****************e318ea",
"status": "new",
"serviceFee": "0.00009",
"createdAt": 1657278685000000
}
}
Error response
Error response parameters
Check the error response schema.
Error codes
| Code | Message | Description |
|---|---|---|
-32601 | Method not found | The method you're calling doesn't exist. |
-32602 | Invalid amount. {limit_type} amount is {limit} {currency} | The attempt to send currency out of limits. {limit_type} is a “Minimal“ or “Maximum“ value. |
-32602 | Invalid currency: {currency} temporary disabled | This currency is currently disabled. |
-32602 | Invalid currency: {currency} not found | This currency is not listed on Changelly or the ticker is invalid. |
-32602 | Invalid {param} | You've specified an invalid parameter. |
-32602 | Invalid params | You haven't specified a few required parameters. |
-32602 | Invalid payout address | You've specified an invalid payout address. |
-32602 | Not enough liquidity. Max amount is {max} {currency}. | The amount you've specified exceeds maximal volume. |
-32603 | Error: You reached requests limit {limit} rps | You have sent requests more than the RPS limit. The default RPS limit is 10. |
-32603 | Internal Error or Error | Most likely, the problem is on our side. Further investigation is required. |
-32603 | An error encountered during address generation. Please try again later | An error occurred during address generation. |