plaid v0.2.0 Plaid.Token

Functions for working with a Plaid token.

Through this API you can:

  • Exchange a public token for an access token

Plaid API Reference: https://plaid.com/docs/quickstart/#-exchange_token-endpoint

  • TO-DO: incorporate account _id in payload.

Summary

Functions

Exchange a public token

Exchanges a public token with user-supplied credentials

Functions

exchange(params)

Specs

exchange(binary | map) :: {atom, binary | map}

Exchange a public token.

Exchanges a user’s public token for an access token. Uses credentials in the configuration. Accepts params as a binary or a map.

Returns an access token or Plaid.Error struct.

Payload

  • params - user public token - string or map - required

Example

params = "test,bofa,connected" OR %{public_token: "test,bofa,connected"}

{:ok, "test_bofa"} = Plaid.Token.exchange(params)
{:error, %Plaid.Error{...}} = Plaid.Token.exchange(params)
exchange(params, cred)

Specs

exchange(binary, map) :: {atom, binary | map}
exchange(map, map) :: {atom, binary | map}

Exchanges a public token with user-supplied credentials.

Params are supplied as a map.

Payload

  • public_token - user public token - string - required

Example

params = %{public_token: "test,bofa,connected"}
cred = %{client_id: "test_id", secret: "test_secret"}

{:ok, "test_bofa"} = Plaid.Token.exchange(params, cred)
{:error, %Plaid.Error{...}} = Plaid.Token.exchange(params, cred)