<!-- source: https://secondlayer.tools/docs/api-reference#get-transaction -->

## Transaction by tx_id

`GET /v1/index/transactions/{tx_id}`

One transaction document, only if it sits in a canonical block. A transaction still pending is at `/v1/index/mempool/{tx_id}`. Not metered.

### Path parameters

| Name | Type | Description |
| --- | --- | --- |
| `tx_id` | string, required | Transaction id, `0x`-prefixed hex. |

### Responses

- `200` The transaction and the tip it was read against
- `401` This bind requires the instance token, and it was missing or wrong
- `404` No canonical transaction with that id (`Transaction not found`)
- `429` Rate limited; retry after `Retry-After` seconds

### Example

```bash
curl https://api.secondlayer.tools/v1/index/transactions/{tx_id} \
  -H "Authorization: Bearer $SECONDLAYER_API_KEY"
```

```json
{
  "transaction": {
    "cursor": "9048502:1",
    "tx_id": "0x198d642edb1104a1757a8c353ad61231d0422ecb6ba83aa1ce45d05df44157e0",
    "block_height": 9048502,
    "block_time": "2026-09-23T13:14:42.000Z",
    "burn_block_height": 968276,
    "tx_index": 1,
    "tx_type": "contract_call",
    "sender": "SP15T1W26JTNS26VG17HM468KW7TQD3124KTYA9EJ",
    "status": "success",
    "fee": "3000",
    "nonce": "265",
    "sponsored": false,
    "anchor_mode": "any",
    "post_condition_mode": "deny",
    "post_conditions": [
      {
        "type": "ft",
        "principal": "SP15T1W26JTNS26VG17HM468KW7TQD3124KTYA9EJ",
        "asset_identifier": "SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token::sbtc-token",
        "condition_code": 1,
        "condition_code_name": "sent_eq",
        "amount": "300"
      }
    ],
    "contract_call": {
      "contract_id": "SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token",
      "function_name": "transfer",
      "function_args": [
        "300",
        "SP15T1W26JTNS26VG17HM468KW7TQD3124KTYA9EJ",
        "SPD3SCZDZ52X4ZX1878XWBFBJ29YRX0MFW9Z9W4V",
        null
      ],
      "function_args_hex": [
        "010000000000000000000000000000012c",
        "05164ba0f04696ab911b7009e3421913e1f5768c2224",
        "05161a3cb3edf945d27fa141d1de2deb9093ec74147f",
        "09"
      ],
      "result": true,
      "result_hex": "0x0703"
    }
  },
  "tip": {
    "block_height": 9048938,
    "finalized_height": 9048671,
    "lag_seconds": 23,
    "source_block_height": 9048938
  }
}
```
