Mercury.Treasury (mercury_client v1.0.0)

Copy Markdown View Source

The Mercury Treasury API — investment accounts, transactions, and statements.

Summary

Functions

Returns one page of treasury accounts. GET /treasury

Returns one page of statements for a treasury account. GET /treasury/{id}/statements

Returns one page of transactions for a treasury account. GET /treasury/{id}/transactions

A lazy, auto-paginating stream of every treasury account.

A lazy, auto-paginating stream of every statement for a treasury account.

A lazy, auto-paginating stream of every transaction for a treasury account.

Functions

list(client, opts \\ [])

@spec list(client :: Mercury.Client.t(), opts :: keyword()) ::
  {:ok, Mercury.Page.t(Mercury.TreasuryAccount.t())} | {:error, Exception.t()}

Returns one page of treasury accounts. GET /treasury

list!(client, opts \\ [])

@spec list!(client :: Mercury.Client.t(), opts :: keyword()) ::
  Mercury.Page.t(Mercury.TreasuryAccount.t())

list_statements(client, account_id, opts \\ [])

@spec list_statements(
  client :: Mercury.Client.t(),
  account_id :: String.t(),
  opts :: keyword()
) ::
  {:ok, Mercury.Page.t(Mercury.TreasuryStatement.t())} | {:error, Exception.t()}

Returns one page of statements for a treasury account. GET /treasury/{id}/statements

Accepts a :document_type filter in addition to the common list options.

list_statements!(client, account_id, opts \\ [])

@spec list_statements!(
  client :: Mercury.Client.t(),
  account_id :: String.t(),
  opts :: keyword()
) ::
  Mercury.Page.t(Mercury.TreasuryStatement.t())

list_transactions(client, account_id, opts \\ [])

@spec list_transactions(
  client :: Mercury.Client.t(),
  account_id :: String.t(),
  opts :: keyword()
) ::
  {:ok, Mercury.Page.t(Mercury.TreasuryTransaction.t())}
  | {:error, Exception.t()}

Returns one page of transactions for a treasury account. GET /treasury/{id}/transactions

list_transactions!(client, account_id, opts \\ [])

@spec list_transactions!(
  client :: Mercury.Client.t(),
  account_id :: String.t(),
  opts :: keyword()
) ::
  Mercury.Page.t(Mercury.TreasuryTransaction.t())

stream(client, opts \\ [])

@spec stream(client :: Mercury.Client.t(), opts :: keyword()) :: Enumerable.t()

A lazy, auto-paginating stream of every treasury account.

stream_statements(client, account_id, opts \\ [])

@spec stream_statements(
  client :: Mercury.Client.t(),
  account_id :: String.t(),
  opts :: keyword()
) ::
  Enumerable.t()

A lazy, auto-paginating stream of every statement for a treasury account.

stream_transactions(client, account_id, opts \\ [])

@spec stream_transactions(
  client :: Mercury.Client.t(),
  account_id :: String.t(),
  opts :: keyword()
) ::
  Enumerable.t()

A lazy, auto-paginating stream of every transaction for a treasury account.