๐ Send TRX from one address to another
Code samples
POST /api/v1/trx/account/send
Creates and broadcasts a transaction to send TRX from one address to another
Body parameter
{
"private_key": "4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d",
"to_address": "TFPn7vYQckxhKxhHX5CaAzWCnbYJCgG2DF",
"amount": 1000000
}
๐ ๏ธ Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | Transaction details including sender's private key, recipient address, and amount |
| ยป private_key | body | string | true | Sender's private key in hex format |
| ยป to_address | body | string | true | Recipient's Tron address in base58 format |
| ยป amount | body | integer | true | Amount of TRX to send in SUN (1 TRX = 1,000,000 SUN) |
Example responses
200 Response
{
"success": true,
"tx_id": "95354c4bdc832fa21a3b6e3f32137bbca11a576c75109bd598283ab864a81ce7",
"from_address": "TLWKepDBC8RZjAhtWyNqASyzgyVyHUuS7o",
"to_address": "TFPn7vYQckxhKxhHX5CaAzWCnbYJCgG2DF",
"amount": 1000000,
"amount_trx": 1
}
๐ Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful response | Inline |
| 400 | Bad Request | Bad request (missing or invalid parameters) | None |
| 405 | Method Not Allowed | Method not allowed (only POST is supported) | None |
| 500 | Internal Server Error | Internal server error (transaction creation or broadcast failed) | None |
๐ Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| ยป success | boolean | false | none | none |
| ยป tx_id | string | false | none | Transaction ID (hash) |
| ยป from_address | string | false | none | Sender's address |
| ยป to_address | string | false | none | Recipient's address |
| ยป amount | integer | false | none | Amount in SUN |
| ยป amount_trx | number | false | none | Amount in TRX |