FinancialParse → Extract

Invoice

Extracts vendor details, line items, quantities, tax, and totals from invoices across any layout.

Ship it with Extend

Live pipeline

a real document, processed end to end · view only
Source documentnorthwind-invoice-5582.pdf

Step-by-step

Invoice is a document that contains vendor details, line items, quantities, tax, and totals from invoices across any layout. This template takes in Invoice and outputs markdown (.md) capturing the document's full text, tables, and layout, and JSON (.json) with structured fields per the extraction schema by using Extend's Parse, Extract primitives.

Input
Invoice
Compatible document types (full list)
.pdf.docx.xlsx.png.jpg.jpeg.tiff.tif.svg.heic.heif.bmp.gif.webp.psd.xls.xltm.xltx.ods.doc.wpd.dotx.odt.pptx.ppt.ppm.csv.txt.html.xml.rtf.lis.md.eml.pcx
Step 1

Parse

Converts the document into clean, layout-aware markdown plus structured blocks with spatial metadata.

InputSource document — PDF, image, spreadsheet, presentation, or scan
Config
blockOptions.text.agentic.enabledtruechanged
chunkingStrategy.type"document"
engine"parse_performance"
OutputMarkdown chunked by page or section, plus typed blocks (text, table, figure) with bounding boxes

You can learn more about Parse configuration in Extend's Parse documentation.

Step 2

Extract

Pulls a defined set of fields from the document and returns them as structured JSON matching a schema.

InputOutput of the Parse step
Config
schemacustom schema — 8 fieldschanged
advancedOptions.advancedMultimodalEnabledtruechanged
advancedOptions.reviewAgent.enabledtruechanged
baseProcessor"extraction_performance"
OutputJSON shaped to the extraction schema, with per-field confidence scores and citations grounding each value to its source location

You can learn more about Extract configuration in Extend's Extract documentation.

Example code

{
  "name": "Invoice Processing Pipeline",
  "steps": [
    {
      "name": "startTrigger1",
      "type": "TRIGGER",
      "next": [
        {
          "step": "parse1"
        }
      ]
    },
    {
      "name": "parse1",
      "type": "PARSE",
      "config": {
        "parseConfig": {
          "blockOptions": {
            "text": {
              "agentic": {
                "enabled": true
              }
            }
          },
          "chunkingStrategy": {
            "type": "document"
          }
        }
      },
      "next": [
        {
          "step": "extraction2"
        }
      ]
    },
    {
      "name": "extraction2",
      "type": "EXTRACT",
      "config": {
        "extractorConfig": {
          "schema": {
            "type": "object",
            "properties": {
              "vendor_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "vendor name"
              },
              "invoice_number": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "invoice number"
              },
              "invoice_date": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "invoice date"
              },
              "bill_to": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "bill to"
              },
              "subtotal": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "subtotal"
              },
              "tax": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "tax"
              },
              "total_due": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "total due"
              },
              "currency": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "currency"
              }
            }
          },
          "baseProcessor": "extraction_performance",
          "advancedOptions": {
            "reviewAgent": {
              "enabled": true
            },
            "advancedMultimodalEnabled": true
          }
        }
      }
    }
  ]
}
# Invoice — Extend AI Skill

## Overview
Parses invoices to clean markdown and extracts vendor, bill-to, line items, subtotal, tax, and total due — robust to varied vendor layouts and formats.

## Pipeline
Parse → Extract

## Extraction Schema
| Field | Type | Description |
|-------|------|-------------|
| vendor_name | string\|null | vendor name |
| invoice_number | string\|null | invoice number |
| invoice_date | string\|null | invoice date |
| bill_to | string\|null | bill to |
| subtotal | number\|null | subtotal |
| tax | number\|null | tax |
| total_due | number\|null | total due |
| currency | string\|null | currency |

## Tips
- Enable agentic OCR for scanned or low-quality source documents.
- Turn on the review agent for high-value or compliance-sensitive fields.
import Extend from "extend-ai";

const client = new Extend({ apiKey: process.env.EXTEND_API_KEY! });

interface invoiceResult {
  vendor_name: string | null;
  invoice_number: string | null;
  invoice_date: string | null;
  bill_to: string | null;
  subtotal: number | null;
  tax: number | null;
  total_due: number | null;
  currency: string | null;
}

export async function processInvoice(fileUrl: string): Promise<invoiceResult> {
  const { markdown } = await client.parse(fileUrl, {
    engine: "parse_performance",
    blockOptions: { text: { agentic: { enabled: true } } },
  });

  const { output } = await client.extract(markdown, {
    baseProcessor: "extraction_performance",
    schema: {
      "type": "object",
      "properties": {
        "vendor_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "vendor name"
        },
        "invoice_number": {
          "type": [
            "string",
            "null"
          ],
          "description": "invoice number"
        },
        "invoice_date": {
          "type": [
            "string",
            "null"
          ],
          "description": "invoice date"
        },
        "bill_to": {
          "type": [
            "string",
            "null"
          ],
          "description": "bill to"
        },
        "subtotal": {
          "type": [
            "number",
            "null"
          ],
          "description": "subtotal"
        },
        "tax": {
          "type": [
            "number",
            "null"
          ],
          "description": "tax"
        },
        "total_due": {
          "type": [
            "number",
            "null"
          ],
          "description": "total due"
        },
        "currency": {
          "type": [
            "string",
            "null"
          ],
          "description": "currency"
        }
      }
    },
    advancedOptions: { reviewAgent: { enabled: true }, advancedMultimodalEnabled: true },
  });

  return output as invoiceResult;
}

A Pythonsnippet hasn't been generated for this template yet.

A Javasnippet hasn't been generated for this template yet.

A Gosnippet hasn't been generated for this template yet.

A TypeScriptprovisioning example hasn't been generated for this template yet.

A Pythonprovisioning example hasn't been generated for this template yet.

A Javaprovisioning example hasn't been generated for this template yet.

A Goprovisioning example hasn't been generated for this template yet.

Frequently Asked Questions (FAQ)

Tables that span page breaks tend to lose their headers. Keep header-continuation on and use the Performance parse engine so rows stay aligned across pages.
Form-heavy and multi-column pages confuse naive readers. The layout model routes each region to a specialized parser so structure is preserved.
Turn on the review agent. It validates every extracted field with a confidence score and routes low-confidence values to human review before they reach your system.
Tags
FinancialAPFinanceParseExtractLine items
About this template

Parses invoices to clean markdown and extracts vendor, bill-to, line items, subtotal, tax, and total due — robust to varied vendor layouts and formats.

Document formats
  • PDF
  • Images & Scans
  • Excel / CSV
Requirements
  • Long tables
  • Complex layouts