Invoice Imports

Import outstanding sales invoices from CSV using the Outstanding Document Closure Engine (ODCE) with the receivables (AR) direction. The pipeline parses invoice rows, resolves contacts via UCI-lite matching (exact + Levenshtein fuzzy at ≥ 85% threshold), and validates the clearing zero-sum invariant against the AR migration clearing account (1198 MC_AR).

Precondition gates:

  1. Opening balances must exist
  2. Opening balances must be in Clearing Mode (not Direct)
  3. Cash VAT scheme is blocked (CASH_VAT_UNSUPPORTED)

On confirm, the engine creates migrated invoices, posts contra-wash clearing journal entries (DR Trade Debtors, CR MC_AR), and generates synthetic payment records for partially paid invoices. The clearing zero-sum invariant is verified at commit: OB(MC_AR) + Δ(MC_AR) = 0.

All monetary values in API responses are formatted as pounds (e.g. "1500.00"). Internal storage uses pence (integer minor units).

→ The Invoice Imports object

Endpoints