Bank accounts: balances, ownership, locking, interest rates, statements, tax documents, and transaction history.
Accounts cannot be created directly through this resource — they're
created as the result of an approved TreasuryPrime.AccountApplication.
See the "Account Opening" group of modules for that flow.
Field reference (response)
| Field | Notes |
|---|---|
id | acct_... |
account_number | Filterable. |
routing_number | |
account_type | checking or savings |
account_product_id | |
name | Name of the person/company that owns the account |
nickname | |
status | open, closed, close_pending. Filterable. |
currency | Always usd today |
available_balance | decimal string, may be nil |
current_balance | decimal string, may be nil |
interest_rate | decimal string |
funded | boolean |
locked / lock | see lock/3 / unlock/2 |
person_ids / business_ids | owners |
primary_person_id | |
org_id / bank_id | Filterable. |
physical_address / mailing_address | embedded address maps |
additional_account_numbers | linked TreasuryPrime.InvoiceAccountNumbers |
tags | array of strings, filterable |
userdata | your arbitrary metadata |
closed_date | |
created_at / updated_at |
Summary
Functions
Lists month-by-month average balances for an account.
Lists day-by-day end-of-day balances for an account.
Deletes a (typically not-yet-filed) tax document.
Fetches a previously generated statement for an account.
Fetches a single tax document by id.
Generates a new monthly account statement (a PDF) for the given month.
Generates (files) a tax document for an account, e.g. a 1099-INT for a
given year ("YYYY"). type is currently always "1099".
Fetches a single account by id.
Lists accounts.
Locks an account, blocking activity while a fraud/compliance investigation takes place.
Lists pending (not-yet-posted) transactions for an account, e.g. holds.
Sets or updates an account's interest rate. rate is a float between 0
and 1 (exclusive of 1), e.g. 0.015 for 1.5% APY.
Lists tax documents (e.g. 1099-INT) generated for an account.
Lists posted transactions for an account.
Unlocks a previously locked account.
Updates (e.g. re-files / corrects) a tax document.
Types
@type t() :: %TreasuryPrime.Account{ account_number: String.t() | nil, account_product_id: String.t() | nil, account_type: String.t() | nil, additional_account_numbers: [String.t()] | nil, address: map() | nil, available_balance: String.t() | nil, bank_id: String.t() | nil, business_ids: [String.t()] | nil, closed_date: String.t() | nil, created_at: String.t() | nil, currency: String.t() | nil, current_balance: String.t() | nil, funded: boolean() | nil, id: String.t() | nil, interest_rate: String.t() | nil, lock: map() | nil, locked: boolean() | nil, mailing_address: map() | nil, name: String.t() | nil, nickname: String.t() | nil, org_id: String.t() | nil, person_ids: [String.t()] | nil, physical_address: map() | nil, primary_person_id: String.t() | nil, routing_number: String.t() | nil, status: String.t() | nil, tags: [String.t()] | nil, updated_at: String.t() | nil, userdata: map() | nil }
Functions
@spec average_balances(TreasuryPrime.Client.t(), String.t(), map()) :: {:ok, TreasuryPrime.Page.t()} | {:error, TreasuryPrime.Error.t()}
Lists month-by-month average balances for an account.
@spec daily_balances(TreasuryPrime.Client.t(), String.t(), map()) :: {:ok, TreasuryPrime.Page.t()} | {:error, TreasuryPrime.Error.t()}
Lists day-by-day end-of-day balances for an account.
@spec delete_tax_document(TreasuryPrime.Client.t(), String.t(), String.t()) :: {:ok, nil} | {:error, TreasuryPrime.Error.t()}
Deletes a (typically not-yet-filed) tax document.
@spec fetch_statement(TreasuryPrime.Client.t(), String.t(), String.t()) :: {:ok, map()} | {:error, TreasuryPrime.Error.t()}
Fetches a previously generated statement for an account.
@spec fetch_tax_document(TreasuryPrime.Client.t(), String.t(), String.t()) :: {:ok, TreasuryPrime.TaxDocument.t()} | {:error, TreasuryPrime.Error.t()}
Fetches a single tax document by id.
@spec generate_statement(TreasuryPrime.Client.t(), String.t(), map()) :: {:ok, map()} | {:error, TreasuryPrime.Error.t()}
Generates a new monthly account statement (a PDF) for the given month.
params requires date ("YYYY-MM"), type (only "monthly" is
currently supported), and the statement boilerplate fields
(org_legal_name, phone_number, email_address, support_url,
footnote) unless you've set up a TreasuryPrime.StatementConfig that
supplies defaults. Returns a map including a "url" to download the PDF.
@spec generate_tax_document(TreasuryPrime.Client.t(), String.t(), map()) :: {:ok, TreasuryPrime.TaxDocument.t()} | {:error, TreasuryPrime.Error.t()}
Generates (files) a tax document for an account, e.g. a 1099-INT for a
given year ("YYYY"). type is currently always "1099".
@spec get(TreasuryPrime.Client.t(), String.t()) :: {:ok, t()} | {:error, TreasuryPrime.Error.t()}
Fetches a single account by id.
@spec get!(TreasuryPrime.Client.t(), String.t()) :: t()
@spec list(TreasuryPrime.Client.t(), map()) :: {:ok, TreasuryPrime.Page.t()} | {:error, TreasuryPrime.Error.t()}
Lists accounts.
Filterable params
account_number, org_id, status, tags, plus standard pagination
(page_cursor, page_size, from_date, to_date).
@spec list!(TreasuryPrime.Client.t(), map()) :: TreasuryPrime.Page.t()
@spec lock(TreasuryPrime.Client.t(), String.t(), String.t(), keyword()) :: {:ok, t()} | {:error, TreasuryPrime.Error.t()}
Locks an account, blocking activity while a fraud/compliance investigation takes place.
reason must be one of "transactions_being_investigated_wire",
"transactions_being_investigated_card",
"transactions_being_investigated_ACH",
"transactions_being_investigated_check_issued",
"transactions_being_investigated_check_deposit", or
"identity_of_customer_being_investigated".
Pass additional_context: "..." (e.g. a related payment ID) via opts —
this is forwarded to your partner bank.
@spec pending_transactions(TreasuryPrime.Client.t(), String.t(), map()) :: {:ok, TreasuryPrime.Page.t()} | {:error, TreasuryPrime.Error.t()}
Lists pending (not-yet-posted) transactions for an account, e.g. holds.
@spec set_interest_rate(TreasuryPrime.Client.t(), String.t(), float()) :: {:ok, t()} | {:error, TreasuryPrime.Error.t()}
Sets or updates an account's interest rate. rate is a float between 0
and 1 (exclusive of 1), e.g. 0.015 for 1.5% APY.
@spec tax_documents(TreasuryPrime.Client.t(), String.t(), map()) :: {:ok, TreasuryPrime.Page.t()} | {:error, TreasuryPrime.Error.t()}
Lists tax documents (e.g. 1099-INT) generated for an account.
@spec transactions(TreasuryPrime.Client.t(), String.t(), map()) :: {:ok, TreasuryPrime.Page.t()} | {:error, TreasuryPrime.Error.t()}
Lists posted transactions for an account.
@spec unlock(TreasuryPrime.Client.t(), String.t()) :: {:ok, t()} | {:error, TreasuryPrime.Error.t()}
Unlocks a previously locked account.
@spec update(TreasuryPrime.Client.t(), String.t(), map()) :: {:ok, t()} | {:error, TreasuryPrime.Error.t()}
Updates an account. Accepts name, nickname, tags, userdata,
physical_address, mailing_address, and status (only settable value
is "close_pending"). For locking, prefer lock/3 and unlock/2 below.
@spec update!(TreasuryPrime.Client.t(), String.t(), map()) :: t()
@spec update_tax_document(TreasuryPrime.Client.t(), String.t(), String.t(), map()) :: {:ok, TreasuryPrime.TaxDocument.t()} | {:error, TreasuryPrime.Error.t()}
Updates (e.g. re-files / corrects) a tax document.