/wallet/gettransactioninfobyid - Tron

This endpoint returns the execution result of a transaction: its block, Energy and Bandwidth used, fee, and any smart-contract logs. This is the TRON equivalent of a transaction receipt.

This is a read endpoint. It is also served by the Solidity node at https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/walletsolidity/gettransactioninfobyid, which returns only confirmed, irreversible data. Use the Solidity node for balance and payment verification.

Parameters

ParameterTypeRequiredDescription
valuestringYesThe transaction id (hash)

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/wallet/gettransactioninfobyid' \
--header 'Content-Type: application/json' \
--data-raw '{
  "value": "d5ec749ecc2a615399d8a6c864ea4c74ff9f523c2be0e341ac9be5d47d7c2d62"
}'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/wallet/gettransactioninfobyid',
    {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({"value": "d5ec749ecc2a615399d8a6c864ea4c74ff9f523c2be0e341ac9be5d47d7c2d62"})
    }
);
console.log(await response.json());

example.py

pythonimport requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/wallet/gettransactioninfobyid',
    headers={'Content-Type': 'application/json'},
    json={"value": "d5ec749ecc2a615399d8a6c864ea4c74ff9f523c2be0e341ac9be5d47d7c2d62"}
)

print(response.json())

Response

json{
  "id": "d5ec749ecc2a615399d8a6c864ea4c74ff9f523c2be0e341ac9be5d47d7c2d62",
  "blockNumber": 68000000,
  "blockTimeStamp": 1719400000000,
  "receipt": {
    "energy_usage_total": 65000,
    "net_usage": 345,
    "result": "SUCCESS"
  },
  "fee": 27000,
  "contractResult": [
    "..."
  ],
  "log": [
    {
      "address": "a614f803b6fd780986a42c78ec9c7f77e6ded13c",
      "topics": [
        "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
      ],
      "data": "00000000000000000000000000000000000000000000000000000000000f4240"
    }
  ]
}

Response Parameters

FieldTypeDescription
idstringThe transaction id
blockNumberintegerBlock height the transaction was included in
receipt.energy_usage_totalintegerTotal Energy consumed
receipt.net_usageintegerBandwidth consumed
receipt.resultstringExecution result, such as SUCCESS or REVERT
logarraySmart-contract event logs emitted by the transaction

Use Cases

  • Receipt Reads: Confirm a transaction succeeded and read its cost
  • TRC-20 Events: Read Transfer logs emitted by a token contract
  • Energy Accounting: Read Energy and Bandwidth consumed by a call
  • Fee Reconciliation: Read the fee burned for a transaction

Error Handling

HTTP StatusMessageDescription
200OKThe request succeeded; a missing transaction returns an empty object
400Bad requestThe transaction id or body is malformed
500Internal errorThe node failed to read the transaction