# Get Transaction Status

Check a transaction against the chain and get its current status and confirmation count.

## Overview

Unlike [Get Transaction](https://docs.aureahub.com/docs/tx-get.md), this endpoint looks up the transaction receipt on the network (EVM chains) and saves any status change to the record. Poll it after a send until `status` is `confirmed` or `failed`.

## Endpoint

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

Authentication: bearer token required.

Returns the transaction's status and confirmation count, refreshed from the chain where possible.

**Path parameters**

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

**Responses**

`200` OK

```json
{
  "id": "0b9d4c1e-3f6a-4b8e-9d2c-7a5e1f3b6c90",
  "txHash": "0x7f3a…",
  "status": "confirmed",
  "confirmations": 3,
  "blockNumber": "41234567",
  "blockTimestamp": "2026-09-11T10:00:15.000Z"
}
```

`404` Not Found

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

## How Status Is Resolved

| Situation | Response |
| --- | --- |
| No receipt on the network yet | `pending`, `confirmations: 0`. |
| Receipt with success status | `confirmed`; `confirmations` = latest block − transaction block + 1. |
| Receipt with failure status | `failed`. |
| Receipt lookup fails (RPC error, Solana, or no on-chain hash yet) | The stored status, with `confirmations: 0` and the stored block fields. |

- When the status changes, the new status, block number, block time, gas used and fee are saved to the record.
- `confirmed` means the receipt reports success; the API applies no confirmation threshold of its own.
- Before a non-custodial send is broadcast, the record has no on-chain hash: this endpoint returns the stored `pending` status and a `txHash` placeholder that starts with `pending-`. Get Transaction returns `null` in that case.
- Solana receipts are not looked up. Custodial Solana sends are already recorded as `confirmed` when the send call returns.
- The API also runs a background job every 60 seconds that checks up to 20 `pending` EVM transactions that have an on-chain hash and are more than a minute old, so records advance even if you don't poll.

## Implementation

The API does not prescribe a polling interval; pick one that suits your UI.

```javascript
async function waitForFinalStatus(token, txId, { intervalMs = 5000, maxAttempts = 60 } = {}) {
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
    const res = await fetch('https://api.aureahub.com/v1/transactions/' + txId + '/status', {
      headers: { Authorization: 'Bearer ' + token },
    });
    if (res.status === 404) throw new Error('Transaction not found');
    if (res.ok) {
      const s = await res.json();
      if (s.status === 'confirmed' || s.status === 'failed') return s;
    }
    await new Promise(resolve => setTimeout(resolve, intervalMs));
  }
  throw new Error('Still pending after ' + maxAttempts + ' checks');
}

const result = await waitForFinalStatus(token, txId);
console.log(result.status, result.blockNumber, result.confirmations);
```

---

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