Diagnose the alert before adding AI

If an export already contains a stable supplier ID and invoice number, start with deterministic comparison. AI is not needed to discover that two normalized keys are identical. It becomes useful only when a human-readable explanation or a bounded near-match review is required.

Oracle's current duplicate-invoice documentation describes checks that combine supplier, invoice type, amount, currency, and date instead of relying on the invoice number alone. Microsoft's vendor invoice workflow documentation treats a duplicate number as an alert that a user can correct and resubmit. Neither mechanism turns a matching field into proof of fraud.

Build two different detection lanes

Original diagram showing deterministic exact duplicate detection and document-review near-match triage as separate lanes
Exact keys and ambiguous supplier-alias review solve different problems. Only the second lane benefits from bounded AI explanation. Credit: Grow AI Skills editorial verification diagram. Open full-size image.

Lane 1: deterministic exact candidates

Construct a key from the fields your accounting policy allows. In the synthetic exercise the exact rule is:

case_normalized_supplier
+ invoice_type
+ currency
+ signed_amount
+ invoice_date
+ punctuation_normalized_invoice_number

The sign belongs in the key. A USD 1,250 standard invoice and a USD -1,250 credit memo are not interchangeable. Keep the original strings beside every normalized value so a reviewer can see what changed.

Lane 2: possible duplicates

A near-match is a question, not a verdict. For example, Acme Ltd and ACME LIMITED may refer to the same supplier, but case normalization alone does not prove that “Ltd” and “Limited” are an approved alias. The record should name the unresolved field and route both source documents to an authorized reviewer.

The eight-row fixture contains four traps

RowsObserved relationshipExpected treatment
A001 ↔ A002Same invoice facts after number normalization; supplier alias unverifiedPossible duplicate
A006 ↔ A007All permitted exact-key fields agreeExact candidate
A004Credit memo with a negative signed amountProtected non-candidate
A005Different supplier, despite matching number, amount, and dateProtected non-candidate
A003, A008Same-amount invoices with different numbers and datesProtected non-candidates

Download the duplicate-invoice review register to inspect or adapt all six resulting records. The candidate rows include matching and unresolved fields; the non-candidate rows retain the reason they were protected.

What happened in the answer-blind run

The Temporary Chat prompt defined the classification policy, provided all eight source rows, and required JSON. It did not name either candidate pair.

The model returned INV-A006 ↔ INV-A007 as EXACT_DUPLICATE and INV-A001 ↔ INV-A002 as POSSIBLE_DUPLICATE. It kept the credit memo, different supplier, and two different-number invoices outside the candidate pairs. The offline gate compared unordered pair identities and classifications, checked all eight source IDs, and required HUMAN_REVIEW_REQUIRED.

Near-match portion of the blind contract

POSSIBLE_DUPLICATE may be used only when invoice fields align
but supplier identity or OCR normalization still needs review.
Compare every row; include each pair once.
Do not infer fraud or take a payment action.
Return the matching fields and unresolved fields separately.

The test result is narrower than “AI detects duplicates”

The accepted output proves that this one run handled the eight-row fixture. It does not measure false-positive or false-negative rates on a real AP population. Three post-run mutations were then rejected: promoting the unresolved supplier pair to exact, deleting the Pine Works exact pair, and adding the credit memo as a candidate. Those are checker tests, not additional model trials.

The complete blind-test reproduction pack contains the prompt, retained JSON, CSV, screenshot, validator, test report, and file hashes. Run the Python gate after extraction, then read the pair reasons; a passing summary cannot replace document review.

Investigate a candidate with source documents

  1. Verify that both rows belong to the same legal supplier and payable entity.
  2. Compare invoice images, purchase references, goods or services, tax, and remittance details.
  3. Check whether either item is a correction, reversal, recurring charge, installment, or credit.
  4. Inspect posting, approval, payment, and void history in the authoritative system.
  5. Record the disposition, reviewer, evidence references, and date.
  6. Apply any payment control only through the approved AP process.

Common failure patterns

FailureWhy it is dangerousControl
Absolute-value matchingTurns credits into invoice duplicatesPreserve signed amount and document type
Global supplier-name fuzzingCan merge unrelated legal entitiesUse verified supplier aliases or stable IDs
One composite confidence scoreHides which evidence is weakList matching and unresolved fields
AI-triggered payment holdMoves an uncertain classification into a consequential actionSeparate review output from payment controls

Where the exception goes next

If a payment appears twice on the bank side, reconcile the relevant period with the bank statement and cash ledger workflow. If the question is whether purchase order, receipt, and invoice agree, use the three-way match process. For scanned expense evidence rather than supplier invoices, use the receipt extraction and verification workflow.

Completion rule

The candidate register is ready for AP review when the source population is accounted for, exact rules are deterministic, possible matches expose their uncertainty, protected rows remain visible, and no operational payment state has changed. A pair becomes a confirmed duplicate only after the responsible reviewer resolves the underlying obligation from authoritative records.