Skip to main content
Apragya AIFree quotation builderQuotation builderQuote builderno signup
How-to guide

How to Create Extraction Templates in an ERP: Teach the System What Each Document Holds

For accounts, operations and back-office teams who read the same kinds of documents every day: tell the system what to capture, and decide when a person must check it.

An accountant sorting parts of an invoice into a divided wooden tray

If you are learning how to create extraction templates, you have probably seen AI read a document well once and then miss the field you needed most on the next. The fix is not a better guess. It is a clear definition of what each type of document should yield.

Without that definition, a purchase invoice gives you whatever the reader thinks is important. The e-way bill number is sometimes captured and sometimes not, dates arrive in three formats, and nobody knows which low-confidence fields should stop for a person.

This guide explains what a template contains, follows an illustrative set-up at a Surat textile trader, and shows how Apragya's document processing app uses templates.

How to create extraction templates, step by step

An extraction template tells a document reader what a particular type of document should contain. It lists the fields, their data types and which are required, and it can carry hints that help the system recognise the type, such as words that usually appear on it.

The second half of a template is trust. Every extracted value comes with a confidence score. A threshold decides when a value is accepted and when a person confirms it. Set stricter thresholds on fields where a mistake is costly, such as GSTIN, invoice total or bank account.

Finally, attach checks. Tax plus taxable value should equal the total; dates should not be in the future. Checks catch confident readings that are still wrong.

  1. Choose one document type and gather a few recent samples.
  2. List the header and line fields you need, with types.
  3. Mark which fields are required.
  4. Add classification hints and an example extraction.
  5. Set a global confidence threshold and stricter field thresholds.
  6. Attach validation rules for totals and dates.
  7. Review accuracy after a few weeks and adjust.

What reading documents without a template costs

Missing fields

The one field your process needs is captured on some documents only.

Inconsistent output

The same field arrives under different names and formats.

Everything reviewed

With no thresholds, every document goes to a person to be safe.

Unchecked figures

Totals are taken on trust because no rule compares them.

An example: a Surat textile trader's purchase invoices

Take an illustrative fabric trader in Surat receiving about 600 purchase invoices a month from mills and job workers. The accounts team needed the same fields from every one, and wanted a person to check only the uncertain ones.

The template the team settled on

Template: purchase invoice

  1. The type this template applies to.

  2. Plus taxable value, tax and total.

  3. Captured for every line item.

  4. Words that mark this document type.

  5. Below this, the document goes to review.

  6. Higher thresholds where errors cost most.

Stricter thresholds sit only on the fields where a wrong value would be expensive.

In the first month, most invoices passed straight through. The ones that stopped were mainly faded scans and handwritten job work bills, where the GSTIN or total fell below its stricter threshold. The team reviewed those, and the template's accuracy figure gave them a way to track improvement.

Ribboned sheets in a tray with faded crumpled sheets set apart under a magnifying glass
Most invoices passed straight through; the faded scans were the ones held back for a person.

How to build a document extraction schema in Apragya

Step 1 of 6

Name the document type

One template per type, such as purchase invoice or delivery challan.

  1. Name the document type: One template per type, such as purchase invoice or delivery challan.
  2. List the fields: Each field has a name, a type and whether it is required.
  3. Or discover them: Paste a sample document's text and AI proposes a schema to edit.
  4. Add hints and examples: Keywords that identify the type, and example extractions to guide reading.
  5. Set thresholds: A global confidence level, with stricter ones for costly fields.
  6. Attach checks: Validation rules that compare fields, such as tax against total.

An OCR template for invoices, compared with a schema template

Older OCR tools use position templates: draw boxes on one supplier's layout and hope it never changes. A schema template describes what the document means, not where things sit, so one template can serve many suppliers. Thresholds then decide which readings a person should confirm.

Template approaches, compared with Apragya

FeaturePosition-based OCR templateApragya extraction template
Defined byBoxes on one layoutFields a document type should hold
New supplier layoutA new templateUsually the same template
Uncertain valuesTaken as readSent to review below the threshold
Figure checksSeparate stepRules attached to the template
PerformanceNot measuredDocuments processed and average accuracy

Checked against public information on 16 September 2026.

What sets Apragya's invoice data extraction template apart

AI discovery

A starting schema from one sample, for a person to refine.

Human review

Low-confidence fields stop for an operator.

Versioned

Each template carries a version and can be switched off.

Measured

Usage and average accuracy recorded on the template.

PII masking

Sensitive values can be masked in what people see.

Metered use

AI Credits for reading are counted per company.

Templates guide document extraction, work with validation rules, and their effect shows in the analytics described in how to create IDP analytics. See the extraction templates feature.

Creating your first template

  1. Pick the document type you receive most often.
  2. Write down the fields your process actually uses.
  3. Start from an AI-discovered schema, then trim it.
  4. Set a global threshold and stricter ones for tax and totals.
  5. Watch the review queue for two weeks and adjust.

A short template with the right required fields beats a long one that captures everything.

What it costs to start

INR 7,999
Pro, a month
Up to 25 users, with Intelligent Document Processing and every enterprise app
5,000
AI Credits a month
Included on Pro
Free
Up to 3 users
CRM and HR, to try the platform first

Creating extraction templates, answered

Do we need a template for every supplier?
No. A template describes a document type, so one purchase invoice template can serve many suppliers.
Can documents be read without a template?
Yes. Documents can be read automatically. A template makes the output consistent and sets review thresholds.
What does the confidence threshold do?
Fields read with confidence below the threshold are sent to a person to confirm.
Does a template check whether the figures add up?
Only through the validation rules you attach. The fields describe what to capture; rules check it.
What does it cost to start?
Intelligent Document Processing comes with the Pro plan, INR 7,999 a month for up to 25 users, which includes every enterprise app, 5,000 AI Credits a month, single sign-on and audit logs. The free plan covers up to 3 users with CRM, HR and Vendor Onboarding if you want to try the platform first.

Define what your documents should yield

Create one template for your busiest document type and let review focus on the uncertain fields.