Accounts

Given a user’s online banking credentials, the Accounts Service retrieves information about the associated accounts.

sequenceDiagram actor User participant YAXI participant Your Backend participant Bank User->>+Your Backend: Ticket request Your Backend-->>User: Ticket with ID rect rgb(243, 243, 243) note right of User: Encrypted and verified channel User->>+YAXI: Ticket YAXI->>+YAXI: Verify authenticity YAXI-->>-User: Bank login form User->>+YAXI: Send login credentials end YAXI->>+Bank: Get accounts opt Strong Customer Authentication Bank-->>-User: Request authorization User->>+Bank: Authorize end Bank-->>-YAXI: Accounts YAXI-->>-User: Accounts opt Transfer authenticated accounts to backend User->>+Your Backend: Accounts Your Backend->>+Your Backend: Verify authenticity Your Backend-->>-User: OK end

Issue a service ticket backend

Use Accounts as a service identifier when issuing tickets. The service does not accept any ticket data.

Issue a service ticket:

  • Python

  • Java

  • Rust

  • PHP

ticket_id = str(uuid.uuid4())
ticket = issue_ticket(ticket_id, "Accounts", None)
String ticketId = UUID.randomUUID().toString();
String ticket = issueTicket(ticketId, "Accounts", null);
let ticket_id = Uuid::new_v4().to_string();
let ticket = issue_ticket(&ticket_id, "Accounts", ())?;
$ticketId = uniqid();
$ticket = issueTicket($ticketId, 'Accounts', null);

Call the service frontend

The client accepts the following arguments:

  • The fields to return for each account. In strongly typed clients, all other fields will be empty.

  • An optional filter to receive only selected account.

Refer to your client library for details and documentation.

Call the service:

  • JavaScript

  • Kotlin

  • Rust

await client.accounts({
  credentials,
  ticket: accountsTicket,
  fields: [
    AccountField.Iban,
    AccountField.Bic,
    AccountField.Name,
    AccountField.DisplayName,
    AccountField.OwnerName,
    AccountField.Currency
  ], (1)
  filter: {
    all: [
      { notEq: [AccountField.Iban, null] },
      {
        any: [
          { eq: [AccountField.Type, AccountType.Current] },
          { eq: [AccountField.Type, null] }
        ]
      }, (2)
      { supports: SupportedService.CollectPayment } (3)
    ]
  }
})
1 Request some account properties, e.g. to present them for account selection.
2 Consider accounts associated with an IBAN if they are current accounts or accounts of unknown type.
3 The Collect Payment Service needs to support the accounts.
client.accounts(
    credentials,
    ticket = accountsTicket,
    fields = listOf(
        AccountField.IBAN,
        AccountField.BIC,
        AccountField.NAME,
        AccountField.DISPLAY_NAME,
        AccountField.OWNER_NAME,
        AccountField.CURRENCY,
    ), (1)
    filter = AccountField.Iban.notEq(null)
        .and(AccountField.Type.eq(AccountType.CURRENT)
            .or(AccountField.Type.eq(null))) (2)
        .and(Account.supports(SupportedService.COLLECT_PAYMENT)), (3)
)
1 Request some account properties, e.g. to present them for account selection.
2 Consider accounts associated with an IBAN if they are current accounts or accounts of unknown type.
3 The Collect Payment Service needs to support the accounts.
client.accounts(
    credentials,
    None,
    accounts_ticket,
    [
        AccountField::Iban,
        AccountField::Bic,
        AccountField::Name,
        AccountField::DisplayName,
        AccountField::OwnerName,
        AccountField::Currency,
    ], (1)
    Some(
        AccountField::IBAN.not_eq(None)
            .and(
                AccountField::TYPE.eq(Some(AccountType::Current))
                    .or(AccountField::TYPE.eq(None))
            ) (2)
            .and(
                Account::supports(SupportedService::CollectPayment)
            ), (3)
    ),
).await?;
1 Request some account properties, e.g. to present them for account selection.
2 Consider accounts associated with an IBAN if they are current accounts or accounts of unknown type.
3 The Collect Payment Service needs to support the accounts.

Result frontend backend

Process the resulting account properties in the frontend or forward them to your backend system that can verify their authenticity.

Designing account selection dialogs
  • If the result contains multiple account owners, group accounts by legal entity (e.g., personal or company accounts).

  • Allow users to choose an entity before displaying the accounts.

The resulting JWT contains the following data: