View Source Plaid.Item (plaid v3.3.0)

Functions for Plaid item endpoint.

Link to this section Summary

Functions

Creates a processor token used to integrate with services external to Plaid.

Creates a public token. To be used to put Plaid Link into update mode.

Creates a stripe bank account token used to create an authenticated funding source with Stripe.

Exchanges a public token for an access token and item id.

Invalidates access token and returns a new one.

Updates a V1 access token to V2.

Updates an Item's webhook.

Link to this section Types

@type config() :: %{required(atom()) => String.t() | keyword()}
@type error() :: {:error, Plaid.Error.t() | any()} | no_return()
@type params() :: %{required(atom()) => term()}
@type t() :: %Plaid.Item{
  available_products: [String.t()],
  billed_products: [String.t()],
  consent_expiration_time: String.t(),
  error: String.t() | nil,
  institution_id: String.t(),
  item_id: String.t(),
  request_id: String.t(),
  status: Plaid.Item.Status.t(),
  webhook: String.t()
}

Link to this section Functions

Link to this function

create_processor_token(params, config)

View Source
@spec create_processor_token(params(), config()) :: {:ok, map()} | error()

Creates a processor token used to integrate with services external to Plaid.

Parameters

%{
  access_token: "access-env-identifier",
  account_id: "plaid-account-id",
  processor: "dwolla"
}

Response

{:ok, %{processor_token: "some-token", request_id: "k522f2"}}
Link to this function

create_public_token(params, config \\ %{})

View Source
@spec create_public_token(params(), config()) :: {:ok, map()} | error()

Creates a public token. To be used to put Plaid Link into update mode.

Parameters

%{access_token: "access-env-identifier"}

Response

{:ok, %{public_token: "access-env-identifier", expiration: 3600, request_id: "kg414f"}}
Link to this function

create_stripe_bank_account_token(params, config \\ %{})

View Source
@spec create_stripe_bank_account_token(params(), config()) :: {:ok, map()} | error()

Creates a stripe bank account token used to create an authenticated funding source with Stripe.

Parameters

%{access_token: "access-env-identifier", account_id: "plaid-account-id"}

Response

{:ok, %{stripe_bank_account_token: "btok_Kb62HbBqrrvdf8pBsAdt", request_id: "[Unique request ID]"}}
Link to this function

exchange_public_token(params, config \\ %{})

View Source
@spec exchange_public_token(params(), config()) :: {:ok, map()} | error()

Exchanges a public token for an access token and item id.

Parameters

%{public_token: "public-env-identifier"}

Response

{:ok, %{access_token: "access-env-identifier", item_id: "some-id", request_id: "f24wfg"}}
Link to this function

get(params, config \\ %{})

View Source
@spec get(params(), config()) :: {:ok, t()} | error()

Gets an Item.

Parameters

%{access_token: "access-env-identifier"}
Link to this function

remove(params, config \\ %{})

View Source
@spec remove(params(), config()) :: {:ok, map()} | error()

Removes an Item.

Parameters

%{access_token: "access-env-identifier"}

Response

{:ok, %{request_id: "[Unique request ID]"}}
Link to this function

rotate_access_token(params, config \\ %{})

View Source
@spec rotate_access_token(params(), config()) :: {:ok, map()} | error()

Invalidates access token and returns a new one.

Parameters

%{access_token: "access-env-identifier"}

Response

{:ok, %{new_access_token: "access-env-identifier", request_id: "gag8fs"}}
Link to this function

update_version_access_token(params, config \\ %{})

View Source
@spec update_version_access_token(params(), config()) :: {:ok, map()} | error()

Updates a V1 access token to V2.

Parameters

%{access_token_v1: "test_wells"}

Response

{:ok, %{access_token: "access-env-identifier", item_id: "some-id", request_id: "f24wfg"}}
Link to this function

update_webhook(params, config \\ %{})

View Source
@spec update_webhook(params(), config()) :: {:ok, t()} | error()

Updates an Item's webhook.

Parameters

%{access_token: "access-env-identifier", webhook: "http://mywebsite/api"}