Invoice Line Matching

Supplier invoice lines matched to the catalog SKU they refer to: _predict of sku across the link to products returns a ranked shortlist with reasons, scored live against held-out truth.

Invoice Line Matching: screenshot from the ERP demo
📋 ERP_predict_searchERPAccounting
Production anchorThe ERP demo's Invoice Matching on the Retail profile: each line gets a ranked SKU shortlist with reasons, marked right or wrong against held-out truth, with new suppliers flagged as cold. Measured on 2,000 held-out lines against 3,200 catalogue SKUs: 89.2% top-1 and 97.1% top-5 (Aito 2.11.2).

The problem

Supplier invoices describe items in the supplier's words, not the buyer's catalog codes. Before a line can be matched to a PO or posted to inventory, someone maps it to a SKU, and with thousands of SKUs that mapping is a daily chore.

How it works

The invoice line's fields, including its vendor, go into the where clause and _predict of sku follows the link from invoice lines to the product catalog. The answer is a ranked shortlist with the reasons behind each candidate, so a reviewer confirms the right SKU instead of searching for it.

The demo runs a live batch against held-out lines and marks each prediction right or wrong, so the accuracy on view is measured, not claimed. Lines from suppliers with no history are flagged as cold.

{
  "from": "invoice_lines",
  "where": {
    "description": "Tikkurila Cush 45cm Blac Pro kouvola",
    "billing_supplier": "Frontier Goods Ltd",
    "unit_of_measure": "ea",
    "unit_price_eur": 37.19,
    "quantity": 2,
    "billing_supplier.city": "Helsinki",
    "billing_supplier.position": "importer",
    "billing_supplier.sells_origin": "Tallinn",
    "billing_supplier.sells_grade": "budget"
  },
  "predict": "sku",
  "select": [
    "$p",
    "$value",
    {
      "$why": {
        "highlight": {
          "posPreTag": "«",
          "posPostTag": "»"
        }
      }
    },
    "name",
    "category",
    "supplier",
    "unit_price",
    "unit_of_measure"
  ],
  "limit": 5,
  "config": {
    "ai": "and"
  },
  "basedOn": [
    "name",
    "supplier"
  ]
}

For the full architecture, see the technology overview. For the broader narrative across multiple use cases, read The Predictive Application.

See it live

This use case runs in the 📋 ERP demo today. Click through to the live application and inspect the queries that produce the result.

Open the live demo →