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

# Transaction utilities

> Estimate fees and export transaction history.

## Estimate fee

Returns gas-price and gas-limit estimates for a hypothetical transaction without submitting it. Useful for UI previews and pre-flight policy checks.

```http theme={null}
GET /v1/transactions/estimate-fee?wallet_id={id}&to={addr}&value={wei}&data={hex}
```

```bash theme={null}
curl "https://api.qustody.io/v1/transactions/estimate-fee?wallet_id=wal_01HXYZ&to=0xabc...&value=1000000000000000000" \
  -H "Authorization: Bearer $QUSTODY_API_KEY"
```

**Response 200**

```json theme={null}
{
  "gas_limit": "21000",
  "gas_price_wei": "1000000000",
  "max_fee_per_gas_wei": "2000000000",
  "max_priority_fee_per_gas_wei": "1500000000",
  "estimated_fee_wei": "31500000000000",
  "chain_id": 20803,
  "estimated_at": "2026-04-27T10:15:00Z"
}
```

This call talks to the configured `CUSTODY_NODE_RPC_URL`. If the node is unavailable, the response is `1500 NODE_UNAVAILABLE`.

The estimate does **not** reserve a nonce or commit to broadcast.

## Export transactions

Streams a CSV (or JSON) of transactions matching the filter, suitable for accounting reconciliation.

```http theme={null}
GET /v1/transactions/export?format=csv&from=2026-04-01T00:00:00Z&to=2026-04-30T23:59:59Z&status=CONFIRMED
```

**Filters**

| Param         | Description                      |
| ------------- | -------------------------------- |
| `format`      | `csv` (default) or `json`        |
| `from` / `to` | RFC 3339 time range              |
| `vault_id`    | Limit to a vault                 |
| `wallet_id`   | Limit to a wallet                |
| `status`      | One of the 14 transaction states |

**CSV columns**

```
id,external_id,vault_id,wallet_id,to_address,value_wei,fee_wei,status,broadcast_tx_hash,block_number,confirmed_at,created_at
```

**Response headers**

```
Content-Type: text/csv; charset=utf-8
Content-Disposition: attachment; filename="transactions-2026-04.csv"
X-Total-Count: 4823
```

For large exports the response is streamed; clients should not buffer the entire body in memory.

## Required permissions

| Endpoint                            | Permission            |
| ----------------------------------- | --------------------- |
| `GET /v1/transactions/estimate-fee` | `transactions:read`   |
| `GET /v1/transactions/export`       | `transactions:export` |

The `transactions:export` action is a separate permission to allow segregation: a `viewer` can read individual transactions but a `compliance_officer` is typically the principal that exports.
