Skip to content

dasbudget/plaid-go

 
 

Repository files navigation

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.

Table of Contents

Install

Versions look something like v1.0.0. 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

Packages

No packages published

Languages

  • Go 66.6%
  • Mustache 33.1%
  • Other 0.3%