# PDF Invoice to JSON Extractor

> Turn PDF invoices into clean, validated JSON: invoice number, dates, vendor, customer, currency, subtotal, tax, total and line items. Totals are re-checked in code and anything missing or unclear is flagged for review, never guessed.

PDF Invoice to JSON Extractor is a paid AI agent skill on Agensi by wolwish, in Finance & Accounting. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $5 (one-time purchase)
- Creator: [wolwish](https://www.agensi.io/creators/wolwish)
- Category: [Finance & Accounting](https://www.agensi.io/skills/finance-accounting)
- Version: 1.0
- Last updated: 2026-11-29
- Security: scan passed (2026-11-29); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/pdf-invoice-to-json-extractor
- Tags: automation, finance, python, json, pdf-extraction, accounting

## About this skill

### What it does

Give your agent one or more PDF invoices and get back structured, validated JSON you can drop straight into a spreadsheet, accounting system or database.

**Fields extracted:** invoice number, invoice date, due date, vendor, customer, currency (ISO code), subtotal, tax, total, and every line item (description, quantity, unit price, amount).

### Why you can trust the output

Most AI extraction tools return whatever the model produced. This skill adds a code-level check on top:

- **No guessing.** If a value isn't clearly on the invoice, it stays `null` and is listed in `missing_fields`.
- **Validated fields.** Dates must be real `YYYY-MM-DD` dates, currency must be a 3-letter code, amounts must be valid non-negative numbers. A bad field is dropped on its own; the rest of the invoice is kept.
- **Maths re-checked.** `subtotal + tax = total`, `quantity × unit price = amount` for every line, line items add up to the subtotal, and the due date isn't before the invoice date.
- **Clear status.** Every result is `complete` or `needs_review`, with plain-English warnings that tell you exactly what to check on the original invoice.

### How it works

1. Gets the text from the PDF (with the Agensi file-to-text tool, or `pypdf` locally).
2. Your agent extracts the fields into a fixed JSON schema.
3. The included Python script validates and cross-checks everything (standard library only, nothing to install).
4. You get the validated JSON, plus a short note on anything that needs a human look.

Works for batches too: process a folder of invoices and get one combined JSON or CSV with a list of the ones needing review.

### Good for

- Bookkeepers and small businesses entering supplier bills
- Automating accounts-payable or expense workflows
- Developers who need reliable invoice data without building their own parser

### Limits

- Scanned invoices with no text layer need OCR first; the skill will tell you instead of inventing data.
- One schema (standard invoice fields). Discounts and shipping are kept as printed and flagged if totals don't match.

## Requires

- Python

## Known limitations

Requires Python 3.9+ for the validation script. Scanned PDFs without text layers require OCR first. Does not support non-ISO date formats if the day/month order is ambiguous.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the PDF Invoice to JSON Extractor skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does the math validation differ from simply asking an AI to summarize an invoice?

Unlike standard LLM prompting, this skill uses a Python-based validation layer to programmatically verify that subtotals and taxes match the final total, preventing the AI from 'hallucinating' or guessing numbers to force a balance.

### Which AI agents or frameworks are compatible with the Invoice Extractor?

This skill is compatible with any AI agent or orchestration framework that supports Python 3.9+ execution and JSON output, making it easy to integrate into existing AP automation workflows.

### Can this skill process scanned images or handwritten invoices?

The extractor requires a text-based PDF to function; if you have scanned images or PDFs without a selectable text layer, you must run them through an OCR tool before passing the text to this skill.

### What exactly is included in the purchase of this skill?

You will receive the complete skill logic, the specific JSON schema for structured output, and the Python validation scripts required to perform the mathematical and data-type integrity checks.

### What happens if the skill detects a mathematical error on the original invoice?

The skill does not silently 'fix' discrepancies; instead, it uses a validation flagging system to mark the JSON output for human review whenever calculations don't balance or mandatory fields are missing.

### Does the skill handle different date formats and currency symbols?

Yes, within limits. Dates are converted to YYYY-MM-DD and currencies to 3-letter ISO codes (USD, GBP, EUR, PKR...). If a date's day/month order is ambiguous (e.g. 02/11/2026 with no other clue) or a symbol like "$" could mean several currencies, the field is left empty and flagged for review instead of guessed.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
