PlaidEx.API.Transactions (plaid_ex v1.0.0)

Copy Markdown View Source

Plaid Transactions API.

Supports both the modern cursor-based /transactions/sync endpoint and the legacy /transactions/get endpoint.

For new integrations, always use sync/2.

Summary

Functions

Enriches a list of non-Plaid transactions.

Legacy transaction retrieval by date range.

Returns recurring transaction streams (subscriptions, income, bills).

Refreshes transaction data for an item (triggers async data fetch).

Fetches transaction updates since the last cursor position.

Functions

enrich(config, transactions, opts \\ [])

@spec enrich(PlaidEx.Config.t(), [map()], keyword()) ::
  {:ok, %{enriched_transactions: [map()]}} | {:error, PlaidEx.Error.t()}

Enriches a list of non-Plaid transactions.

get(config, opts)

@spec get(
  PlaidEx.Config.t(),
  keyword()
) ::
  {:ok,
   %{
     transactions: [PlaidEx.Schemas.Transaction.t()],
     total_transactions: integer()
   }}
  | {:error, PlaidEx.Error.t()}

Legacy transaction retrieval by date range.

Prefer sync/2 for new integrations.

get_recurring(config, opts)

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

Returns recurring transaction streams (subscriptions, income, bills).

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

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

Refreshes transaction data for an item (triggers async data fetch).

sync(config, opts)

@spec sync(
  PlaidEx.Config.t(),
  keyword()
) ::
  {:ok, PlaidEx.Schemas.TransactionSyncPage.t()} | {:error, PlaidEx.Error.t()}

Fetches transaction updates since the last cursor position.

This is Plaid's preferred endpoint for ongoing transaction ingestion. Returns added, modified, and removed transaction arrays.

The cursor MUST be persisted after each successful call. Use PlaidEx.Sync.TransactionSync to manage this automatically.