# Introduction

BankProxy is a service, which helps with the interaction with the interfaces of banks. It supports the retrieval of transactions and initiation of payments. The interface is based on the NextGenPSD2 (opens new window) standard of the Berlin Group (opens new window) for maximum interoperability.

The service is meant to be deployed beside other services which need access to bank accounts. It provides a unified interface and provides an additional layer of security for handling sensitive login credentials.

BankProxy can call standardized REST API endpoints, parse the HTTP responses of the online banking interface or control a whole browser instance, to interact with the bank. Which behavior will be used, depends on the selected connector, which must be configured for every account upfront.

# Control flow

The following diagram shows how the different actors interact. User is usually an end-user with a browser, who wants to trigger an interaction with a bank. This could be the retrieval of the latest transaction from a bank account or the initiation of a payment to e.g. pay an invoice. Server is a server component or application implementing the business logic, which benefits from access to a bank account. A server, which keeps track of invoices, could use the transaction history of a bank account to e.g. mark invoices as paid.

(1): User commands Server to start a new interaction with the bank.

(2): Server creates a new interaction with a callback URI at BankProxy.

(3): BankProxy returns a URI, to redirect the User to.

(4): Server redirects the User to the URI return from BankProxy.

(5): User opens the URI on BankProxy.

(6-9): These steps depend on the used bank. In a typical flow the User will be asked for a login name and to confirm a one-time token, while the BankProxy interacts with the Bank.

(10): If all previous steps were successful BankProxy redirects the User back to the callbak URI of the Server.

(11): User opens the callback URI on the Server.

(12): Server loads the result from BankProxy via an identifier passed in the URI.

(13): BankProxy sends the result to Server and deletes it.

(14): Server handles the received result by e.g. importing it into a database.

(15): Server informs User about the successful interaction.

# Headless Control Flow

BankProxy supports an additional way to interact with the bank, to allow automatic retrieval of transactions without user interaction. This mode is not supported for all banks, since users can not e.g. confirm a two-factor login this way.

(1): User commands Server to start a new interaction with the bank. This could happen via a scheduled task or cron job for automatic processing.

(2): Server commands BankProxy to interact with the bank.

(3-4): BankProxy interacts with the bank.

(5): BankProxy sends the result to Server.

(6): Server handles the received result by e.g. importing it into a database.

(7): Server informs User about the successful interaction.