TreasuryPrime.InvoiceAccountNumber (TreasuryPrime v1.0.0)

Copy Markdown View Source

An invoice/virtual account number — an additional account number that routes deposits into an existing TreasuryPrime.Account, without being a separate ledger account itself. Useful for giving each customer/invoice its own receiving account number so incoming ACH/wire credits can be automatically reconciled to the right invoice or sub-customer, while all the money ultimately lands in one underlying account.

The parent account's additional_account_numbers field lists every invoice account number associated with it.

Creating one

{:ok, invoice_number} =
  TreasuryPrime.InvoiceAccountNumber.create(client, %{account_id: "acct_1234567890"})

Summary

Functions

Creates an invoice account number tied to an existing account. Required: account_id.

Fetches a single invoice account number by id.

Lists invoice account numbers.

Updates an invoice account number (e.g. its status).

Types

t()

@type t() :: %TreasuryPrime.InvoiceAccountNumber{
  account_id: String.t() | nil,
  account_number: String.t() | nil,
  created_at: String.t() | nil,
  id: String.t() | nil,
  routing_number: String.t() | nil,
  status: String.t() | nil,
  updated_at: String.t() | nil,
  userdata: map() | nil
}

Functions

create(client, params, opts \\ [])

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

Creates an invoice account number tied to an existing account. Required: account_id.

create!(client, params, opts \\ [])

@spec create!(TreasuryPrime.Client.t(), map(), keyword()) :: t()

get(client, id)

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

Fetches a single invoice account number by id.

get!(client, id)

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

list(client, params \\ %{})

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

Lists invoice account numbers.

Filterable params

account_id, account_number, status.

list!(client, params \\ %{})

update(client, id, params)

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

Updates an invoice account number (e.g. its status).

update!(client, id, params)

@spec update!(TreasuryPrime.Client.t(), String.t(), map()) :: t()