StarlingBank.Accounts (StarlingBank v1.0.0)

Copy Markdown View Source

Accounts — list the account holder's bank accounts, fetch account identifiers (sort code / account number, IBAN), and confirmation of funds.

Required scopes: account:read, account-list:read, account-identifier:read, confirmation-of-funds:read.

Summary

Functions

Gets the confirmation of funds for an account (is target_amount_in_minor_units available?).

Fetches a single account by UID.

Gets the account and bank identifiers (sort code / account number, IBAN, BIC) for an account.

Lists all accounts belonging to the authenticated account holder.

Types

t()

@type t() :: %StarlingBank.Accounts{
  account_type: String.t(),
  account_uid: String.t(),
  created_at: DateTime.t() | nil,
  currency: String.t(),
  default_category: String.t(),
  name: String.t() | nil
}

Functions

confirmation_of_funds(account_uid, target_amount_in_minor_units, client \\ nil)

@spec confirmation_of_funds(
  String.t(),
  pos_integer(),
  StarlingBank.Client.t() | keyword() | nil
) ::
  {:ok, map()} | {:error, StarlingBank.Error.t()}

Gets the confirmation of funds for an account (is target_amount_in_minor_units available?).

get(account_uid, client \\ nil)

@spec get(String.t(), StarlingBank.Client.t() | keyword() | nil) ::
  {:ok, t()} | {:error, StarlingBank.Error.t()}

Fetches a single account by UID.

identifiers(account_uid, client \\ nil)

@spec identifiers(String.t(), StarlingBank.Client.t() | keyword() | nil) ::
  {:ok, map()} | {:error, StarlingBank.Error.t()}

Gets the account and bank identifiers (sort code / account number, IBAN, BIC) for an account.

list(client \\ nil)

@spec list(StarlingBank.Client.t() | keyword() | nil) ::
  {:ok, [t()]} | {:error, StarlingBank.Error.t()}

Lists all accounts belonging to the authenticated account holder.