# ClearBank v1.0.0 - Table of Contents

> A production-grade Elixir client for the ClearBank UK API. Supports GBP Accounts, GBP Payments (FPS, CHAPS, Bacs, Cheques, Cross-Border, CoP), Multi-currency & FX, and Embedded Banking.

## Pages

- [ClearBank.ex](readme.md)
- [Changelog](changelog.md)
- [Getting Started](getting_started.md)
- [Webhook Integration Guide](webhooks.md)
- [LICENSE](license.md)

## Modules

- [ClearBank.RateLimiter](ClearBank.RateLimiter.md): Minimal token-bucket rate limiter backed by a GenServer.
- [ClearBank.Telemetry](ClearBank.Telemetry.md): Telemetry integration for `clearbank`.
- [ClearBank.Webhook.Events.BacsMandateCancelled](ClearBank.Webhook.Events.BacsMandateCancelled.md): Fired when a DDI is cancelled.
- [ClearBank.Webhook.Events.BacsMandateCreated](ClearBank.Webhook.Events.BacsMandateCreated.md): Fired when a Direct Debit Instruction (DDI) is created.
- [ClearBank.Webhook.Events.BacsMandateMigrated](ClearBank.Webhook.Events.BacsMandateMigrated.md): Fired when a DDI is migrated from another SUN.
- [ClearBank.Webhook.Events.BacsPaymentCreated](ClearBank.Webhook.Events.BacsPaymentCreated.md): Fired when a Bacs payment (Direct Credit or Direct Debit) is created.
- [ClearBank.Webhook.Events.ChapsPaymentCreated](ClearBank.Webhook.Events.ChapsPaymentCreated.md): Fired when a CHAPS payment is created and accepted.
- [ClearBank.Webhook.Events.ChapsReturnCreated](ClearBank.Webhook.Events.ChapsReturnCreated.md): Fired when a CHAPS return payment is created.
- [ClearBank.Webhook.Events.CopOutboundResponse](ClearBank.Webhook.Events.CopOutboundResponse.md): Fired when a CoP outbound name verification response is received.
- [ClearBank.Webhook.Events.CustomerKycStatusChanged](ClearBank.Webhook.Events.CustomerKycStatusChanged.md): Fired when an embedded customer's KYC status transitions.
- [ClearBank.Webhook.Events.EmbeddedAccountCreated](ClearBank.Webhook.Events.EmbeddedAccountCreated.md): Fired when a new embedded account is provisioned for a customer.
- [ClearBank.Webhook.Events.EmbeddedTransactionSettled](ClearBank.Webhook.Events.EmbeddedTransactionSettled.md): Fired when a payment settles on an embedded customer's account.
- [ClearBank.Webhook.Events.FITestEvent](ClearBank.Webhook.Events.FITestEvent.md): Test event fired by `POST /v1/Test` if subscribed.
- [ClearBank.Webhook.Events.FpsPaymentReturnCreated](ClearBank.Webhook.Events.FpsPaymentReturnCreated.md): Fired when an FPS return payment is created.
- [ClearBank.Webhook.Events.FxTradeCreated](ClearBank.Webhook.Events.FxTradeCreated.md): Fired when an FX trade is executed.
- [ClearBank.Webhook.Events.FxTradeSettled](ClearBank.Webhook.Events.FxTradeSettled.md): Fired when an FX trade settles (funds move between accounts).
- [ClearBank.Webhook.Events.MccyTransactionCreated](ClearBank.Webhook.Events.MccyTransactionCreated.md): Fired when a multi-currency transaction is created.
- [ClearBank.Webhook.Events.PaymentMessageAssessmentFailed](ClearBank.Webhook.Events.PaymentMessageAssessmentFailed.md): Fired when a payment is rejected during pre-settlement assessment.
- [ClearBank.Webhook.Events.PaymentMessageValidationFailed](ClearBank.Webhook.Events.PaymentMessageValidationFailed.md): Fired when a payment fails validation before submission.
- [ClearBank.Webhook.Events.TransactionRejected](ClearBank.Webhook.Events.TransactionRejected.md): Fired when a submitted payment is rejected post-processing.
- [ClearBank.Webhook.Events.TransactionSettled](ClearBank.Webhook.Events.TransactionSettled.md): Fired when a payment settles on a GBP account (inbound or outbound).

