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

# Transaction Detail

> Single-transaction lookup with native-scanner URL and related-tx context

## Endpoint

```
GET /leokit/explorer/tx/{id}
```

`{id}` is the swap row id or transaction hash. As a fallback, you can pass `?tx_hash=0x...` to look up by hash without using the path segment.

No authentication required.

## Response

### Success (200)

```json theme={null}
{
  "data": {
    "id": "01953c9a-...",
    "tx_hash": "0xabc...",
    "from_asset": "ETH.USDC-0xA0b...",
    "to_asset": "BTC.BTC",
    "from_address": "0x1234...",
    "to_address": "bc1q...",
    "volume_usd": 1234.56,
    "protocol": "thorchain",
    "swap_date": "2026-04-28T12:00:00.000Z",
    "from_symbol": "USDC",
    "to_symbol": "BTC",
    "from_chain": "ETH",
    "to_chain": "BTC",
    "scanner_url": "https://etherscan.io/tx/0xabc...",
    "related_txs": [
      /* up to 5 ExplorerTransaction objects from the same `from_address` */
    ]
  }
}
```

| Field         | Description                                                             |
| ------------- | ----------------------------------------------------------------------- |
| `scanner_url` | Native chain scanner URL for `tx_hash` (Etherscan, mempool.space, etc.) |
| `related_txs` | Up to 5 most recent other swaps from the same `from_address`            |

The base fields match `ExplorerTransaction` (see [overview](/api-reference/explorer/overview)).

## Errors

| Status | Description                                        |
| ------ | -------------------------------------------------- |
| `400`  | Missing `id` path parameter and no `tx_hash` query |
| `404`  | No row matched `id` or `tx_hash`                   |

## Examples

```bash theme={null}
# By tx hash (path)
curl "https://api.leokit.dev/leokit/explorer/tx/0xabc..."

# By tx hash (query)
curl "https://api.leokit.dev/leokit/explorer/tx/x?tx_hash=0xabc..."

# By internal swap id
curl "https://api.leokit.dev/leokit/explorer/tx/01953c9a-..."
```


## OpenAPI

````yaml /api-reference/openapi.json GET /explorer/tx/{id}
openapi: 3.0.3
info:
  title: Leokit API
  version: 1.0.0
  description: API reference for Leokit
servers:
  - url: https://api.leokit.dev
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /explorer/tx/{id}:
    get:
      summary: Transaction detail
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: tx_hash
          in: query
          required: false
          schema:
            type: string
          description: Alternative to {id} path segment.
      responses:
        '200':
          description: Single transaction with related-tx context.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExplorerTxDetailResponse'
      security:
        - {}
components:
  schemas:
    ExplorerTxDetailResponse:
      type: object
      required:
        - data
      properties:
        data:
          allOf:
            - $ref: '#/components/schemas/ExplorerTransaction'
            - type: object
              properties:
                scanner_url:
                  type: string
                  nullable: true
                related_txs:
                  type: array
                  items:
                    $ref: '#/components/schemas/ExplorerTransaction'
    ExplorerTransaction:
      type: object
      required:
        - id
        - tx_hash
        - from_asset
        - to_asset
        - from_address
        - to_address
        - volume_usd
        - protocol
        - swap_date
      properties:
        id:
          type: string
        tx_hash:
          type: string
        from_asset:
          type: string
        to_asset:
          type: string
        from_address:
          type: string
        to_address:
          type: string
        volume_usd:
          type: number
        protocol:
          type: string
        swap_date:
          type: string
          format: date-time
        from_symbol:
          type: string
        to_symbol:
          type: string
        from_chain:
          type: string
        to_chain:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Api-Key
      description: 'Demo API-Key (Sandbox): 7037d2b3-9c76-4f62-b730-c544f7570fa4'

````