> ## 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.

# getTransaction

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

## Usage

```typescript theme={null}
const transaction = await sdk.getTransaction("0x...", bearerToken);
```

## Parameters

| Parameter     | Type     | Required | Description                                             |
| ------------- | -------- | -------- | ------------------------------------------------------- |
| `hashOrId`    | `string` | Yes      | Transaction hash (`0x...`) or internal database ID      |
| `bearerToken` | `string` | No       | JWT token. Falls back to `apiSecretKey` if not provided |

## Return Value

Returns a `Promise<Transaction>` with the full transaction record including `id`, `transactionHash`, `status`, `senderAddress`, `destinationAddress`, `amount`, `token`, and timestamps.

## Example

```typescript theme={null}
// Fetch by transaction hash
const tx = await sdk.getTransaction(
  "0x04abc...def",
  bearerToken,
);
console.log(tx.status, tx.amount, tx.token);

// Fetch by internal ID
const tx2 = await sdk.getTransaction("tx-123", bearerToken);
```
