Pluggy.Accounts (PluggyAI v0.1.0)

Copy Markdown View Source

Functions for interacting with the Pluggy Accounts API.

Summary

Functions

Gets an account by ID.

Lists accounts for a given item.

Lists accounts with cursor-based pagination.

Fetches statements for an account.

Functions

get(client, id)

@spec get(Pluggy.Client.t(), String.t()) :: {:ok, term()} | {:error, Pluggy.Error.t()}

Gets an account by ID.

get!(client, id)

@spec get!(Pluggy.Client.t(), String.t()) :: term()

list(client, item_or_id, opts \\ [])

@spec list(Pluggy.Client.t(), String.t() | map(), keyword()) ::
  {:ok, term()} | {:error, Pluggy.Error.t()}

Lists accounts for a given item.

The second argument accepts either an item ID string or an item map (e.g. the result of Pluggy.Items.get/2) — the :id field is extracted automatically.

Options

  • :type - Filter by account type ("BANK" or "CREDIT")

Examples

Pluggy.Accounts.list(client, "item-uuid")
Pluggy.Accounts.list(client, item)   # item is %{id: "item-uuid", ...}

list!(client, item_or_id, opts \\ [])

@spec list!(Pluggy.Client.t(), String.t() | map(), keyword()) :: term()

list_with_cursor(client, item_or_id, opts \\ [])

@spec list_with_cursor(Pluggy.Client.t(), String.t() | map(), keyword()) ::
  {:ok, map(), Pluggy.HTTP.Cursor.t() | nil} | {:error, Pluggy.Error.t()}

Lists accounts with cursor-based pagination.

The second argument accepts either an item ID string or an item map — the :id field is extracted automatically.

Returns {:ok, response, cursor} where cursor is a %Pluggy.HTTP.Cursor{} when more pages are available, or nil when on the last page.

Pass the cursor to Pluggy.HTTP.with_cursor/1 to fetch the next page.

statements(client, id)

@spec statements(Pluggy.Client.t(), String.t()) ::
  {:ok, term()} | {:error, Pluggy.Error.t()}

Fetches statements for an account.

statements!(client, id)

@spec statements!(Pluggy.Client.t(), String.t()) :: term()