Prompt
invoice OCR structured JSON
Latest observation
Oct 2, 2026
OpenAI APIWeb search: off
Here’s a practical structured JSON schema for invoice OCR output. You can use it as a target format for an OCR/parsing pipeline.
{
"document_type": "invoice",
"confidence": 0.0,
"source_file": "",
"language": "",
"page_count": 0,
"invoice": {
"invoice_number": "",
"invoice_date": "",
"due_date": "",
"purchase_order_number": "",
"currency": "",
"payment_terms": "",
"status": ""
},
"seller": {
"name": "",
"tax_id": "",
"vat_id": "",
"address": {
"line1": "",
"line2": "",
"city": "",
"state": "",
"postal_code": "",
"country": ""
},
"phone": "",
"email": "",
"website": ""
},
"buyer": {
"name": "",
"tax_id": "",
"vat_id": "",
"address": {
"line1": "",
"line2": "",
"city": "",
"state": "",
"postal_code": "",
"country": ""
}
},
"shipping": {
"name": "",
"address": {
"line1": "",
"line2": "",
"city": "",
"state": "",
"postal_code": "",
"country": ""
},
"method": "",
"tracking_number": ""
},
"line_items": [
{
"line_number": 1,
"description": "",
"quantity": 0,
"unit_of_measure": "",
"unit_price": 0.0,
"discount": 0.0,
"tax_rate": 0.0,
"tax_amount": 0.0,
"line_total": 0.0
}
],
"summary": {
"subtotal": 0.0,
"discount_total": 0.0,
"tax_total": 0.0,
"shipping_total": 0.0,
"other_charges": 0.0,
"grand_total": 0.0,
"amount_paid": 0.0,
"amount_due": 0.0
},
"payment": {
"method": "",
"bank_name": "",
"account_name": "",
"account_number": "",
"iban": "",
"swift_bic": "",
"reference": ""
},
"metadata": {
"ocr_engine": "",
"parse_version": "",
"extraction_timestamp": "",
"warnings": []
}
}
Example filled JSON
{
"document_type": "invoice",
"confidence": 0.98,
"source_file": "invoice_001.pdf",
"language": "en",
"page_count": 1,
"invoice": {
"invoice_number": "INV-10482",
"invoice_date": "2026-01-15",
"due_date": "2026-02-14",
"purchase_order_number": "PO-77821",
"currency": "USD",
"payment_terms": "Net 30",
"status": "unpaid"
},
"seller": {
"name": "Acme Supplies Inc.",
"tax_id": "12-3456789",
"vat_id": "",
"address": {
"line1": "100 Market Street",
"line2": "Suite 500",
"city": "San Francisco",
"state": "CA",
"postal_code": "94105",
"country": "US"
},
"phone": "+1-415-555-0100",
"email": "billing@acme.com",
"website": "https://acme.com"
},
"buyer": {
"name": "Globex Corporation",
"tax_id": "",
"vat_id": "",
"address": {
"line1": "250 Park Avenue",
"line2": "",
"city": "New York",
"state": "NY",
"postal_code": "10177",
"country": "US"
}
},
"shipping": {
"name": "Globex Corporation Warehouse",
"address": {
"line1": "88 Warehouse Road",
"line2": "",
"city": "Jersey City",
"state": "NJ",
"postal_code": "07305",
"country": "US"
},
"method": "Ground",
"tracking_number": "1Z999AA10123456784"
},
"line_items": [
{
"line_number": 1,
"description": "Printer Paper A4",
"quantity": 10,
"unit_of_measure": "box",
"unit_price": 12.5,
"discount": 0.0,
"tax_rate": 8.25,
"tax_amount": 10.31,
"line_total": 135.31
}
],
"summary": {
"subtotal": 125.0,
"discount_total": 0.0,
"tax_total": 10.31,
"shipping_total": 0.0,
"other_charges": 0.0,
"grand_total": 135.31,
"amount_paid": 0.0,
"amount_due": 135.31
},
"payment": {
"method": "ACH",
"bank_name": "First National Bank",
"account_name": "Acme Supplies Inc.",
"account_number": "****1234",
"iban": "",
"swift_bic": "",
"reference": "INV-10482"
},
"metadata": {
"ocr_engine": "example-ocr-v1",
"parse_version": "1.0",
"extraction_timestamp": "2026-01-15T10:30:00Z",
"warnings": []
}
}
If you want, I can also provide:
- a minimal JSON schema
- a JSON Schema (draft 2020-12) for validation
- a Python/Pydantic model
- a multi-invoice OCR output format
Brands