Firm & customer endpoints
Available on both books. Same shapes; the data comes from whichever backend you hit.
Firm-wide
GET /v1/firm/summary
Firm-level KPIs. Response:
{
"total_deposits_usd": "...", "total_withdrawals_usd": "...",
"fees_revenue_usd": "...", "aum_custody_usd": "...",
"cash_usd": "...", "cash_aed_usd": "...",
"transaction_count": 0, "customer_count": 0,
"by_type": [{"txn_type":"buy_security","count":N,"total_usd":"..."}, ...],
"flows": [{"day":"2026-06-01","deposits_usd":"...","withdrawals_usd":"..."}],
"recent": [ ...RecentTxn... ]
}
GET /v1/firm/earnings
Revenue / cost / margin by source (GTN / Aldar / Valura / FX-spread for India).
GET /v1/firm/accounts
Chart of accounts + running debit / credit / net per code.
GET /v1/firm/trial_balance
Same as /accounts focused on the trial-balance shape (feeds trial_balance_zero).
Transactions
GET /v1/transactions
Paginated + filterable. Query params:
limit,offsetcustomer_id,txn_type,source,category,symbolfrom,to(dates)amount_min,amount_maxsort(txn_datedefault,posted_at,amount_usd)
GET /v1/transactions/{txn_id}
One transaction + its journal lines.
GET /v1/transactions/categories
Facet counts for the category chips.
GET /v1/transactions/grouped?group_by=type|source|customer|day|symbol
Grouped totals for the same filter surface.
POST /v1/transactions
Admin — manual transaction entry.
POST /v1/transactions/preview
Admin — validates a would-be transaction, returns the postings that WOULD result, without persisting.
POST /v1/transactions/{txn_id}/reverse
Admin — post a reversing entry. Idempotent.
Journal & postings
GET /v1/journal— paginated journal-line view.GET /v1/journal/grouped— grouped totals.GET /v1/postings— flattened DR/CR line view with joins.
Per-customer
All scoped under /v1/customers/{id}/...:
/summary,/overview,/portfolio,/positions,/holdings/dividends,/orders,/statement,/equity_curve,/trial_balance/ledger-recon(India)/viewtrade-balance,/viewtrade-orders,/viewtrade-portfolio,/viewtrade-statement(India — raw ViewTrade views)
Plus GET /v1/customers for the list.
Reconciliation
GET /v1/reconciliation/runs— historyGET /v1/reconciliation/runs/{run_id}— detailPOST /v1/reconciliation/run— trigger a run; optional{"category":"A|B|C|D"}body
Cash requests (UAE primary)
POST /v1/cash-requests— createGET /v1/cash-requests— listGET /v1/cash-requests/{id}— onePOST /v1/cash-requests/{id}/confirm— mark completePOST /v1/cash-requests/{id}/fail— mark failedPOST /v1/cash-requests/{id}/cancel— cancel
Health
GET /health/live— process up (200)GET /health/ready— DB reachable + migrations at head (200 or 503)GET /ping— no-op (200)