Skip to main content
Vendor templates extract structured fields from known vendor layouts using OCR text and regular expressions. When a template matches enough required fields, SnapIt keeps the invoice on Tier 1. Tier 1 uses no LLM tokens, so extraction is free. Template confidence is calculated as:
SnapIt accepts the Tier 1 result when confidence reaches the threshold (default 85). Below the threshold, the invoice escalates to the LLM tiers.

Create and edit templates

1

Create the vendor

Add the supplier under Manage → Vendors if it does not exist yet.
2

Open the Templates page

Go to Manage → Templates. The vendor list shows which vendors already have a saved template and which are missing one.
3

Generate or edit the YAML

Select a vendor and edit the YAML in the editor panel. Click Generate Template to populate the editor with all supported fields and common regex patterns for that vendor.
4

Save

Click Save. New uploads for that vendor can take the Tier 1 path as soon as confidence clears the threshold.

Template structure

A template has two sections: fields for header values and tables.line_items for line-item rows.

Header fields

Each entry under fields names a capture and provides a regex. The first capture group becomes the field value.
  • required: true fields count toward the confidence score. Mark the fields that reliably appear on every invoice from that vendor as required.
  • required: false fields are extracted when present but never lower confidence.

Line-item rules

tables.line_items maps OCR table columns to invoice line fields:
  • header_keywords identifies the line-item table. The extractor looks for a table whose header row contains one of these keywords.
  • columns maps each column by zero-based index to a field name. Set type: number for quantity and amount columns so values are parsed numerically.

Manage templates through the API

Workspace users can also manage templates with a session JWT. These endpoints use the Bearer JWT from login, not a programmatic API key.

Improve accuracy and cost over time

Every invoice stores the tier and provider that produced its data, so you can audit where your extraction spend goes.
  • Watch the Tier Distribution chart on the Dashboard. A high share of Tier 2 or Tier 3 invoices means those vendors are missing templates or their templates match too few required fields.
  • After improving a template, reprocess a past invoice from that vendor (or re-upload a sample) and confirm it now resolves at Tier 1.
  • Anchor regexes to stable labels on the invoice, such as Invoice No or TOTAL, rather than to values that change between invoices.
  • Keep required: true limited to fields that appear on every invoice from the vendor. A required field that only appears sometimes drags confidence below the threshold and forces LLM escalation.