Withdrawal

Withdrawing staked TRX in the TRON network via the Staking API is performed through undelegation:

  1. Check your account’s staking and voting status.
  2. Create an undelegate transaction (unfreeze).
  3. Sign and broadcast the transaction.
  4. Confirm completion.

In TRON, “undelegate” not only removes votes, but also initiates unfreezing of TRX.
No separate withdrawal step is needed.

1. Check Account Status

Use this step to view your frozen TRX, available balance, and current votes before withdrawing.

Send a GET request to /api/v1/tron/[network]/account/[delegatorAddress]

Example request:

curl --request GET \
  --url 'https://api-test.p2p.org/api/v1/tron/testnet-nile/account/TVscj8F6wPZ92d1smGYjH9heZR1MaEcE9u' \
  --header 'accept: application/json' \
  --header 'Authorization: Bearer <token>'

Example response:

{
  "error": null,
  "result": {
    "address": "TVscj8F6wPZ92d1smGYjH9heZR1MaEcE9u",
    "availableBalance": 25000000,
    "frozen": {
      "total": 1000000,
      "bandwidth": 1000000,
      "energy": 0,
      "expireAt": 1750000000000
    },
    "votes": [
      {
        "voteAddress": "TH7Fe1W8CcLeqN4LGfqX1R9EpsnrJBQJji",
        "voteCount": 1
      }
    ],
    "createdAt": "2025-07-04T08:50:00.000Z"
  }
}
  • address — your TRON wallet address (Base58, e.g., starts with "T").
  • availableBalance — current available (unfrozen) balance, in SUN.
  • frozen — information about frozen TRX:
    • total — total amount of frozen TRX, in SUN.
    • bandwidth — TRX frozen for BANDWIDTH, in SUN.
    • energy — TRX frozen for ENERGY, in SUN.
    • expireAt — timestamp (ms since epoch) when frozen TRX becomes eligible for unfreezing.
  • votes — array of active votes:
    • voteAddress — Super Representative address for which you voted.
    • voteCount — number of votes.
  • createdAt — time this snapshot was generated (ISO 8601).

2. Create Undelegate (Unfreeze) Transaction

To withdraw (unfreeze) your TRX, you must undelegate.
All votes will be reset and the corresponding TRX will be unlocked (after the protocol freeze period).

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 — your TRON wallet address.
  • amount — amount of TRX to undelegate (in SUN).
  • resource — resource type: BANDWIDTH or ENERGY.

Example response:

{
  "error": null,
  "result": {
    "delegatorAddress": "TVscj8F6wPZ92d1smGYjH9heZR1MaEcE9u",
    "amount": 1000000,
    "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
      }
    },
    "createdAt": "2025-07-04T09:01:00.000Z"
  }
}
  • delegatorAddress — your TRON wallet address.
  • amount — amount of TRX to undelegate (in SUN).
  • resource — resource type for undelegation (BANDWIDTH or ENERGY).
  • unsignedTransaction — object representing the unsigned transaction:
    • visible — whether address fields are visible/encoded (false).
    • txID — transaction ID (hex string).
    • raw_data_hex — hex-encoded raw transaction data.
    • raw_data
      • contract
        • parameter
          • value.owner_address — address initiating the undelegation (hex).
          • value.unfreeze_balance — amount to unfreeze (in SUN).
          • value.resource — resource type (BANDWIDTH or ENERGY).
          • type_url — protocol contract type.
        • type — contract type (UnfreezeBalanceV2Contract).
      • ref_block_bytes — reference block bytes (hex).
      • ref_block_hash — reference block hash (hex).
      • expiration — transaction expiration timestamp (ms since epoch).
      • timestamp — transaction creation timestamp (ms since epoch).
  • createdAt — time transaction was prepared (ISO 8601).

3. Sign and Send Transaction

Sign and broadcast the transaction using your local signer or SDK.

See: Sign and Send Transaction

4. Confirm Completion

You can verify withdrawal by:

What's Next?