Apply a one-time reconciliation baseline (migration cutover anchor)
accounting:writeTHE Baseline wizard executor (CLEARING-RECON-REENGINEER S6, 2026-07-01; Xero conversion-balance + NetSuite go-live pattern). In ONE database transaction it:
- creates a COMPLETED system reconciliation session (“Migration
baseline”) at
baseline_date/baseline_balance, - bulk-marks the bank GL’s unreconciled POSTED journal lines dated on
or before
baseline_dateas reconciled — EXCEPT the operator-kept in-transitkeep_open_gl_line_ids, - bulk-excludes (
exclude_reason='pre_baseline') unreconciled bank feed lines dated on or beforebaseline_date— EXCEPTkeep_open_bank_txn_ids, - stamps
reconciliation_baseline_date+baseline_balanceon the bank account (which then seeds new sessions’ opening balance), - returns the flip/exclude counts + the variance math.
Variance proof: variance = baseline_balance - (posted GL balance at the anchor - kept-open in-transit total). A variance beyond $0.01
returns 422 with the full math unless force: true.
Guards: 409 baseline_already_exists when a different baseline is
already stamped (re-running with the SAME date + balance is idempotent
and returns the existing session with already_applied: true);
409 reconciliation_in_progress when an open session exists (cancel it
first via PATCH /accounting/reconciliations/).
Posts ZERO GL. The only GL-adjacent effect is
journal_entry_lines.reconciled_at flips (the same GL-neutral signal a
normal match writes). No closed-period guard applies (the anchor date
is usually historical and nothing is posted).
Supports the Idempotency-Key header (canonical api-v1 mutation
contract) in addition to the parameter-level idempotency above.
Authorizations
API key issued per entity via Settings > Developers > API Keys.
Each key carries scopes (e.g. orders:read, products:write).
Bearer token format: Authorization: Bearer ark_live_ent_Test keys use ark_test_ent_. Both are issued per entity
via Settings > Developers > API Keys.
Path Parameters
Bank account UUID.
Body
The cutover/anchor date (YYYY-MM-DD).
The REAL bank statement balance at the anchor date.
Journal-entry-line UUIDs to KEEP unreconciled (in-transit checks/deposits not yet cleared at the anchor).
Bank transaction UUIDs to KEEP unexcluded (feed lines that must remain matchable).
Accept a nonzero anchor variance (default false -> 422 when |variance| > $0.01).
Appended to the system session's notes (capped 500 chars).
Response
Idempotent re-run (same date + balance already stamped)

