Invoice template
Extract invoice data from PDFs and photos
Upload an invoice as a PDF, a scan or a phone photo and get back typed fields for the vendor, dates, totals, tax and each line item. The invoice template is ready to use, and you can edit its keys to match your own records.
No account needed for the Playground. The Invoice template is already picked for you.
At a glance
- 26 keys, including Line Items
- PDF, PNG and JPEG, including scans and photos
- Output: JSON, Excel (.xlsx), CSV
- Built to return null instead of guessing
- Documents are not stored after a request finishes
- Good for: accounts payable intake, bookkeeping and expense tools, matching invoices to purchase orders
Keys
What gets extracted
The Invoice template, exactly as it is saved in a new workspace. Every key comes back in the response. A value that is not on the document is null.
| Key | Type | Description |
|---|---|---|
| Vendor NamerequiredCompany that issued the invoice. | string | Company that issued the invoice. |
| Vendor Address | string | |
| Vendor Tax IdVAT, GST, or other tax registration number of the vendor. | string | VAT, GST, or other tax registration number of the vendor. |
| Customer NameBill-to company or person. | string | Bill-to company or person. |
| Customer Address | string | |
| Invoice Numberrequired | string | |
| Invoice Daterequired | date | |
| Due Date | date | |
| Purchase Order NumberPO number referenced on the invoice, if any. | string | PO number referenced on the invoice, if any. |
| CurrencyrequiredISO 4217 code, for example USD, EUR, or LKR. | string | ISO 4217 code, for example USD, EUR, or LKR. |
| SubtotalTotal before tax. | number | Total before tax. |
| Discount | number | |
| Shipping | number | |
| Tax RateTax rate as a percentage, for example 8 for 8%. | number | Tax rate as a percentage, for example 8 for 8%. |
| Tax Amount | number | |
| TotalrequiredGrand total including tax. | number | Grand total including tax. |
| Amount DueBalance still to pay after any deposits or payments. | number | Balance still to pay after any deposits or payments. |
| Payment TermsFor example Net 30. | string | For example Net 30. |
| Line ItemsrequiredOne entry per billed line, in document order. | object[] | One entry per billed line, in document order. |
| └ Descriptionrequired | string | |
| └ SkuItem code or SKU. | string | Item code or SKU. |
| └ Quantityrequired | number | |
| └ UnitUnit of measure, for example pcs or hours. | string | Unit of measure, for example pcs or hours. |
| └ Unit Pricerequired | number | |
| └ Tax RatePercentage. | number | Percentage. |
| └ AmountrequiredLine total. | number | Line total. |
Good to know
Invoice: keys worth knowing
What the trickier keys in the Invoice template hold, and how they relate.
Total and Amount Due
Total is the grand total including tax. Amount Due is what is still owed after deposits or part payments, so the two differ on a partly paid invoice. Both are copied as printed.
Tax Rate and Tax Amount
Tax Rate is the printed percentage, so 8% comes back as 8, not 0.08. Tax Amount is the printed tax figure. A rate that differs per line goes in Line Items[].Tax Rate.
Purchase Order Number
The buyer's PO number when the invoice quotes one. The purchase order template returns the same number as PO Number, so the two documents can be matched.
Example
From invoice to JSON
An illustrative invoice with a made-up company and numbers, and the JSON the Invoice template returns for it. Keys that are not on the document come back as null.

{
"Vendor Name": "Northwind Supply Ltd",
"Vendor Address": "12 Harbour Road, Colombo 03",
"Vendor Tax Id": "LK-114402871",
"Customer Name": "Acme Studio (Pvt) Ltd",
"Customer Address": "45 Flower Road, Colombo 07",
"Invoice Number": "INV-1042",
"Invoice Date": "2026-10-25",
"Due Date": "2026-11-24",
"Purchase Order Number": "PO-7781",
"Currency": "USD",
"Subtotal": 1180,
"Discount": null,
"Shipping": 6.1,
"Tax Rate": 8,
"Tax Amount": 94.4,
"Total": 1280.5,
"Amount Due": 1280.5,
"Payment Terms": "Net 30",
"Line Items": [
{
"Description": "Cat6 cable, 50 m",
"Sku": "CBL-50",
"Quantity": 4,
"Unit": "pcs",
"Unit Price": 120,
"Tax Rate": null,
"Amount": 480
},
{
"Description": "Network switch, 24 port",
"Sku": "SW-24",
"Quantity": 2,
"Unit": "pcs",
"Unit Price": 350,
"Tax Rate": null,
"Amount": 700
}
]
}Common gotchas
Where invoice extraction trips up
Things that often catch people out with invoice data, and how to handle them.
Totals are copied, not calculated
A subtotal or tax figure that is not printed comes back as null rather than being worked out from the lines. If you need the sum, add up Line Items in your own code and compare it with the printed total.
Line items over several pages
Rows that continue onto later pages come back as one Line Items array in document order, with repeated table headers skipped. Each page uses one credit.
Number and date formats
Amounts like 1.234,56 are read with the invoice's own decimal convention and returned as 1234.56. A date such as 03/04/2026 is read using clues like the vendor's country or currency and returned as yyyy-mm-dd.
How it works
Three steps, no setup.
- Step 1
Upload the document
Drop an invoice into the Playground. PDF, PNG and JPEG all work, including scans and phone photos.
- Step 2
Pick the template
Choose the Invoice layout. It is already in every new workspace and guest browser, and you can edit its keys.
- Step 3
Review and export
The model fills exactly the layout's keys, with numbers as numbers and dates as yyyy-mm-dd. Copy the fields or download Excel or CSV.
Playground
Try the Invoice template now
Upload an invoice with the Invoice layout already picked. Edit the keys afterward if you need to match your own records.
FAQ
Invoice extraction, answered.
Does it work with scanned or photographed invoices?
Yes. PDFs, PNGs and JPEGs are all read by the model directly, so a scan or a phone photo works as well as a digital PDF as long as the text is legible.
Can I export invoices to Excel or CSV?
Yes. After a parse in the Playground, use Download. Excel puts the invoice header on one sheet and the line items on another. CSV gives one row per line item with the invoice keys repeated.
Do you store my invoice documents?
No. The file is processed in memory for the request and then dropped. Neither the document nor the extracted JSON is saved. Only a usage record is kept, with things like the time, page count and credits used.
Can I change the keys?
Yes. Every new workspace, and every guest browser, starts with the Invoice template as a normal layout. Edit it, rename keys, add keys or delete it. Changes are yours, and a deleted template does not come back.
What happens when a value is not on the document?
It comes back as null. doc2json is built to return null instead of guessing, so you can tell missing data from real data.
Is it free to try?
Yes. The Playground works without an account, using a small guest allowance. A free account adds monthly credits and saved layouts. One credit is one page.
Need a spreadsheet instead? Invoice to Excel or Invoice to CSV
Other templates
Try it on your own invoice.
Open the Playground with the Invoice template picked and drop in a file. Sign up free when you want saved layouts and exports at volume.