/jarling

A Java Library for the Starling Bank API

Primary LanguageJavaMIT LicenseMIT

Jarling

Jarling is a Java library that provides simple access to the Starling Bank API. It aims to have minimal dependencies, currently only gson for json processing and is compatible with Java 1.8+.

Getting Started

Prerequisites

  • Java 1.8 or greater
  • Gson

Download

Jarling 0.2.0 can be downloaded here or added as a dependency to Maven using the following:

<dependency>
  <groupId>org.jarling</groupId>
  <artifactId>jarling</artifactId>
  <version>0.2.0</version>
</dependency>

Sample Usage

You'll first need to obtain an access token. You can either use your own account or Starling's sandbox account. Details of how to obtain a token can be found here.

Initialise Client

StarlingBank starling = new Starling(StarlingBankEnvironment.PRODUCTION, "<my_personal_access_token>");

Fetch your account details

Account account = starling.getAccount();
System.out.println(account.getName() + "'s sort code is " + account.getSortCode() + " and your account number is " + account.getNumber());

Check your account balance

AccountBalance accountBalance = starling.getAccountBalance();
System.out.println("Your balance is " + accountBalance.getAmount() + " " + accountBalance.getCurrency());

Return Last 100 Transactions

Transaction aTransaction = starling.listTransactions.get(0);
System.out.println("You spent " + aTransaction.getAmount() + " at " + aTransaction.getNarrative()); 

Built With

License

This project is licensed under the MIT License - see the LICENSE file for details