Skip to main content
A rule tells End Close which records on Side A of a reconciliation belong with which records on Side B. When a rule finds records that belong together, it groups them into a match, and those records count as reconciled in that reconciliation.

How rules and matches fit with the other concepts

  • Rules belong to one reconciliation and compare fields across its two sides.
  • A match groups records from that reconciliation’s data streams. A record can be in at most one match per reconciliation.
  • Records that no rule or person matches stay open, and become exceptions once overdue.
  • End Close’s reconciliation agent writes rules for you, and you can write your own. See Matching rules.

Rule fields

Rule types

There’s no many-to-many rule type yet. To match several records on each side, make the match by hand.

One-to-one rules

A one-to-one rule is a tree of conditions joined with AND or OR. Each condition compares a Side A field (key) with a Side B field (value) using an operator: eq, neq, contains, gt, gte, lt, lte, in or not_in. Fields are the standard record fields (amount, date, description, direction, external_id) or metadata in dot notation, such as metadata.invoice_number. A one-to-one rule must compare amounts and must include at least two exact eq conditions, so it can’t pair records on amount alone.
One-to-one rule
An eq condition can carry a tolerance in dollar, percent, day or month, which loosens that comparison. A condition with a tolerance doesn’t count toward the two exact conditions. Transforms normalize a field before it’s compared: lowercase, uppercase, alphanumeric_only, digits_only, or first_n_chars.

Many-to-one rules

A many-to-one rule, also called a rollup rule, groups records on one side and matches each group’s total to a single record on the other side. When rollup.tolerance is set and a group matches within it, End Close books the difference as an adjustment on the reconciliation’s own adjustments stream, so the match still nets to zero. It only makes that match when there’s exactly one candidate group within the variance and that group has exactly one candidate record. A many-to-one rule’s filters accept only AND-combined eq conditions without tolerances. Each one keeps groups with the matching record that shares the value, for example metadata.operator eq metadata.operator. See Rollup rules for worked examples.

When rules run

A continuous reconciliation checks each new record against its one-to-one rules as it arrives, and runs its rollup rules shortly after an import lands. A batch reconciliation runs every active rule, in priority order, when you start a run. See Continuous and batch reconciliations.

Matches

A match is a group of records that account for each other in one reconciliation. A match can hold many records. To list them, call GET /records?reconciliation_match_id={id}.

Match records by hand

POST /reconciliation_matches matches any set of records, on one side or both. Every record must be unmatched in that reconciliation and belong to one of its data streams. A record matched in a different reconciliation is fine.
cURL
Response
With create_adjustment: true, End Close adds an adjustment record when the records don’t balance, which is why record_count is one more than the records you sent. Leave it out to match the records exactly as they are. Manual matches also give the reconciliation agent a new example to learn rules from.

Undo a match

DELETE /reconciliation_matches/{id} removes the match. Its records go back to unmatched in that reconciliation and are open to rules and people again.

Matching rules

Write and test one-to-one rules.

Rollup rules

Match batches and payouts with many-to-one rules.

Reconciliations

Sides, runs and adjustments.

API reference

Rule and match endpoints.