View Source Plaid.Item (elixir_plaid v1.2.1)

Plaid Item API calls and schema.

Link to this section Summary

Functions

Exchange a public token for an access token.

Get information about an item.

Invalidate an access token.

Removes an item.

Update a webhook for an access_token.

Link to this section Types

Specs

t() :: %Plaid.Item{
  available_products: [String.t()],
  billed_products: [String.t()],
  consent_expiration_time: String.t() | nil,
  error: Plaid.Error.t() | nil,
  has_perpetual_otp: boolean(),
  institution_id: String.t() | nil,
  item_id: String.t(),
  update_type: String.t(),
  webhook: String.t() | nil
}

Link to this section Functions

Link to this function

exchange_public_token(public_token, config)

View Source

Specs

exchange_public_token(String.t(), Plaid.config()) ::
  {:ok, Plaid.Item.ExchangePublicTokenResponse.t()} | {:error, Plaid.Error.t()}

Exchange a public token for an access token.

Does a POST /item/public_token/exchange call which exchanges a public token for an access token.

params

Params

  • public_token - Your public_token, obtained from the Link onSuccess callback or POST /sandbox/item/public_token/create.

examples

Examples

Item.exchange_public_token(
  "public-prod-123xxx",
  client_id: "123",
  secret: "abc"
)
{:ok, %Item.ExchangePublicTokenResponse{}}
Link to this function

get(access_token, config)

View Source

Specs

get(String.t(), Plaid.config()) ::
  {:ok, Plaid.Item.GetResponse.t()} | {:error, Plaid.Error.t()}

Get information about an item.

Does a POST /item/get call which returns information about an item and its status.

params

Params

  • access_token - The access token associated with the item.

examples

Examples

Item.get("access-prod-123xxx", client_id: "123", secret: "abc")
{:ok, %Item.GetResponse{}}
Link to this function

invalidate_access_token(access_token, config)

View Source

Specs

invalidate_access_token(String.t(), Plaid.config()) ::
  {:ok, Plaid.Item.InvalidateAccessTokenResponse.t()}
  | {:error, Plaid.Error.t()}

Invalidate an access token.

Does a POST /item/access_token/invalidate call which rotates an access token for an item. Immediately invalidating it and returning a new access token.

params

Params

  • access_token - The access token associated with the Item data is being requested for.

examples

Examples

Item.invalidate_access_token(
  "access-prod-123xxx",
  client_id: "123",
  secret: "abc"
)
{:ok, %Item.InvalidateAccessTokenResponse{}}
Link to this function

remove(access_token, config)

View Source

Specs

remove(String.t(), Plaid.config()) ::
  {:ok, Plaid.SimpleResponse.t()} | {:error, Plaid.Error.t()}

Removes an item.

Does a POST /item/remove call to remove an item.

params

Params

  • access_token - The access token associated with the item.

examples

Examples

Item.remove("access-prod-123xxx", client_id: "123", secret: "abc")
{:ok, %Plaid.SimpleResponse{}}
Link to this function

update_webhook(access_token, webhook, config)

View Source

Specs

update_webhook(String.t(), String.t(), Plaid.config()) ::
  {:ok, Plaid.Item.UpdateWebhookResponse.t()} | {:error, Plaid.Error.t()}

Update a webhook for an access_token.

Does a POST /item/webhook/update call which is used to update webhook for a particular access_token.

params

Params

  • access_token - The access token associated with the item.
  • webhook - The new webhook URL.

examples

Examples

Item.update_webhook(
  "access-prod-123xxx",
  "https://plaid.com/fake/webhook",
  client_id: "123",
  secret: "abc"
)
{:ok, %Item.UpdateWebhookResponse{}}