Internal accounts (your own bank accounts connected to Modern Treasury) and their balance reports from the bank.

Functions

get-balance-report

fn (internal-account-id: Str, report-id: Str): Map
fn (internal-account-id: Str, report-id: Str, opts: Map): Map

GET /api/internal_accounts/{id}/balance_reports/{report_id}: one balance report. report-id may be "latest".

Example

report ::modern-treasury::internal-accounts/get-balance-report("0f8e3719-3dfd-4613-9bbf-c0333781b59f", "latest")
map(report.balances, %.balance_type)

get-internal-account

fn (internal-account-id: Str): Map
fn (internal-account-id: Str, opts: Map): Map

GET /api/internal_accounts/{id}: retrieve an internal account.

Example

account ::modern-treasury::internal-accounts/get-internal-account("0f8e3719-3dfd-4613-9bbf-c0333781b59f")
account.currency

latest-balance-report

fn (internal-account-id: Str): Map
fn (internal-account-id: Str, opts: Map): Map

The most recent balance report for an internal account (get-balance-report(id, "latest")).

Example

report ::modern-treasury::internal-accounts/latest-balance-report("0f8e3719-3dfd-4613-9bbf-c0333781b59f")
report.as_of_date

list-balance-reports

fn (internal-account-id: Str): Map
fn (internal-account-id: Str, params: Map): Map
fn (internal-account-id: Str, params: Map, opts: Map): Map

GET /api/internal_accounts/{id}/balance_reports: one page of balance reports. Filters: as_of_date, balance_report_type ("intraday", "previous_day", "real_time", "other"), per_page, after_cursor. Each report's balances lists amounts by balance_type (e.g. closing_ledger, current_available).

Example

page ::modern-treasury::internal-accounts/list-balance-reports("0f8e3719-3dfd-4613-9bbf-c0333781b59f", {balance_report_type: "previous_day"})
map(page.items, %.as_of_date)

list-internal-accounts

fn (): Map
fn (params: Map): Map
fn (params: Map, opts: Map): Map

GET /api/internal_accounts: one page ({items, after_cursor, per_page}). Filters: currency, counterparty_id, legal_entity_id, payment_type, payment_direction, status, external_id, metadata, per_page, after_cursor.

Example

page ::modern-treasury::internal-accounts/list-internal-accounts({currency: "USD", per_page: 10})