PlaidEx.API.Items (plaid_ex v1.0.0)

Copy Markdown View Source

Plaid Items API — manage connected financial institution Items.

An Item represents a user's connection to a financial institution. It holds one or more accounts and is associated with an access token.

Summary

Functions

Creates a processor token for a partner processor (Dwolla, Stripe, etc.).

Creates a public token from an access token (for reinitializing Link in update mode).

Exchanges a Link public_token for an access_token.

Retrieves metadata about an Item and its available products.

Invalidates an access token and returns a new one. Use for token rotation.

Removes an Item. Revokes the access token and disconnects all linked accounts.

Functions

create_processor_token(config, access_token, account_id, processor, opts \\ [])

@spec create_processor_token(
  PlaidEx.Config.t(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, %{processor_token: String.t()}} | {:error, PlaidEx.Error.t()}

Creates a processor token for a partner processor (Dwolla, Stripe, etc.).

create_public_token(config, access_token, opts \\ [])

@spec create_public_token(PlaidEx.Config.t(), String.t(), keyword()) ::
  {:ok, %{public_token: String.t()}} | {:error, PlaidEx.Error.t()}

Creates a public token from an access token (for reinitializing Link in update mode).

exchange_public_token(config, public_token, opts \\ [])

@spec exchange_public_token(PlaidEx.Config.t(), String.t(), keyword()) ::
  {:ok, PlaidEx.Schemas.AccessToken.t()} | {:error, PlaidEx.Error.t()}

Exchanges a Link public_token for an access_token.

The public_token is returned by the Plaid Link SDK after the user successfully completes the Link flow. It is short-lived (30 minutes) and single-use. Exchange it immediately.

Store the returned access_token permanently — it does not expire unless the user revokes access or the item enters error state.

get(config, access_token, opts \\ [])

@spec get(PlaidEx.Config.t(), String.t(), keyword()) ::
  {:ok, %{item: PlaidEx.Schemas.Item.t(), status: map()}}
  | {:error, PlaidEx.Error.t()}

Retrieves metadata about an Item and its available products.

invalidate_access_token(config, access_token, opts \\ [])

@spec invalidate_access_token(PlaidEx.Config.t(), String.t(), keyword()) ::
  {:ok, %{new_access_token: String.t()}} | {:error, PlaidEx.Error.t()}

Invalidates an access token and returns a new one. Use for token rotation.

remove(config, value, opts \\ [])

@spec remove(PlaidEx.Config.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, PlaidEx.Error.t()}

Removes an Item. Revokes the access token and disconnects all linked accounts.

update_webhook(config, access_token, webhook_url, opts \\ [])

@spec update_webhook(PlaidEx.Config.t(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, PlaidEx.Error.t()}

Updates the webhook URL for an Item.