> For the complete documentation index, see [llms.txt](https://docs.getblock.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getblock.io/api-reference/tron-trx/tron-rest-api/wallet-gettransactionbyid-tron.md).

# /wallet/gettransactionbyid - Tron

This endpoint returns a transaction by its id, including its contract data, signatures, and raw data.

{% hint style="info" %}
This is a read endpoint. It is also served by the Solidity node at `https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/walletsolidity/gettransactionbyid`, which returns only confirmed, irreversible data. Use the Solidity node for balance and payment verification.
{% endhint %}

## Parameters

| Parameter | Type    | Required | Description                                      |
| --------- | ------- | -------- | ------------------------------------------------ |
| value     | string  | Yes      | The transaction id (hash)                        |
| visible   | boolean | No       | Return addresses in base58 format. Default false |

## Request

{% tabs %}
{% tab title="cURL" %}
{% code overflow="wrap" %}

```bash
curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/wallet/gettransactionbyid' \
--header 'Content-Type: application/json' \
--data-raw '{
  "value": "d5ec749ecc2a615399d8a6c864ea4c74ff9f523c2be0e341ac9be5d47d7c2d62",
  "visible": true
}'
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript" %}
{% code title="example.js" %}

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

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code title="example.py" %}

```python
import requests

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

print(response.json())
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Response

```json
{
  "txID": "d5ec749ecc2a615399d8a6c864ea4c74ff9f523c2be0e341ac9be5d47d7c2d62",
  "raw_data": {
    "contract": [
      {
        "type": "TransferContract",
        "parameter": {
          "value": {
            "amount": 1000000,
            "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
            "to_address": "TJmmqjb1DK9TTZbQXzRQ2AuA94z4gKAPFh"
          }
        }
      }
    ],
    "timestamp": 1719400000000
  },
  "signature": [
    "a1b2c3..."
  ],
  "ret": [
    {
      "contractRet": "SUCCESS"
    }
  ]
}
```

## Response Parameters

| Field              | Type   | Description                                                     |
| ------------------ | ------ | --------------------------------------------------------------- |
| txID               | string | The transaction id                                              |
| raw\_data.contract | array  | The contract(s) carried by the transaction and their parameters |
| signature          | array  | Signatures over the transaction                                 |
| ret                | array  | Transaction result, including the contract return code          |

## Use Cases

* **Transaction Views**: Render a transaction's contract and result
* **Payment Confirmation**: Read a transfer's amount and parties
* **Signature Inspection**: Read the signatures on a transaction
* **Debugging**: Inspect the raw contract data of a transaction

## Error Handling

| HTTP Status | Message        | Description                                                          |
| ----------- | -------------- | -------------------------------------------------------------------- |
| 200         | OK             | The request succeeded; a missing transaction returns an empty object |
| 400         | Bad request    | The transaction id or body is malformed                              |
| 500         | Internal error | The node failed to read the transaction                              |
