plaid-java

Java bindings for the Plaid API (https://www.plaid.com/docs)

3 years after

plaid-java

Java Bindings for the Plaid API (https://www.plaid.com/docs)

These bindings are under active development and currently support the main usecases of the Plaid API. There are some parts that are as yet unimplemented so pull requests are welcome!

Installation

Plaid-java is available at Maven Central with the following coordinates (latest release 0.3.1):


<dependency>
  <groupId>com.plaid</groupId>
  <artifactId>plaid-java</artifactId>
  <version>0.3.1</version>
</dependency>

Basic Usage


// Add Amex user, get 30 days of transactions

PlaidUserClient plaidUserClient = PlaidClients.testUserClient("test_id", "test_secret");
Credentials testCredentials = new Credentials("plaid_test", "plaid_good");
TransactionsResponse response = plaidUserClient.addUser(testCredentials, "amex", "[email protected]", null);

List<Transaction> transactions = response.getTransactions();

// Get all Categories

PlaidPublicClient plaidPublicClient = PlaidClients.testPublicClient();
CategoriesResponse categoriesResponse = plaidPublicClient.getAllCategories();

List<Category> categories = categoriesResponse.getCategories();

Check the Junit test classes for examples of more use cases.

Exchange a Plaid Link public_token for an API access_token

// Initialize a Plaid client with your client_id and secret
PlaidUserClient plaidUserClient = PlaidClients.testUserClient("test_id", "test_secret");

// Exchange the Link public_token ("test,bofa,connected") for an API access_token
PlaidUserResponse response = plaidUserClient.exchangeToken("test,bofa,connected");

// Initialize the user with the access_token returned by the exchangeToken call
plaidUserClient.setAccessToken(response.getAccessToken());

// Pull accounts for the user
// Note: This assumes you are using Link with the "auth" product
AccountsResponse response = plaidUserClient.updateAuth();

Dependencies

There are two main dependencies (of course automatically managed by Maven):

  1. Apache HTTPComponents Client. One reason for this, besides it being a nice library, is that the native JDK HttpUrlConnection doesn't have support for the HTTP Patch method, that is required by the Plaid API. The bindings are, however, designed so that you can replace HTTPComponents client with the HTTP library of your choice, by creating a different implementation of the HttpDelegate interface.

  2. The Jackson JSON Parser.

The project also has a test scope dependency on Wiremock, which is really useful in order to avoid hitting the sandbox API all the time.

Contributors

Related Repositories

Android_Data

Android_Data

Some Android learning materials, hoping to help you learn Android development. ...

material-intro

material-intro

A simple material design app intro with cool animations and a fluent API. ...

Android-DragDismissActivity

Android-DragDismissActivity

A smooth, easy-to-implement, drag to dismiss Android Activity ...

InkPageIndicator

InkPageIndicator

InkPageIndicator created by @nickbutcher for Plaid https://github.com/nickbutche ...

mimir

mimir

Mímir is an experimental rule engine written in Clojure. ...


Top Contributors

erimag blockmar adamlangsner Webbsurfer dmerrick MHova michaelckelly peteraarum colinmorelli drhops ewiner gkatalevsky pbernasconi shinjonathan

Releases

-   plaid-java-0.3.1 zip tar
-   plaid-java-0.3.0 zip tar
-   plaid-java-0.2.12 zip tar
-   plaid-java-0.2.11 zip tar
-   plaid-java-0.2.10 zip tar
-   plaid-java-0.2.9 zip tar
-   plaid-java-0.2.8 zip tar
-   plaid-java-0.2.7 zip tar
-   plaid-java-0.2.6 zip tar
-   plaid-java-0.2.5 zip tar
-   plaid-java-0.2.4 zip tar
-   plaid-java-0.2.3 zip tar
-   plaid-java-0.2.2 zip tar
-   plaid-java-0.2.1 zip tar
-   plaid-java-0.2 zip tar
-   plaid-java-0.1 zip tar