---
name: financial-document-classification
description: Classifies finance documents into controlled AP categories, extracts routing metadata, and flags ambiguous or duplicate evidence for review. Use for invoice intake, credit-note handling, receipt coding, statement registers, payment evidence, and accounts-payable triage.
license: Apache-2.0
metadata:
  adlass.categories: "finance-accounting/invoice-extraction, documents-contracts/classification"
  adlass.industries: ""
  adlass.tags: "financial-documents,ap-triage,invoices,credit-notes,receipts,classification"
  adlass.adaptation: "mapping"
  adlass.source: "n8n:3719, n8n:11290"
  adlass.version: "1"
---

# Financial document classification

## Purpose

Assign each finance document one controlled class and capture the metadata needed for accounts-payable routing. Distinguish invoice, credit note, receipt, supplier statement, payment evidence, purchase-order support, and other finance document types while keeping uncertain classifications and duplicate candidates visible.

## Scope

Use the document text, layouts, titles, totals, tax labels, supplier identifiers, invoice numbers, purchase-order references, payment references, and dates. Validate that the selected class is supported by the document, but do not approve an invoice, post a journal, calculate tax liability, or infer a supplier from an unrelated file name.

**Excluded:** payment execution, accounting entry creation, tax advice, supplier communication, and changing the AP system.

## Data basis

- Finance document corpus and file or document identifiers.
- Classification dictionary with allowed classes, cues, exclusions, and tie-break rules.
- Supplier master, purchase-order register, invoice register, and AP routing policy when in scope.

## Result

Create a classification register with document_id, class, supplier, document_number, issue_date, due_date, total, currency, purchase_order, payment_reference, duplicate_key, route, confidence note, and evidence citation. Include an exceptions section for unknown class, conflicting totals, duplicate candidates, and missing routing fields.

## Quality criteria

- Each file receives exactly one primary class or the status ambiguous.
- A class is backed by at least one cited title, label, field, or structural cue.
- Credit notes are not treated as invoices merely because they contain a payable total.
- Duplicate candidates compare supplier, document number, date, total, and currency without deleting either source.
- Missing PO, supplier, due date, or currency is reported rather than invented.

## Instructions

Apply the classification dictionary in its stated precedence order. Use invoice-number and credit-note markers before generic words such as “bill” or “statement.” A supplier statement remains a statement even when it lists unpaid invoices; a receipt remains a receipt when it shows a tax amount. Do not use file naming conventions as the sole basis for a class. Match records only when the relevant identity fields agree, and label near matches for review. Keep source wording and citations beside every routing decision.

## Adapt before use

- Add the AP class dictionary, routing matrix, supplier fields, and duplicate-key rule.
- Define required metadata and permitted route values for each class.
- Map purchase-order and invoice-register columns to the source tables.
- State the confidence and ambiguity labels used by the finance team.
