# Get Transaction

Fetch one of the authenticated user's transaction records by ID.

## Overview

Returns the record as it is currently stored — it does not query the chain. To refresh a `pending` transaction, call [Get Tx Status](https://docs.aureahub.com/docs/tx-status.md), which checks the chain and saves any change. A transaction that does not exist or belongs to another user returns `404`.

## Endpoint

### `GET /v1/transactions/{id}`

Authentication: bearer token required.

Returns a single transaction record of the authenticated user.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Transaction ID. |

**Responses**

`200` OK

```json
{
  "id": "0b9d4c1e-3f6a-4b8e-9d2c-7a5e1f3b6c90",
  "txHash": "0x7f3a…",
  "chain": "gnosis",
  "type": "send",
  "status": "confirmed",
  "fromAddress": "0x2f4B…",
  "toAddress": "0x52908400098527886E0F7030069857D2E4169EE7",
  "token": { "address": null, "symbol": "xDAI", "name": null, "decimals": 18 },
  "amount": "10000000000000000",
  "amountUsd": null,
  "amountEur": null,
  "fee": { "amount": "21000000000000", "usd": null },
  "gasUsed": "21000",
  "gasPrice": null,
  "blockNumber": "41234567",
  "blockTimestamp": "2026-09-11T10:00:15.000Z",
  "createdAt": "2026-09-11T10:00:00.000Z",
  "updatedAt": "2026-09-11T10:01:00.000Z"
}
```

`404` Not Found

```json
{ "error": "NotFoundError", "message": "Transaction not found" }
```

## Fields

| Field | Meaning |
| --- | --- |
| txHash | On-chain hash, or `null` until the transaction has been submitted (for example a non-custodial send that has not been broadcast yet). |
| type | Record type taken from the stored metadata, such as `send` or `receive`. |
| status | `pending`, `confirmed`, `failed` or `cancelled`. |
| token | Token `address`, `symbol`, `name` and `decimals` recorded when the transaction was created. `address` is `null` for the native coin; any value that was not recorded is `null`. |
| amount | Amount as stored. For sends created with Create Transaction this is the smallest-unit integer string you sent. |
| amountUsd, amountEur | Stored fiat values, or `null`. |
| fee.amount | Gas used × gas price, in wei. Filled in when the status is resolved from an EVM receipt; otherwise `null`. |
| gasUsed | Gas used, from the receipt. |
| gasPrice | The `gasPrice` passed when the send was created, or `null`. |
| blockNumber | Block number as a string, once resolved. |
| blockTimestamp | Block time (ISO 8601), once resolved. |

## Implementation

```javascript
async function getTransaction(token, txId) {
  const res = await fetch('https://api.aureahub.com/v1/transactions/' + txId, {
    headers: { Authorization: 'Bearer ' + token },
  });
  if (res.status === 404) return null;
  if (!res.ok) throw new Error('Failed to fetch transaction: ' + res.status);
  return res.json();
}

// Human-readable amount from the smallest-unit string
function formatAmount(tx) {
  const { decimals, symbol } = tx.token;
  if (decimals == null) return tx.amount + ' (smallest unit)';
  const n = BigInt(tx.amount);
  const base = 10n ** BigInt(decimals);
  const frac = (n % base).toString().padStart(decimals, '0').replace(/0+$/, '');
  return (n / base).toString() + (frac ? '.' + frac : '') + (symbol ? ' ' + symbol : '');
}
```

---

Web version: https://docs.aureahub.com/#tx-get
