CHANGELOG.md

# Changelog

## [1.0.0] — 2026-04-06

### Added

**Core infrastructure**
- `SetuClient.Config` — typed struct, environment-aware URL resolution, KYC headers, `validate!/1`
- `SetuClient.Error` — 6 typed errors (`:api`, `:auth`, `:rate_limit`, `:network`, `:validation`, `:decode`)
- `SetuClient.Validation` — shared client-side validators (`require_param/2`, `require_positive/2`, `require_id/2`, `require_merchant/1`)
- `SetuClient.HTTP` — Finch client with full-jitter backoff retry, rate limiting, telemetry spans
- `SetuClient.TokenManager` — GenServer with ETS caching, singleflight deduplication, proactive refresh
- `SetuClient.RateLimiter` — token-bucket GenServer per `{client_id, environment}`
- `SetuClient.Telemetry` — `:telemetry` events for all requests, token refreshes, rate-limit waits

**Payments — UPI Setu**
- Flash: `create_dqr/3`, `get_dqr/3`, `create_sqr/3`, `get_sqr/3`
- Payment status: `get_last_payment/3`, `get_payment_history/3`
- TPV: `create_tpv/3`, `get_tpv/3`
- Collect: `verify_vpa/3`, `create_collect/3`, `get_collect/3`
- Mandates: `create_mandate/3`, `get_mandate/3`, `update_mandate/4`, `revoke_mandate/4`, `get_mandate_operation/3`
- Pre-debit: `pre_debit_notify/4`, `get_pre_debit_notification/3`
- Execution: `execute_mandate/4`, `get_mandate_execution/3`
- Refunds: `create_refund/3`, `get_refund/3`
- Disputes: `get_dispute/3`, `accept_dispute/3`, `reject_dispute/4`
- Merchant onboarding: `create_merchant/2`, `get_merchant/2`, `check_vpa_availability/2`, `create_vpa/3`

**Payments — BBPS / BillPay / WhatsApp**
- `SetuClient.Payments.BBPS`: `get_transaction/2`, `build_bill_fetch_response/2`, `build_bill/1`, `build_settlement/2`
- `SetuClient.Payments.BillPay`: `fetch_bill/2`, `pay_bill/2`
- `SetuClient.Payments.WhatsApp`: `send_reminder/2`, `get_reminder_status/2`

**Data — Account Aggregator**
- `create_consent/2`, `get_consent/3`, `revoke_consent/2`, `create_multi_consent/2`
- `get_last_fetch_status/2`, `list_data_sessions/2`
- `create_data_session/2`, `get_data_session/2`, `fetch_fi_data/2`
- Context helpers: `with_account_type/1`, `with_fip_filter/1`, `with_exclude_fips/1`,
  `with_account_selection_mode/1`, `with_transaction_type/1`, `with_purpose_description/1`

**Data — KYC**
- `SetuClient.Data.KYC.PAN`: `verify/2`, `valid?/1`
- `SetuClient.Data.KYC.BAV`: `verify_sync/2`, `verify_async/2`, `get_async_status/2`
- `SetuClient.Data.KYC.GST`: `verify/2`, `active?/1`
- `SetuClient.Data.KYC.NameMatch`: `match/2`, `match?/2`, `strict_match?/2`
- `SetuClient.Data.KYC.EKYC`: `create/2`, `get/2`, `complete?/1`
- `SetuClient.Data.KYC.DigiLocker`: `create_session/2`, `get_session/2`, `get_document/3`

**Data — eSign**
- `SetuClient.Data.ESign`: `create/2`, `get/2`, `download/2`, `complete?/1`

**Webhooks**
- `SetuClient.Webhook.Handler`: `dispatch/2`, `dispatch_raw/2`, optional Plug integration
- `SetuClient.Webhook.Callbacks`: behaviour + `use` macro with default no-op implementations
- Event helpers: `event_type/1`, `payment_successful?/1`, `consent_active?/1`, `session_completed?/1`,
  `consent_id/1`, `session_id/1`, `consent_status/1`, `session_status/1`