- Core
  - [ClearBank](ClearBank.md): ClearBank UK API client for Elixir.
  - [ClearBank.Client](ClearBank.Client.md): Immutable client struct holding credentials and configuration.
  - [ClearBank.Config](ClearBank.Config.md): Configuration management for `clearbank`.

- Auth
  - [ClearBank.Auth.Signer](ClearBank.Auth.Signer.md): Computes the `DigitalSignature` header value required by ClearBank for
all POST / PATCH / PUT requests.

- HTTP
  - [ClearBank.HTTP](ClearBank.HTTP.md): Core HTTP request pipeline for the ClearBank API.
  - [ClearBank.HTTP.Retry](ClearBank.HTTP.Retry.md): Exponential backoff retry logic for ClearBank API calls.

- GBP Accounts
  - [ClearBank.Accounts](ClearBank.Accounts.md): GBP Account management — real and virtual accounts.
  - [ClearBank.Accounts.BacsPaymentData](ClearBank.Accounts.BacsPaymentData.md): Bacs-specific payment data retrieval.
  - [ClearBank.Accounts.Reporting](ClearBank.Accounts.Reporting.md): Account reporting via camt.053 bank statements.
  - [ClearBank.Accounts.Transactions](ClearBank.Accounts.Transactions.md): Transaction data retrieval for GBP real and virtual accounts.

- GBP Payments
  - [ClearBank.Payments.Bacs](ClearBank.Payments.Bacs.md): Bacs payment operations — primarily returning Bacs Direct Credits
and Direct Debit payments.
  - [ClearBank.Payments.BacsDirectDebit](ClearBank.Payments.BacsDirectDebit.md): Bacs Direct Debit Instructions (DDIs) — create, retrieve, and cancel
Direct Debit mandates on real and virtual accounts.
  - [ClearBank.Payments.Chaps](ClearBank.Payments.Chaps.md): CHAPS (Clearing House Automated Payment System) — high-value, same-day GBP payments
settling via the Bank of England's RTGS system.
  - [ClearBank.Payments.Cheques](ClearBank.Payments.Cheques.md): Cheque deposit via the Image Cheque Clearing System (ICS).
  - [ClearBank.Payments.ConfirmationOfPayee](ClearBank.Payments.ConfirmationOfPayee.md): Confirmation of Payee (CoP) — pre-payment name checking service.
  - [ClearBank.Payments.CrossBorder](ClearBank.Payments.CrossBorder.md): GBP Cross-Border Payments — sending GBP internationally via SWIFT/correspondent banking.
  - [ClearBank.Payments.FasterPayments](ClearBank.Payments.FasterPayments.md): Faster Payments Service (FPS) — the UK's 24/7/365 real-time payment rail.
  - [ClearBank.Payments.InternalTransfer](ClearBank.Payments.InternalTransfer.md): Internal Transfers — move funds between accounts held at ClearBank
without going through an external payment scheme.

- Multi-currency &amp; FX
  - [ClearBank.MultiCurrency.Accounts](ClearBank.MultiCurrency.Accounts.md): Multi-currency account management.
  - [ClearBank.MultiCurrency.FxTrade](ClearBank.MultiCurrency.FxTrade.md): FX Spot Trade — execute real-time foreign exchange conversions between two
ClearBank currency accounts at the live market rate.
  - [ClearBank.MultiCurrency.FxTradeRfq](ClearBank.MultiCurrency.FxTradeRfq.md): FX Request for Quote (RFQ) — lock in a firm exchange rate before executing.
  - [ClearBank.MultiCurrency.Payments](ClearBank.MultiCurrency.Payments.md): Multi-currency international payment sending.
  - [ClearBank.MultiCurrency.SepaCreditTransfer](ClearBank.MultiCurrency.SepaCreditTransfer.md): SEPA Credit Transfer UK (SCT UK) — send and return euro payments
