Withdrawal
To withdraw staked TRX on the TRON network via the Staking API:
- Create an undelegate request: remove your votes and unfreeze your TRX.
- Create a withdrawal request to claim unfrozen TRX.
- Sign and send the transaction to the network.
1. Create undelegate request
To initiate the token undelegation, send a POST request to /api/v1/tron/{network}/staking/undelegate.
Example request:
curl --request POST \
--url 'https://api-test.p2p.org/api/v1/tron/testnet-nile/staking/undelegate' \
--header 'accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"delegatorAddress": "TVscj8F6wPZ92d1smGYjH9heZR1MaEcE9u",
"amount": 1000000,
"resource": "BANDWIDTH"
}'delegatorAddress— delegator account address.amount— amount of tokens to unfreeze in SUN (1 TRX = 10⁶ SUN).resource— type of resources to be used for freezing TRX:BANDWIDTH— for regular transactions on the TRON chain.ENERGY— for using smart contracts or running DApps.
Example response:
{
"error": null,
"result": {
"delegatorAddress": "TVscj8F6wPZ92d1smGYjH9heZR1MaEcE9u",
"amount": 10000000,
"resource": "BANDWIDTH",
"unsignedTransaction": {
"visible": false,
"txID": "e8f2a91ab4ef8a26b1...",
"raw_data_hex": "...",
"raw_data": {
"contract": [
{
"parameter": {
"value": {
"owner_address": "41da53d324a354aa5924c7117caff3ead97910a5e1",
"unfreeze_balance": 1000000,
"resource": "BANDWIDTH"
},
"type_url": "type.googleapis.com/protocol.UnfreezeBalanceV2Contract"
},
"type": "UnfreezeBalanceV2Contract"
}
],
"ref_block_bytes": "0e0c",
"ref_block_hash": "7db974037137d39c",
"expiration": 1750000200000,
"timestamp": 1750000140000
},
"unsignedTransactionSerialized": "eyJ0eElEIjoidHJ4SWQifQ==",
"createdAt": "2025-06-03T12:00:00.000Z",
"voteAccount": "TH7Fe1W8CcLeqN4LGfqX1R9EpsnrJBQJji"
}
}delegatorAddress— delegator account address.amount— amount of tokens to unfreeze in SUN (1 TRX = 10⁶ SUN).resource— type of resources used for processing the freeze transaction:BANDWIDTHorENERGY.unsignedTransaction— original unsigned transaction object returned by tronWeb.visible— internal SDK parameter; always set tofalse.txID— hash of the transaction.raw_data_hex— raw payload of the unsigned transaction in the hexadecimal format.raw_data— full decoded transaction structure with all the fields and metadata:contract— list of TRON contracts:parameter.type_url— TRON protocol contract, e.g.,type.googleapis.com/protocol.UnfreezeBalanceV2Contract.parameter.value.owner_address— TRON account address in the hexadecimal format.parameter.value.unfreeze_balance— amount of tokens to unfreeze in SUN (1 TRX = 10⁶ SUN).parameter.value.resource— resource type:BANDWIDTHorENERGY.
ref_block_bytes,ref_block_hash— hash and references of the block in which the transaction has been included.expiration— timestamp of the transaction expiration in ms since last epoch.timestamp— timestamp of the transaction in ms since last epoch.
createdAt— timestamp of the transaction in the ISO 8601 format.unsignedTransactionSerialized— unsigned serialized transaction in Base64 encrypted format ready for signing.voteAccount— address of the Super Representative for voting.
2. Sign and send transaction
Use unsignedTransactionSerialized to sign and send the signed transaction to the TRON network.
By broadcasting this transaction, you're resetting all votes.
Note that there is a protocol freeze period before the corresponding TRX tokens will be unlocked. You can verify the withdrawal by several options:
- Get the delegator account summary via /api/v1/tron/{network}/account/{address}. The
availableBalanceparameter will increase after the tokens are unfrozen and unlocked. - Check the transaction status via /api/v1/tron/{network}/transaction/{transactionHash}/status endpoint.
- View your account on Tronscan.
3. Create withdraw request
To initiate the token withdrawal, send a POST request to /api/v1/tron/{network}/staking/withdraw.
curl --request POST \
--url 'https://api-test.p2p.org/api/v1/tron/testnet-nile/staking/withdraw' \
--header 'accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"delegatorAddress": "TVscj8F6wPZ92d1smGYjH9heZR1MaEcE9u",
}'delegatorAddress— delegator account address.
Example response:
{
"error": null,
"result": {
"delegatorAddress": "TVscj8F6wPZ92d1smGYjH9heZR1MaEcE9u",
"unsignedTransaction": {
"visible": false,
"txID": "c1516c840a85c0d0f027a2842970b1fa72f604e9d48977eded8b4a59e9596bd3",
"raw_data_hex": "0a025e9c2208c8eb8a95e3fd058640bfb1aebfcd335a5a083812560a3b747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5769746864726177457870697265556e667265657a65436f6e747261637412170a15414b167d9a29108763f3794cdb295a8c0b60b21b9370df899cbfcd33",
"raw_data": {
"contract": [
{
"parameter": {
"value": {
"owner_address": "41da53d324a354aa5924c7117caff3ead97910a5e1"
},
"type_url": "type.googleapis.com/protocol.WithdrawExpireUnfreezeContract"
},
"type": "WithdrawExpireUnfreezeContract"
}
],
"ref_block_bytes": "5e9c",
"ref_block_hash": "c8eb8a95e3fd0586",
"expiration": 1773149067455,
"timestamp": 1773148767455
}
},
"unsignedTransactionSerialized": "eyJ2a...",
"createdAt": "2026-03-10T13:19:27.087Z"
}
}delegatorAddress— delegator account address.unsignedTransaction— original unsigned transaction object returned by tronWeb.visible— internal SDK parameter; always set tofalse.txID— hash of the transaction.raw_data_hex— raw payload of the unsigned transaction in the hexadecimal format.raw_data— full decoded transaction structure with all the fields and metadata:contract— list of TRON contracts:parameter.value.owner_address— TRON account address in the hexadecimal format.parameter.type_url— TRON protocol contract, e.g.,type.googleapis.com/protocol.WithdrawExpireUnfreezeContract.type— TRON protocol contract type
ref_block_bytes,ref_block_hash— hash and references of the block in which the transaction has been included.expiration— timestamp of the transaction expiration in ms since last epoch.timestamp— timestamp of the transaction in ms since last epoch.
unsignedTransactionSerialized— unsigned serialized transaction in Base64 encrypted format ready for signing.createdAt— timestamp of the transaction in the ISO 8601 format.
4. Sign and send transaction
Use unsignedTransactionSerialized to sign and send the signed transaction to the TRON network.
What's next?
- Sign and Send Transaction
- Staking API reference
Updated 7 days ago