# routex-client

A client for [YAXI](https://yaxi.tech/)'s Open Banking services.

## Changelog

### [0.7.0] - 2026-09-03

#### Added

- `ConnectionInfo.bankCodes`
- `ConnectionDetails.BankCodes`
- `ConnectionInfo.labels`
- Reference non-IBAN accounts in the balances and transactions services with `{ number }` (e.g. an ISO 20022 BBAN); `AccountReference` is now `{ iban } | { number }`.
- `connectionData` option for `accounts`, `balances` and `transactions`, so a service can be run with the `connectionData` of an earlier `Result` instead of `credentials`.
- `InterruptErrorException`, indicating that a request without credentials cannot complete without user interaction.

#### Changed

- Enforce X.509 validity, Basic Constraints, Key Usage, and subject CN constraints on the VCEK chain.
- **Breaking:** `search` now requires `filters`; a search without any filter matches nothing.
- **Breaking:** `AccountsOptions`, `BalancesOptions` and `TransactionsOptions` can no longer be extended or implemented.

#### Removed

- `ConsentExpiredException`

#### Security

- Reject attestation reports whose guest policy allows migration to another host.

### [0.6.0] - 2026-04-30

#### Added

- `ConnectionInfo.bics`
- `details` option in `search`

#### Fixed

- `AccountFilter.all/any` now supports single-element and empty lists

#### Changed

- `RoutexClient.systemVersion` now requires a ticket identifier

### [0.5.0] - 2026-02-20

#### Added

- `RoutexClient.systemVersion`
- `RoutexClient.transfer`, `RoutexClient.respondTransfer`, `RoutexClient.confirmTransfer`

#### Removed

- `RoutexClient.measurement`

#### Fixed

- `AccountFilter.any` with more than two elements
- `PaymentFailedException.userMessage` was always `undefined`

### [0.4.8] - 2026-02-04

#### Added

- `ConnectionInfo.password`

### [0.4.7] - 2026-01-12

#### Added

- `encryptedIban` `SearchFilter`
- `encryptedIban` in `collectPayment`'s `account` accepts a Base64-encoded string as alternative to the `Uint8Array`

### [0.4.6] - 2025-12-08

#### Fixed

- `collectPayment` without given `account` argument

### [0.4.5] - 2025-11-25

#### Added

- `encryptedIban` as alternative to `iban` in `collectPayment`'s `account` option

### [0.4.4] - 2025-11-09

#### Fixed

- Use production environment if no explicit URL is passed to `RoutexClient`

### [0.4.3] - 2025-11-06

#### Fixed

- `yaxi-ticket-id` header value in requests

### [0.4.2] - 2025-09-23

#### Fixed

- Build failures with recent @noble packages

### [0.4.1] - 2025-09-11

#### Fixed

- `recurringConsents` is now optional

### [0.4.0] - 2025-09-11

#### Added

- `recurringConsents` option for `RoutexClient.accounts`, `RoutexClient.collectPayment`, and `RoutexClient.transactions`
- `RoutexClient.balances`, `RoutexClient.respondBalances`, `RoutexClient.confirmBalances`
- `DialogContext.VopConfirmation`, `DialogContext.VopCheck`
- `Confirmation.pollingDelaySecs`
- `TicketExceptionCode` has two new variants:
  - `ExpiredKey`: The API key is expired.
  - `KeyEnvironmentMismatch`: The API key cannot be used for this environment.
- The `RoutexClient` constructor now takes an optional `requestRetryFactory` option to retry failed requests. You can pass a factory for custom policies or use `retryRequestExceptionNTimesPolicy` to retry operations that failed due to a `RequestException`. For example, `{ requestRetryFactory: () => retryRequestExceptionNTimesPolicy(1) }` would retry one time.

#### Removed

- `InvalidRedirectUriException`

#### Fixed

- The required version for `routex-settlement` is now `0.1.3`. This fixes a bug that if the first requests happened concurrently, some of them could result in a `TicketException: Invalid "yaxi-ticket" header`.
- Initialization of `UnsupportedProductException`

#### Changed

- `RoutexClient` now takes an object of options instead of a single URL as argument. For backwards compatibility, it's still possible to pass a URL as a single argument.

### [0.3.4] - 2025-06-25

#### Changed

- `TypeError`s from the `fetch` method get translated to `RequestException`s

#### Fixed

- Parsing of service errors

### [0.3.3] - 2025-06-11

#### Added

- `ServiceBlockedException.code`, `ServiceBlockedCode`
- `UnsupportedProductException.reason`, `UnsupportedProductException.userMessage`, `UnsupportedProductReason`

### [0.3.2] - 2025-05-28

#### Added

- `DialogContext.PaymentStatus`

### [0.3.1] - 2025-05-27

#### Added

- `ProviderErrorException`, `ProviderErrorCode`

### [0.3.0] - 2025-05-23

#### Added

- `RoutexClient.setRedirectUri`
- `RoutexClient.transactions`, `RoutexClient.respondTransactions`, `RoutexClient.confirmTransactions`
- `removeCredentials`
- `OBResponse`
- `AccountStatus`

#### Changed

- This is a pure JS library now, i.e., does not include WebAssembly anymore
- `ResponseException.response` is now of type `Response`
- `storeCredentials` and `loadCredentials` take an identifier argument now
- `Result`, `Dialog`, `Redirect`, and `RedirectHandle` now extend `OBResponse`, providing `fromJSON` and `toJSON` methods

#### Removed

- `RoutexClientInterface`
- `Response` type (see `OBResponse` class)
- `ConnectionType`

#### Fixed

- `PaymentFailedException.name`

### [0.2.0] - 2025-01-29

#### Added

- `RoutexClient.collectPayment` takes an optional `currency` attribute
- `DialogContext.Redirect` for redirect polling
- `TicketException` for any error related to the provided ticket
- `code` and `userMessage` on `PaymentFailedException`
- Inherit docs for `RoutexClient`
- `storeCredentials` and `loadCredentials` to store encrypted credentials in the user's browser

#### Changed

- The `traceId` method does not return a `Promise` anymore, but an immediate result
- Renamed `errorMessage` on exception classes to `userMessage`
- Removed support for Node.js 18

#### Removed

- `Confirmation.primaryLabel`
- `Selection.primaryLabel`
- `Field.primaryLabel`
- `Actions`
- `source` on exception classes
- `UnexpectedValueException.errorMessage`
