Skip to content

Latest commit

 

History

History
69 lines (45 loc) · 2.69 KB

README.md

File metadata and controls

69 lines (45 loc) · 2.69 KB

plaid-go CircleCI GoDoc

The official Go client library for the Plaid API. The library is now generated from our OpenAPI schema. For older manually-written versions of this client library, go here for the latest non-generated version.

The latest version of the library supports only the latest version of the Plaid API (currently 2020-09-14).

Table of Contents

Install

Library versions follow Semantic Versioning ("SemVer") and are formatted as v1.0.0. The plaid-go client library is typically updated on a biweekly basis, and the canonical source for the latest version number is the client library changelog. As of v1.0.0, we've moved to support GOMODULES.

Edit your go.mod to include github.com/plaid/plaid-go {VERSION}

$ go get github.com/plaid/plaid-go@{VERSION}

Documentation

The module supports all Plaid API endpoints. For complete information about the API, head to the docs.

Getting Started

Calling Endpoints

To call an endpoint, you must create a Plaid API client. Here's how to configure it:

configuration := plaid.NewConfiguration()
configuration.AddDefaultHeader("PLAID-CLIENT-ID", {VALUE})
configuration.AddDefaultHeader("PLAID-SECRET", {VALUE})
configuration.UseEnvironment(plaid.Production)
client := plaid.NewAPIClient(configuration)

Each endpoint will require an appropriate request model, and will return either the response model or an error.

Errors

In the case one of the endpoints you call returns an error, you can get the Plaid error object with the following:

response, httpResponse, err := client.PlaidApi.Endpoint(...)
plaidErr, err := plaid.ToPlaidError(err)
fmt.Println(plaidErr.ErrorMessage)

Authentication

First, you get your client_id and secret from your dashboard account. Authentication is handled by setting the client_id and secret on the configuration object.

Contributing

Please see Contributing for guidelines and instructions for local development.

License

MIT