Ingest financials
This guide walks through populating the financials surface for a company. The endpoints are provider-agnostic — call them from a Mercury sync job, an OpenClaw export, a QuickBooks integration, or a one-off curl.
Prerequisites
- A company id (
co_...) - A human-scope API key
1. Post a cash balance
Emits bank.balance.updated. The Cash on hand tile updates immediately.
Re-post the same as_of to update the value (no upsert collision; multiple
rows per day are allowed if connection_id differs).
2. Bulk-ingest transactions
Either send a single transaction, or wrap many in a transactions array.
Provide an external_id per transaction to make the ingest idempotent —
re-posts with the same (connection_id, external_id) are skipped.
Emits a single bank.transaction.posted event with the count and the
inserted rows. Up to 500 transactions per request.
3. Post a statement snapshot
Emits financial.snapshot.updated. Re-posting the same (statement_type, period_end) upserts.
Repeat for statement_type=balance and statement_type=cashflow.
Recommended sync cadence
Wiring it from a worker
A simple sync worker pseudocode:
Schedule this on Vercel Cron and let webhook events keep your dashboard revalidated on every push.