Tink.Accounts (Tink v1.0.0)

Copy Markdown View Source

Account data access. Requires accounts:read scope.

List and get calls are cached for 5 minutes per-user. Balance calls are cached for 1 minute. Write operations automatically invalidate affected cache entries.

Summary

Functions

Get a single account by ID. Cached 5 min.

Get balances for an account. Cached 1 min.

Get parties (owners) of an account. Requires accounts.parties:readonly.

List all accounts. Cached 5 min per user.

List accounts via v1 API (legacy). Requires accounts:read.

Stream all accounts across all pages (no cache — streams bypass cache).

Update account metadata. Requires accounts:write. Invalidates account cache.

Functions

get(client, account_id)

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

Get a single account by ID. Cached 5 min.

get_balances(client, account_id)

@spec get_balances(Tink.Client.t(), String.t()) ::
  {:ok, map()} | {:error, Tink.Error.t()}

Get balances for an account. Cached 1 min.

get_parties(client, account_id)

@spec get_parties(Tink.Client.t(), String.t()) ::
  {:ok, map()} | {:error, Tink.Error.t()}

Get parties (owners) of an account. Requires accounts.parties:readonly.

list(client, opts \\ [])

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

List all accounts. Cached 5 min per user.

Options

  • :page_size - max 100
  • :page_token - cursor from previous response
  • :type_in - list of account types, e.g. ["CHECKING", "SAVINGS"]

list_v1(client, opts \\ [])

@spec list_v1(
  Tink.Client.t(),
  keyword()
) :: {:ok, map()} | {:error, Tink.Error.t()}

List accounts via v1 API (legacy). Requires accounts:read.

stream(client, opts \\ [])

@spec stream(
  Tink.Client.t(),
  keyword()
) :: Enumerable.t()

Stream all accounts across all pages (no cache — streams bypass cache).

update(client, account_id, params)

@spec update(Tink.Client.t(), String.t(), map()) ::
  {:ok, map()} | {:error, Tink.Error.t()}

Update account metadata. Requires accounts:write. Invalidates account cache.