Payment matchingAIENCS

How decisions are made

Every payment goes through the same steps. A wrong match is worse than no match, so anything uncertain ends with a person.

The steps

  1. Bank statementPayer, variable symbol (VS) and message are written by the payer: untrusted text, never instructions.
  2. RulesPorted from the legacy system. They settle exact matches and say why when they cannot (the codes below).
  3. AI modelOnly for payments the rules could not settle. It reads the text and proposes invoices from a list code prepared; a small model first, a larger one only when that can change the outcome.
  4. Validation by codeThe invoice exists and is open, it belongs to one customer, the amount fits, the payment names it, nothing else fits as well, no instructions in the text.
  5. YouConfirm, reject or match by hand what is uncertain, and undo an AI match that is wrong.

Who decided

rule FIELD/EXACT
A rule matched it (the code says which, see below).
haiku-5-5
The AI model decided it, after the rules could not; code checked its answer.
policy
Decided by policy without a model, e.g. instructions to an AI in the text, or no invoice of the customer at all.
you
You decided it.
agent:mcp
An AI agent proposed it through the MCP server; only a person can confirm it.

Confidence is the model's own estimate from 0 to 1. Only answers of at least 0.90 that pass every check are matched without you.

Rule codes

The first part says where the reference was found: FIELD = the VS field, MSG = the message, - = nowhere. The second says what happened.

CodeMeaning
FIELD/EXACTExact match: the variable symbol in the VS field names the invoice and the amount fits.
MSG/EXACTExact match: the invoice number or VS was found in the message and the amount fits.
FIELD/PARTIALPartial payment: the VS names the invoice, but less was paid than invoiced.
FIELD/ADV_OVERPAYAdvance invoice paid with more than invoiced.
FIELD/OVERPAIDMore was paid than invoiced (not an advance invoice).
MSG/OVERPAIDInvoice found in the message, but more was paid than invoiced.
MSG/ADV_OVERPAYAdvance invoice found in the message, paid with more than invoiced.
MSG/AMOUNTInvoice found in the message, but less was paid than invoiced (a partial payment counts only with the VS in the VS field).
FIELD/NOT_FOUNDThe VS field names no existing invoice.
MSG/NOT_FOUNDThe message names an invoice that does not exist.
FIELD/DUPLICATEThe invoice named in the VS field is already paid.
MSG/DUPLICATEThe invoice named in the message is already paid.
-/NO_VSNo variable symbol and no invoice number: the rules cannot tell which invoice.
-/CURRENCYA currency the rules do not handle.
-/INVALID_AMOUNTThe amount is missing or not valid.
-/BANK_OWNThe bank's own entry (fees, interest): not a customer payment.