accounts

suspend fun accounts(ticket: Ticket.Accounts, credentials: Credentials, fields: List<AccountField<*>>, filter: AccountFilter? = null, session: Session? = null, recurringConsents: Boolean = false): Response<AccountsResult>

Invoke the accounts service: list accounts (and selected fields) reachable through credentials.

Parameters

ticket

Ticket authorizing the call.

credentials

Bank-side identification.

fields

Fields to populate on each returned account.

filter

Optional account filter (e.g. by IBAN, currency, supported services). Server-side AND/OR/NOT predicates available via the AccountField helpers.

See also

Samples

client.accounts(
    accountsTicket,
    credentials,
    fields = listOf(
        AccountField.Iban,
        AccountField.Bic,
        AccountField.Name,
        AccountField.DisplayName,
        AccountField.OwnerName,
        AccountField.Currency,
    ),
    filter = AccountField.Iban.notEq(null)
        .and(AccountField.Type.eq(AccountType.CURRENT)
            .or(AccountField.Type.eq(null)))
        .and(Account.supports(SupportedService.COLLECT_PAYMENT)),
)

suspend fun accounts(ticket: Ticket.Accounts, connectionData: ConnectionData, fields: List<AccountField<*>>, filter: AccountFilter? = null, session: Session? = null): Response<AccountsResult>

Invoke the accounts service on the consent carried by connectionData, without credentials.

connectionData comes from a result of an earlier call. A user is assumed to be in session on the connection.

The response is the same as with credentials: usually a Response.Result, but an interrupt when the bank demands user interaction after all, which the caller may resolve or abandon. When the call cannot even be attempted without interaction, InterruptError is thrown; recover by running the user through a call with Credentials and persisting the connection data it returns.

See also