Upload an invoice, purchase order, or credit note (PDF or image) and get back structured data: line items, totals, payment terms, and dates. The output follows a strict schema so it can feed directly into your ERP, accounting system, or reconciliation workflow.
Inputs
| Field | Type | Details |
|---|---|---|
| Document | File | PDF or image (JPG, PNG) of the invoice, PO, or credit note |
| Document Type | Dropdown | Invoice / Purchase Order / Credit Note |
Output schema
Header
| Field | Format | Notes |
|---|---|---|
| Document Number | Text | Invoice number, PO number, or credit note number |
| Document Date | YYYY-MM-DD | The date printed on the document |
| Vendor Name | Text | The company issuing the document |
| Vendor Address | Text | Full address as shown |
| Vendor Tax ID | Text (optional) | EIN, VAT number, GST number if present |
| Buyer Name | Text | The company receiving the goods/services |
| Buyer Address | Text | Full address as shown |
| Buyer Tax ID | Text (optional) | If present |
| Currency | ISO 4217 code | e.g., USD, EUR, GBP |
| Purchase Order Reference | Text (optional) | PO number referenced on an invoice, if present |
Line items
Each line item contains:
| Field | Format | Notes |
|---|---|---|
| Line Number | Integer | Sequential, starting at 1 |
| Description | Text | Product or service description |
| Quantity | Decimal | Number of units |
| Unit | Text (optional) | e.g., "hours," "units," "licenses" |
| Unit Price | Decimal | Price per unit before tax |
| Tax Rate | Percentage (optional) | Tax rate applied to this line, if shown |
| Tax Amount | Decimal (optional) | Tax for this line item |
| Line Total | Decimal | Quantity x Unit Price (pre-tax) |
Totals
| Field | Format | Notes |
|---|---|---|
| Subtotal | Decimal | Sum of all line totals |
| Tax Total | Decimal | Total tax across all line items |
| Shipping / Handling | Decimal (optional) | If present |
| Discount | Decimal (optional) | If present, shown as a positive number |
| Total Due | Decimal | Final amount owed |
Payment terms
| Field | Format | Notes |
|---|---|---|
| Due Date | YYYY-MM-DD | When payment is due |
| Payment Terms | Text | e.g., "Net 30," "Due on receipt," "2/10 Net 30" |
| Payment Method | Text (optional) | e.g., "Wire transfer," "ACH," "Check" |
| Bank Details | Text (optional) | Account number, routing number, IBAN if provided |
| Early Payment Discount | Text (optional) | e.g., "2% if paid within 10 days" |
Validation rules
These checks run automatically against the extracted data:
-
Line items must sum to subtotal. If the sum of all Line Total values doesn't equal Subtotal (within a $0.02 rounding tolerance), flag the discrepancy in a
validation_warningsfield. -
Tax calculation check. If individual tax rates are present, verify that each line's Tax Amount equals Line Total x Tax Rate (within rounding tolerance).
-
Total Due check. Verify that Subtotal + Tax Total + Shipping - Discount = Total Due. Flag any mismatch.
-
Date sanity. Due Date should be on or after Document Date. If it's before, flag it.
-
Currency consistency. All monetary values should be in the same currency. If mixed currencies appear, flag it.
Handling poor-quality documents
-
If the document is a scanned image with low resolution, extract what you can and set a
confidencefield tolowon any values you're uncertain about. -
If a field is completely unreadable, set its value to
nulland add a note inextraction_notesexplaining what couldn't be read. -
If the document contains handwritten annotations or corrections, extract the corrected value and note the original in
extraction_notes.
Edge cases
-
Multi-page documents: extract data across all pages. Line items often span pages.
-
Documents with no line items (e.g., a flat-fee invoice with just a total): create a single line item with the description and total.
-
Credit notes: amounts should still be expressed as positive numbers, but the Document Type field distinguishes this from an invoice.
-
Multiple tax rates: handle per-line-item tax rates. If different lines have different rates, capture each rate individually.
-
Foreign currency with conversion: if the document shows both original and converted currency amounts, extract both and note which is primary.

