Document Processing
Smart Invoice Extraction
Posted May 24, 2026
Extract structured invoice data from PDFs, images, and scans into clean JSON for ERP and accounting workflows.
Smart Invoice Extraction performs OCR and intelligent parsing on uploaded invoice documents. It extracts vendor details, line items, totals, and dates, then normalizes currency and numeric formats. The skill validates extracted totals against itemized charges and returns structured JSON with confidence scores for downstream integration into accounting, ERP, or analytics platforms.
What it does
6 actions, each one checked against your rules and recorded before it runs.
extract_text
Perform OCR or text extraction on scanned and native PDF invoices
identify_fields
Detect and extract invoice metadata including vendor, dates, and document number
parse_table
Extract line item tables with description, quantity, unit price, and totals
normalize_data
Standardize date formats, currency symbols, and numeric representations
validate_totals
Cross-check extracted totals against sum of line items and flag inconsistencies
generate_output
Return structured JSON with extracted fields and confidence scores
How it runs
Every run follows the same governed path, from request to recorded result.
- 1
User uploads invoice document via file input
- 2
Skill detects document type and performs OCR if scanned
- 3
Key invoice fields are extracted using pattern matching and LLM reasoning
- 4
Line items are parsed from tabular data structures
- 5
Currency, dates, and amounts are normalized to standard formats
- 6
Extracted totals are validated against itemized line sums
- 7
Structured JSON output is returned with confidence scores and warnings
Governance & audit
What gets captured and verified on every single run.
Document Access Logging
Every invoice upload and extraction event is logged with timestamp, user ID, and file hash
Financial Data Retention
Extracted invoice data is retained for 365 days per evidence policy; original files are not stored unless explicitly configured
PII and Payment Data Handling
Vendor names, account numbers, and payment terms are flagged as sensitive and encrypted in transit and at rest
Extraction Confidence Tracking
Confidence scores below 0.7 trigger manual review flags and are logged for quality auditing
Compliance Enforcement
All processing adheres to GDPR, data encryption standards, and configurable data residency policies
Example in action
Automating Accounts Payable Invoice Ingestion
- 1
Invoice Receipt. Finance team receives vendor invoice via email or upload portal and submits PDF to the skill
- 2
Extraction and Parsing. Skill performs OCR, extracts vendor name, invoice number, dates, tax amounts, and line items
- 3
Validation and Normalization. Dates are standardized, currency is normalized to company default, and line item totals are validated against grand total
- 4
ERP Integration. Structured JSON output is pushed to SAP or Oracle ERP system for approval workflow and payment scheduling
- 5
Audit Trail. Extraction logs, confidence scores, and validation warnings are stored for compliance and future reconciliation
Skill manifest
The exact instructions this skill ships with, shown in full. Nothing hidden.
---
id: smart-invoice-extraction
version: 0.1.0
display_name: Smart Invoice Extraction
pack: Document Processing
category: finance
risk_tier: high
tags: ['invoice', 'ocr', 'document-extraction', 'accounts-payable', 'erp-integration', 'financial-data']
input_schema:
type: object
required: [file]
properties:
file:
type: string
description: Invoice document in PDF, JPG, or PNG format (base64 encoded or file reference).
language:
type: string
description: Language code of the invoice for OCR optimization (e.g., en, es, fr); auto-detect if omitted.
currency:
type: string
description: Expected currency format (e.g., USD, EUR, PKR) to guide normalization.
output_schema:
type: object
required: [invoice_number, vendor_name, invoice_date, total_amount, line_items, confidence_score]
properties:
invoice_number:
type: string
description: Extracted invoice or document identifier.
vendor_name:
type: string
description: Supplier or issuing company name.
invoice_date:
type: string
description: Date the invoice was issued (ISO 8601 format).
due_date:
type: string
description: Payment due date (ISO 8601 format); may be null if not present.
total_amount:
type: number
description: Final payable amount including taxes and fees.
tax_amount:
type: number
description: Total tax amount; null if not separately itemized.
line_items:
type: array
description: List of invoice line items with itemized charges.
items:
type: object
properties:
description:
type: string
quantity:
type: number
unit_price:
type: number
total_price:
type: number
confidence_score:
type: number
description: Overall extraction confidence between 0 and 1.
warnings:
type: array
description: List of validation warnings or missing field indicators.
items:
type: string
planner:
mode: dynamic
prompt_section: "How to think about this task"
max_steps: 25
max_duration_sec: 600
max_cost_usd: 0.4
model_tier: balanced
allowed_step_kinds: [tool_call, llm_call, output]
evidence:
required_types: ['log', 'audit']
capture_per_step: true
retention_days: 365
routing:
intent_examples:
- "Extract data from this invoice PDF"
- "Parse vendor name and line items from uploaded invoice"
- "Process this scanned invoice and return JSON"
- "Pull invoice number, total, and due date from this document"
not_for:
- "Generate a new invoice"
- "Translate invoice text to another language without extraction"
verifier_rules:
- "The extracted total_amount must equal the sum of all line_item total_price values within a 1% tolerance or a warning must be raised."
- "All required output fields (invoice_number, vendor_name, invoice_date, total_amount, line_items, confidence_score) must be present and non-null."
- "If confidence_score is below 0.7, the warnings array must include a low confidence flag."
---
## Overview
Smart Invoice Extraction automates the ingestion of invoice documents by extracting structured fields, line items, and financial totals. It handles PDFs, images, and scanned documents using OCR and intelligent parsing. The skill normalizes dates and currency, validates arithmetic consistency, and returns clean JSON suitable for ERP systems, accounting software, and financial analytics pipelines.
## How to think about this task
Invoice extraction is a multi-stage document understanding problem. First, determine whether the input is a native digital PDF or a scanned image requiring OCR. Next, locate key metadata fields (vendor, invoice number, dates, totals) using layout analysis and pattern matching. Tabular line items require table detection and row parsing. After extraction, normalize all dates to ISO 8601, convert currency strings to numeric values, and validate that line item totals sum to the grand total. If discrepancies or missing fields are detected, populate the warnings array and adjust the confidence score accordingly. Always prioritize accuracy over speed, especially for financial amounts, and flag low-confidence extractions for human review.
## Capabilities
- Perform OCR or text extraction on scanned and native PDF invoices
- Detect and extract invoice metadata including vendor, dates, and document number
- Extract line item tables with description, quantity, unit price, and totals
- Standardize date formats, currency symbols, and numeric representations
- Cross-check extracted totals against sum of line items and flag inconsistencies
- Return structured JSON with extracted fields and confidence scores
## Inputs
**file** (required): The invoice document to process. Accepted formats are PDF, JPG, and PNG. The input may be a base64-encoded string, a file path, or a reference to cloud storage. Scanned or photographed invoices will trigger OCR processing.
**language** (optional): A two-letter ISO language code (e.g., en, es, de, fr) to optimize OCR and text extraction. If omitted, the skill will attempt to auto-detect the document language.
**currency** (optional): The expected currency code (e.g., USD, EUR, GBP, PKR) to guide normalization of monetary values. If provided, the skill will prioritize this currency during parsing and flag mismatches.
## Outputs
**invoice_number**: The unique identifier or document number assigned by the vendor. If multiple candidates are found, the skill selects the most prominent.
**vendor_name**: The name of the supplier or issuing company as it appears on the invoice.
**invoice_date**: The date the invoice was issued, returned in ISO 8601 format (YYYY-MM-DD).
**due_date**: The payment due date in ISO 8601 format. May be null if the invoice does not specify a due date.
**total_amount**: The final payable amount, including taxes, fees, and discounts. Returned as a numeric value.
**tax_amount**: The total tax or VAT amount, if separately itemized. Null if tax is not broken out.
**line_items**: An array of itemized charges. Each object contains description (string), quantity (number), unit_price (number), and total_price (number).
**confidence_score**: A numeric value between 0 and 1 representing the overall extraction confidence. Scores below 0.7 indicate low confidence and trigger warnings.
**warnings**: An array of strings describing validation issues, missing fields, or low-confidence extractions. Empty if no issues are detected.
## Tools
- **connectors**: Google Drive, Dropbox, Slack, SAP ERP, Oracle ERP
- **operators**: OCR Engine, Table Parser, Date Normalizer, Currency Converter, Arithmetic Validator
- **primitives**: File Reader, Text Extractor, Pattern Matcher, JSON Serializer
## Guardrails
- Document Access Logging: Every invoice upload and extraction event is logged with timestamp, user ID, and file hash
- Financial Data Retention: Extracted invoice data is retained for 365 days per evidence policy; original files are not stored unless explicitly configured
- PII and Payment Data Handling: Vendor names, account numbers, and payment terms are flagged as sensitive and encrypted in transit and at rest
- Extraction Confidence Tracking: Confidence scores below 0.7 trigger manual review flags and are logged for quality auditing
- Compliance Enforcement: All processing adheres to GDPR, data encryption standards, and configurable data residency policies
## Examples
### Example: Automating Accounts Payable Invoice Ingestion
**Input:**
```json
{
"file": "base64_encoded_pdf_string_here",
"language": "en",
"currency": "USD"
}
```
**Processing:**
1. Skill detects the document is a scanned PDF and performs OCR.
2. Extracts vendor name "Acme Office Supplies", invoice number "INV-2024-00123", invoice date "2024-01-15", and due date "2024-02-15".
3. Parses line items table:
- "Copy Paper (Box of 10)" | qty: 5 | unit: $12.00 | total: $60.00
- "Stapler" | qty: 2 | unit: $8.50 | total: $17.00
4. Extracts total amount $81.27 and tax amount $4.27.
5. Validates: $60.00 + $17.00 = $77.00; $77.00 + $4.27 = $81.27 ✓
6. Returns structured JSON with confidence_score: 0.94 and no warnings.
**Output:**
```json
{
"invoice_number": "INV-2024-00123",
"vendor_name": "Acme Office Supplies",
"invoice_date": "2024-01-15",
"due_date": "2024-02-15",
"total_amount": 81.27,
"tax_amount": 4.27,
"line_items": [
{
"description": "Copy Paper (Box of 10)",
"quantity": 5,
"unit_price": 12.00,
"total_price": 60.00
},
{
"description": "Stapler",
"quantity": 2,
"unit_price": 8.50,
"total_price": 17.00
}
],
"confidence_score": 0.94,
"warnings": []
}
```Reviews
Reviews from teams using Smart Invoice Extraction.
No reviews yet
Be the first to share how Smart Invoice Extraction works for your team.
Discussion(0)
No comments yet. Be the first.