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).
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}
The module supports all Plaid API endpoints. For complete information about the API, head to the docs.
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.
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)
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.
Please see Contributing for guidelines and instructions for local development.