/openbankdata-jvm

A common interface for personal financial data

Primary LanguageHTML

#OpenBankData Java API This project aims to provide a common interface for personal financial data. The library is ideal for services that want to make use of the financial data available at multiple banks without the need to handle the actual data scraping by themselves. The library will strictly provide read-only data such as account information and transactional data and will not by any means implement functinality for transferring money between accounts.

##Contact Gitter chat

###Status Build Status

Packages

Core (org.openbankdata.core)

This package contains all model classes representing the bank resources available, such as accounts and transactions. Each domain model contains getters and setters for each property available.

BankClient (org.openbankdata.client)

This package contains classes for communication with a bank´s API or website. The client package is also responsible for handling the authentication to the specific provider.

Service (org.openbankdata.service)

This package contains the classes that invoke the API or website and map the response into domain object. Service classes are defined for the resources they interact with such as AccountService and TransactionService.

Banking (org.openbankdata.banking)

This package contains a facade for all available services. Each bank has its own facade class and it is these classes that should be used by other applications when integrating with the api. This package is also responsible for caching responses that need to be shared among the services.

##Examples

###Authenticating

//Basic authentication
BankClient client = new HandelsbankenBankClient();
client.setCredentials("user", "password");

###Get a user's bank accounts

The following example prints the account name for each account associated the given user.

AccountService service = new HandelsbankenAccountService();
service.getClient().setCredentials("user", "password");
for(Account account : service.getAccounts()) {
    System.out.println(account.getName());
}

###Get an account's transactions The following example prints all transactions associated with the given account.

HandelsbankenBankClient client = new HandelsbankenBankClient("username","password");
AccountService accountService = new HandelsBankenAccountService(client);
TransactionService transactionService = new HandelsbankenTransactionService(client);

List<Account> accounts = accountService.getAccounts();
if(!accounts.isEmpty()) {
    Account account = accounts.get(0);
    for(Transaction transaction : transactionService.getTransactions(account)) {
      System.out.println(transaction.getDescription() +" : "+ transaction.getAmount());
    }
}