via the SEPA Credit Transfer scheme from within the UK.

- Embedded Banking
  - [ClearBank.EmbeddedBanking.Accounts](ClearBank.EmbeddedBanking.Accounts.md): Embedded Banking account management — hub, payment, and savings accounts
for your embedded customers.
  - [ClearBank.EmbeddedBanking.Customers](ClearBank.EmbeddedBanking.Customers.md): Embedded Banking customer management — onboard retail, sole trader,
and legal entity customers onto your platform, backed by ClearBank.
  - [ClearBank.EmbeddedBanking.Interest](ClearBank.EmbeddedBanking.Interest.md): Interest product configuration for embedded banking savings accounts.
  - [ClearBank.EmbeddedBanking.Isa](ClearBank.EmbeddedBanking.Isa.md): Flexible Cash ISA management for embedded retail customers.
  - [ClearBank.EmbeddedBanking.Kyc](ClearBank.EmbeddedBanking.Kyc.md): KYC (Know Your Customer) status management for embedded banking customers.

- Types &amp; Schemas
  - [ClearBank.Error](ClearBank.Error.md): Represents a ClearBank API error.
  - [ClearBank.Schemas](ClearBank.Schemas.md): Typed response structs for ClearBank API responses.
  - [ClearBank.Schemas.Account](ClearBank.Schemas.Account.md): Typed struct for a GBP real account.
  - [ClearBank.Schemas.Customer](ClearBank.Schemas.Customer.md): Typed struct for an Embedded Banking customer.
  - [ClearBank.Schemas.DirectDebitInstruction](ClearBank.Schemas.DirectDebitInstruction.md): Typed struct for a Bacs Direct Debit Instruction (DDI/mandate).
  - [ClearBank.Schemas.EmbeddedAccount](ClearBank.Schemas.EmbeddedAccount.md): Typed struct for an Embedded Banking account.
  - [ClearBank.Schemas.FxQuote](ClearBank.Schemas.FxQuote.md): Typed struct for an FX RFQ quote.
  - [ClearBank.Schemas.MultiCurrencyAccount](ClearBank.Schemas.MultiCurrencyAccount.md): Typed struct for a multi-currency account.
  - [ClearBank.Schemas.PaginatedResponse](ClearBank.Schemas.PaginatedResponse.md): Generic typed wrapper for paginated API responses.
  - [ClearBank.Schemas.Transaction](ClearBank.Schemas.Transaction.md): Typed struct for a GBP account transaction.
  - [ClearBank.Schemas.VirtualAccount](ClearBank.Schemas.VirtualAccount.md): Typed struct for a GBP virtual account.
  - [ClearBank.Types](ClearBank.Types.md): Shared type definitions and helper guards used across `clearbank`.

- Webhooks
  - [ClearBank.Webhook](ClearBank.Webhook.md): Webhook envelope struct and parsing.
  - [ClearBank.Webhook.Events](ClearBank.Webhook.Events.md): Typed structs for all known ClearBank webhook event payloads.
  - [ClearBank.Webhook.Handler](ClearBank.Webhook.Handler.md): Behaviour for implementing typed ClearBank webhook handlers.
  - [ClearBank.Webhook.Verifier](ClearBank.Webhook.Verifier.md): Verifies the `DigitalSignature` on inbound ClearBank webhooks.

- Test Utilities
  - [ClearBank.TestEndpoints](ClearBank.TestEndpoints.md): ClearBank API test endpoints for validating authentication and digital signatures.

## Mix Tasks

- Mix Tasks
  - [mix clearbank.gen.keys](Mix.Tasks.Clearbank.Gen.Keys.md): Generates an RSA 2048-bit key pair suitable for ClearBank API authentication.

