PlaidEx.API.Link (plaid_ex v1.0.0)

Copy Markdown View Source

Plaid Link Token API.

Link tokens are the entry point to every Plaid integration. They authorize a specific Link session with configured products, user identity, and customization.

  1. Your server calls create_token/2 — server-side only, never client-side
  2. Pass the link_token to the Plaid Link SDK (iOS, Android, Web)
  3. User completes Link, your frontend receives a public_token
  4. Your server calls PlaidEx.API.Items.exchange_public_token/3
  5. Store the returned access_token — this is the permanent credential

Link tokens expire after 4 hours. Do not persist them.

Summary

Functions

Retrieves metadata about an existing link token.

Lists all Link sessions for debugging (sandbox only).

Functions

create_token(config, params, opts \\ [])

@spec create_token(PlaidEx.Config.t(), keyword() | map(), keyword()) ::
  {:ok, PlaidEx.Schemas.LinkToken.t()} | {:error, PlaidEx.Error.t()}

Creates a Link token.

Required params

user: %{client_user_id: "your-user-id"},
client_name: "Your App Name",
products: ["transactions"],
country_codes: ["US"],
language: "en"

get_token(config, link_token, opts \\ [])

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

Retrieves metadata about an existing link token.

list_sessions(config, opts \\ [])

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

Lists all Link sessions for debugging (sandbox only).