> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chipipay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# get_transaction

> Fetches a single transaction by its hash or internal ID.

## Usage

```python theme={null}
from chipi_sdk import ChipiSDK, ChipiSDKConfig

sdk = ChipiSDK(config=ChipiSDKConfig(
    api_public_key="pk_prod_YOUR_KEY",
    api_secret_key="sk_prod_YOUR_KEY",
))

tx = sdk.get_transaction(hash_or_id="0x...")
```

### Parameters

* `hash_or_id` (str): Transaction hash (`0x...`) or internal database ID
* `bearer_token` (str, optional): JWT token. Falls back to `api_secret_key` if not provided

### Return Value

Returns a `Transaction` object with `id`, `transaction_hash`, `status`, `sender_address`, `destination_address`, `amount`, `token`, and timestamps.

## Example Implementation

```python theme={null}
from chipi_sdk import ChipiSDK, ChipiSDKConfig

sdk = ChipiSDK(
    config=ChipiSDKConfig(
        api_public_key="pk_prod_YOUR_KEY",
        api_secret_key="sk_prod_YOUR_KEY",
    )
)

# Fetch by hash
tx = sdk.get_transaction("0x04abc...def")
print(f"Status: {tx.status}, Amount: {tx.amount}")

# Fetch by internal ID
tx = sdk.get_transaction("tx-123")
```

## Async Version

```python theme={null}
import asyncio

async def main():
    tx = await sdk.aget_transaction("0x04abc...def")
    print(f"Status: {tx.status}")

asyncio.run(main())
```
