# InterTraq increment-1 CSV schema

Synthetic demo and local app only. USD cents. No QuickBooks compatibility claim.

Files are processed in the browser after the app is loaded; increment 1 has no backend and does not transmit uploaded rows.

## Synthetic marking

Fictional sample filenames and file bodies include `SYNTHETIC`. Demo reconciliation exports do too. User-uploaded files and exports from those files are not labeled synthetic.

## Activity CSV (one file per entity, or any mix of entity rows)

Required header (exact names, any order):

`source_id,entity,period,date,account,reference,description,debit,credit`

Rules:

- `source_id` — nonempty, unique across a load
- `entity` — nonempty code (samples use `OAK_HOLDINGS` and `OAK_RETAIL`)
- `period` — `YYYY-MM` and must match `date`
- `date` — `YYYY-MM-DD`
- `account` — nonempty
- `reference` — document/reference id; empty allowed; matching normalizes with trim, uppercase, collapsed whitespace
- `description` — free text
- `debit` / `credit` — USD with at most 2 decimal places. Commas and a leading `$` are allowed. Sub-cent values such as `100.005` are rejected, not rounded. Both sides nonzero is rejected. A row may have one side zero.
- Last data row may be `source_id=TOTALS` with debit/credit equal to the sum of detail rows. If present, a mismatch is a hard error. TOTALS is not a GL row.

Comment lines starting with `#` are allowed before the header.

Every record must have the same number of fields as the header. Quote fields containing commas, and escape literal quotes as `""` inside a quoted field. Multiline fields are not supported; malformed records are rejected, not repaired or dropped.

Sign convention: each row net cents = debit cents − credit cents. Reciprocal intercompany accounts cancel when combined.

## Opening control CSV

Required header:

`period,entity_a,entity_b,opening_variance_cents,label`

- `opening_variance_cents` — integer cents (may be negative)
- `label` — named bridge line (samples include `Legacy opening variance`)
- Period 2 opening must equal period 1 closing when both periods are loaded

## Auto-match (engine)

Auto-match only when all are true:

1. Unique shared nonempty normalized reference
2. Reciprocal cents (A net + B net = 0)
3. Dates within 7 calendar days inclusive

Equally eligible conflicts stay suggested (ambiguous), never auto-matched. Amount-only never auto-matches. 1-to-N reciprocal sums with the same reference become a split suggestion that needs human approval. Timing (shared reference outside the date window) and one-sided rows stay unmatched.
