export declare enum AccountField { Iban = "IBAN", Number = "NUMBER", MaskedPan = "MASKEDPAN", Bic = "BIC", BankCode = "BANKCODE", Currency = "CURRENCY", Name = "NAME", DisplayName = "DISPLAYNAME", OwnerName = "OWNERNAME", ProductName = "PRODUCTNAME", Status = "STATUS", Type = "TYPE" } export declare enum AccountStatus { Available = "AVAILABLE", Terminated = "TERMINATED", Blocked = "BLOCKED" } export declare enum AccountType { /** * Account used to post debits and credits. * ISO 20022 ExternalCashAccountType1Code CACC. */ Current = "CURRENT", /** * Account used for credit card payments. * ISO 20022 ExternalCashAccountType1Code CARD. */ Card = "CARD", /** * Account used for savings. * ISO 20022 ExternalCashAccountType1Code SVGS. */ Savings = "SAVINGS", /** * Account used for call money. * No dedicated ISO 20022 code (falls into SVGS). */ CallMoney = "CALL_MONEY", /** * Account used for time deposits. * No dedicated ISO 20022 code (falls into SVGS). */ TimeDeposit = "TIME_DEPOSIT", /** * Account used for loans. * ISO 20022 ExternalCashAccountType1Code LOAN. */ Loan = "LOAN", Securities = "SECURITIES", Insurance = "INSURANCE", Commerce = "COMMERCE", Rewards = "REWARDS" } /** * Monetary amount paired with an ISO 4217 currency code. */ export interface Amount { /** * Exact decimal amount; serialized as a JSON string to preserve scale. */ amount: string; /** * ISO 4217 Alpha 3 currency code. */ currency: string; } /** * Reference to an account by IBAN, account number or masked payment card * number, with an optional ISO 4217 currency code for multi-currency accounts. */ export type AccountReference = { iban: string; currency?: string; } | { number: string; currency?: string; } | { maskedPan: string; currency?: string; }; /** * Payment account exposed by a service connection. * * All fields are optional; which ones are populated depends on the ASPSP and on * the {@link AccountField}s requested when invoking the accounts service. */ export interface Account { /** * ISO 20022 IBAN2007Identifier. */ iban?: string; /** * Account number that is not an IBAN, for example an ISO 20022 * BBANIdentifier. */ number?: string; /** * Masked payment card number. */ maskedPan?: string; /** * ISO 20022 BICFIIdentifier. */ bic?: string; /** * National bank code. */ bankCode?: string; /** * ISO 4217 Alpha 3 currency code. */ currency?: string; /** * Name of the account, assigned by the ASPSP. */ name?: string; /** * Display name of the account, assigned by the PSU. */ displayName?: string; /** * Legal account owner. */ ownerName?: string; /** * Product name. */ productName?: string; /** * Account status. */ status?: AccountStatus; /** * Account type. */ type?: AccountType; } /** * Kind of balance reported for an account. */ export declare enum BalanceType { /** * Balance from booked transactions. */ Booked = "BOOKED", /** * Available balance from booked transactions. * * Depending on the bank, a credit line may or may not be included (see * {@link Balance.creditLimitIncluded}). For the most current balance without * credit, prefer {@link BalanceType.Booked} and judge recency by * {@link Balance.dateTime}. */ Available = "AVAILABLE", /** * Expected balance from booked and pending transactions. */ Expected = "EXPECTED" } /** * Single account balance reported by the balances service. */ export interface Balance { /** * Exact decimal balance amount; serialized as a JSON string (matches * {@link Amount.amount}). */ amount: string; /** * ISO 4217 Alpha 3 currency code. */ currency: string; /** * Kind of balance (booked / available / expected). */ balanceType: BalanceType; /** * Whether {@link Balance.amount} includes any associated credit line, when * known. */ creditLimitIncluded?: boolean; /** * The moment the balance is valid, as an ISO 8601 date-time. */ dateTime?: string; } /** * Per-account container holding zero or more typed balances. */ export interface AccountBalances { account: AccountReference; /** * List of balances (of different types) for the account. */ balances: Balance[]; } /** * Top-level payload returned by the balances service. */ export interface Balances { /** * Per-account balances for accounts that the provider returned data for. */ balances: AccountBalances[]; /** * Accounts that the request asked about but the provider did not surface. */ missingAccounts?: AccountReference[]; } /** * Fee attached to a transaction, transfer detail, or batch entry. */ export interface Fee { /** * Decimal fee amount. */ amount: Amount; /** * ISO 20022 `ExternalChargeType1Code`, when known. */ kind?: string; /** * ISO 20022 `BICFIIdentifier` of the agent the charges are due to. */ bic?: string; } /** * Status of a single {@link Transaction}. */ export declare enum TransactionStatus { /** * Expected / planned but not yet booked. */ Pending = "PENDING", /** * Booked to the account; typically the final state for most accounts. */ Booked = "BOOKED", /** * Card transaction booked and invoiced but not yet paid. */ Invoiced = "INVOICED", /** * Card transaction paid; typically the final state for card accounts. */ Paid = "PAID", /** * Transaction has been canceled. */ Canceled = "CANCELED" } /** * Counterparty (creditor or debtor) referenced by a {@link Transaction}. */ export interface Party { /** * Creditor / debtor name. */ name?: string; /** * ISO 20022 IBAN2007Identifier for the creditor / debtor account. */ iban?: string; /** * ISO 20022 BICFIIdentifier for the creditor / debtor agent. */ bic?: string; /** * Ultimate creditor / debtor (name). */ ultimate?: string; } /** * Currency conversion attached to a {@link Transaction}. */ export interface ExchangeRate { /** * ISO 4217 Alpha 3 currency code of the source currency that gets converted. */ sourceCurrency: string; /** * ISO 4217 Alpha 3 currency code of the target currency that the source * currency gets converted into. */ targetCurrency?: string; /** * ISO 4217 Alpha 3 currency code of the unit currency for the exchange rate. */ unitCurrency?: string; /** * Exchange rate; serialized as a JSON string. */ exchangeRate: string; } /** * Bank transaction code attached to a {@link Transaction}. */ export type BankTransactionCode = /** * ISO 20022 Bank Transaction Code. */ { iso: { /** * ISO 20022 ExternalBankTransactionDomain1Code. */ domain: string; /** * ISO 20022 ExternalBankTransactionFamily1Code. */ family: string; /** * ISO 20022 ExternalBankTransactionSubFamily1Code. */ subFamily: string; }; } /** * SWIFT transaction code. */ | { swift: string; } /** * BAI2 transaction code. */ | { bai: string; } /** * National transaction code, e.g. German GVC. */ | { national: { code: string; country: string; }; } /** * Unspecified transaction code, possibly with an issuer. */ | { other: { code: string; issuer?: string; }; }; /** * Per-transaction batch metadata: count of grouped transactions plus their * individual details where the provider supplied them. */ export interface BatchData { /** * Number of transactions in the batch, if known. */ numberOfTransactions?: number; /** * Details of transactions in the batch. * * Note that this does not necessarily match a given number of transactions. * It could be e.g. empty as no details are given or a single entry with * common details on all transactions in the batch. */ transactions: BatchTransactionDetails[]; } /** * Per-entry details for a transaction inside a batch. Same fields as * {@link Transaction} minus the booking dates and status (those are carried by * the parent transaction). */ export interface BatchTransactionDetails { /** * Unique reference assigned by the account servicer. */ accountServicerReference?: string; /** * Unique identifier assigned by the sending party. */ paymentId?: string; /** * Unique identifier assigned by the first instructing agent. */ transactionId?: string; /** * Unique end-to-end identifier assigned by the initiating party. */ endToEndId?: string; /** * Mandate identifier. */ mandateId?: string; /** * SEPA creditor identifier. */ creditorId?: string; /** * Transaction amount as billed to the account. */ amount?: Amount; /** * Indicator for reversals. */ reversal?: boolean; /** * Original amount of the transaction. */ originalAmount?: Amount; /** * Exchange rates. */ exchanges?: ExchangeRate[]; /** * Any fees related to the transaction. */ fees?: Fee[]; /** * Creditor data. In case of reversals this refers to the initial transaction. */ creditor?: Party; /** * Debtor data. In case of reversals this refers to the initial transaction. */ debtor?: Party; /** * Remittance (purpose). */ remittanceInformation?: string[]; /** * ISO 20022 ExternalPurpose1Code. */ purposeCode?: string; /** * Bank Transaction Codes. */ bankTransactionCodes?: BankTransactionCode[]; /** * Additional information attached to the transaction. */ additionalInformation?: string; } /** * Single transaction returned by the transactions service. Most fields are * optional; provider coverage varies and a typical transaction populates a * small subset. The required fields are {@link Transaction.status} and * {@link Transaction.amount}. */ export interface Transaction { /** * Identifier used for delta requests. */ entryReference?: string; /** * Sub-transaction details when the entry is a batch. */ batch?: BatchData; /** * Booking date in the ASPSP's books. */ bookingDate?: string; /** * Value date (expected / requested for pending entries). */ valueDate?: string; /** * Date of the actual transaction (e.g. card payment). */ transactionDate?: string; /** * Transaction status. */ status: TransactionStatus; /** * Unique reference assigned by the account servicer. */ accountServicerReference?: string; /** * Unique identifier assigned by the sending party. */ paymentId?: string; /** * Unique identifier assigned by the first instructing agent. */ transactionId?: string; /** * Unique end-to-end identifier assigned by the initiating party. */ endToEndId?: string; /** * Mandate identifier. */ mandateId?: string; /** * SEPA creditor identifier. */ creditorId?: string; /** * Transaction amount as billed to the account. */ amount: Amount; /** * Indicator for reversals. */ reversal?: boolean; /** * Original amount of the transaction. */ originalAmount?: Amount; /** * Exchange rates. */ exchanges?: ExchangeRate[]; /** * Any fees related to the transaction. */ fees?: Fee[]; /** * Creditor data. In case of reversals this refers to the initial transaction. */ creditor?: Party; /** * Debtor data. In case of reversals this refers to the initial transaction. */ debtor?: Party; /** * Remittance (purpose). */ remittanceInformation?: string[]; /** * ISO 20022 ExternalPurpose1Code. */ purposeCode?: string; /** * Bank Transaction Codes. */ bankTransactionCodes?: BankTransactionCode[]; /** * Additional information attached to the transaction. */ additionalInformation?: string; } /** * Requirements for user identifier and password. */ export interface CredentialsModel { /** * A full set of credentials may be provided to support fully embedded authentication (including scraped redirects). */ full: boolean; /** * Only a user identifier without a password may be provided. * This is typically the case for decoupled authentication where the user e.g. authorizes access in a mobile application. * Note that if password-less authentication fails (e.g. as no device for decoupled authentication is set up for the user and * a redirect is not supported), an error is returned and the transaction has to get restarted with a full set of credentials. */ userId: boolean; /** * Credentials are not required. The user will provide them to the service provider during a redirect. */ none: boolean; } /** * Connection meta data */ export interface ConnectionInfo { /** * Unique identifier. */ id: string; /** * ISO 3166-1 ALPHA-2 country codes. */ countries: string[]; /** * Display name. */ displayName: string; /** * Credentials model. */ credentials: CredentialsModel; /** * Human-friendly label for the user identifier if relevant. */ userId?: string; /** * Human-friendly label for the PIN / password if relevant. */ password?: string; /** * Advice for the credentials to be displayed. */ advice?: string; /** * Logo identifier. */ logoId?: string; /** * ISO 20022 BICFIIdentifiers. * * Note that this is only included in search results if requested. */ bics?: string[]; /** * National bank codes (as used in IBANs). * * Note that this is only included in search results if requested. */ bankCodes?: string[]; /** * Labels categorizing the connection (e.g. "beta", "fints"). */ labels?: string[]; } /** * Filters for the connection lookup * * String filters look for the given value anywhere in the related field, case-insensitive. */ export type SearchFilter = /** * List of ISO 3166-1 alpha-2 country codes to consider. */ { countries: string[]; } /** * String filter for the provider / product name or any alias. */ | { name: string; } /** * String filter for the BIC. */ | { bic: string; } /** * String filter for the (national) bank code. */ | { bankCode: string; } /** * String filter for any of those fields. */ | { term: string; } /** * Filter by encrypted IBAN (provided from a backend) in binary or Base64 string form. */ | { encryptedIban: Uint8Array | string; }; export declare enum ConnectionDetails { Bics = "BICS", BankCodes = "BANK_CODES" } export type AccountFilter = { eq: [AccountField, string | null]; } | { notEq: [AccountField, string | null]; } | { all: AccountFilter[]; } | { any: AccountFilter[]; } | { supports: SupportedService; }; export declare enum SupportedService { CollectPayment = "COLLECT_PAYMENT" } export declare class RequestException extends Error { constructor(error: string, options?: ErrorOptions); } export declare class UnexpectedErrorException extends Error { constructor(userMessage?: string, options?: ErrorOptions); userMessage?: string; } export declare class CanceledException extends Error { constructor(options?: ErrorOptions); } export declare class InvalidCredentialsException extends Error { constructor(userMessage?: string, options?: ErrorOptions); userMessage?: string; } export declare class ServiceBlockedException extends Error { constructor(code?: string, userMessage?: string, options?: ErrorOptions); code?: ServiceBlockedCode; userMessage?: string; } export declare enum ServiceBlockedCode { /** * Something is not set up for the user, e.g., there are no TAN methods. */ MissingSetup = "MISSING_SETUP", /** * User attention is required via another channel. Typically the user needs to log into the Online Banking. */ ActionRequired = "ACTION_REQUIRED" } export declare class UnauthorizedException extends Error { constructor(userMessage?: string, options?: ErrorOptions); userMessage?: string; } export declare class AccessExceededException extends Error { constructor(userMessage?: string, options?: ErrorOptions); userMessage?: string; } export declare class PeriodOutOfBoundsException extends Error { constructor(userMessage?: string, options?: ErrorOptions); userMessage?: string; } export declare class UnsupportedProductException extends Error { constructor(reason?: string, userMessage?: string, options?: ErrorOptions); reason?: UnsupportedProductReason; userMessage?: string; } export declare enum UnsupportedProductReason { /** * The amount is not allowed for the payment product. */ Limit = "LIMIT", /** * The recipient is not capable to receive the payment product. */ Recipient = "RECIPIENT", /** * Scheduled payments are not supported. */ Scheduled = "SCHEDULED" } export declare class PaymentFailedException extends Error { constructor(code?: string, userMessage?: string, options?: ErrorOptions); code?: PaymentFailedCode; userMessage?: string; } export declare enum PaymentFailedCode { LimitExceeded = "LIMIT_EXCEEDED", InsufficientFunds = "INSUFFICIENT_FUNDS" } export declare class UnexpectedValueException extends Error { constructor(error: string, options?: ErrorOptions); } export declare class TicketException extends Error { constructor(error: string, code: string, options?: ErrorOptions); code: TicketExceptionCode; } export declare enum TicketExceptionCode { Missing = "MISSING", Invalid = "INVALID", MissingKey = "MISSING_KEY", UnknownKey = "UNKNOWN_KEY", Mismatch = "MISMATCH", Expired = "EXPIRED", InvalidLifetime = "INVALID_LIFETIME", ExpiredKey = "EXPIRED_KEY", KeyEnvironmentMismatch = "KEY_ENVIRONMENT_MISMATCH" } export declare class ProviderErrorException extends Error { constructor(code?: string, userMessage?: string, options?: ErrorOptions); code?: ProviderErrorCode; userMessage?: string; } export declare enum ProviderErrorCode { Maintenance = "MAINTENANCE" } export declare class ResponseException extends Error { constructor(text: string, response: Response, options?: ErrorOptions); response: Response; } export declare class NotFoundException extends Error { constructor(options?: ErrorOptions); } /** * The service call requires user interaction to complete. * * Only requests passing a `connectionData` instead of `credentials` produce this * error, be it through the non-interactive services of `routex-refresh-client` * or through `RoutexClient`; with `credentials` a `Dialog`, `Redirect`, or * `RedirectHandle` gets returned instead. Recover by running the user through a * request with `credentials` and persisting the `connectionData` it returns. */ export declare class InterruptErrorException extends Error { constructor(options?: ErrorOptions); }