Azure Form Recognizer invoice model
This article applies to: Form Recognizer v3.0. Earlier version: Form Recognizer v2.1
This article applies to: Form Recognizer v2.1. Later version: Form Recognizer v3.0
The Form Recognizer invoice model uses powerful Optical Character Recognition (OCR) capabilities to analyze and extract key fields and line items from sales invoices, utility bills, and purchase orders. Invoices can be of various formats and quality including phone-captured images, scanned documents, and digital PDFs. The API analyzes invoice text; extracts key information such as customer name, billing address, due date, and amount due; and returns a structured JSON data representation. The model currently supports both English and Spanish invoices.
Supported document types:
- Invoices
- Utility bills
- Sales orders
- Purchase orders
Automated invoice processing
Automated invoice processing is the process of extracting key accounts payable fields from billing account documents. Extracted data includes line items from invoices integrated with your accounts payable (AP) workflows for reviews and payments. Historically, the accounts payable process has been done manually and, hence, very time consuming. Accurate extraction of key data from invoices is typically the first and one of the most critical steps in the invoice automation process.
Sample invoice processed with Form Recognizer Studio:
Sample invoice processed with Form Recognizer Sample Labeling tool:
Development options
Form Recognizer v3.0 supports the following tools:
Feature | Resources | Model ID |
---|---|---|
Invoice model | prebuilt-invoice |
Form Recognizer v2.1 supports the following tools:
Feature | Resources |
---|---|
Invoice model |
Input requirements
For best results, provide one clear photo or high-quality scan per document.
Supported file formats:
Model PDF Image:
JPEG/JPG, PNG, BMP, and TIFFMicrosoft Office:
Word (DOCX), Excel (XLS), PowerPoint (PPT), and HTMLRead ✔ ✔ ✱ REST API version
2022/06/30-preview
Layout ✔ ✔ General Document ✔ ✔ Prebuilt ✔ ✔ Custom ✔ ✔ ✱ Microsoft Office files are currently not supported for other models or versions.
For PDF and TIFF, up to 2000 pages can be processed (with a free tier subscription, only the first two pages are processed).
The file size for analyzing documents must be less than 500 MB for paid (S0) tier and 4 MB for free (F0) tier.
Image dimensions must be between 50 x 50 pixels and 10,000 px x 10,000 pixels.
PDF dimensions are up to 17 x 17 inches, corresponding to Legal or A3 paper size, or smaller.
If your PDFs are password-locked, you must remove the lock before submission.
The minimum height of the text to be extracted is 12 pixels for a 1024 x 768 pixel image. This dimension corresponds to about
8
-point text at 150 dots per inch (DPI).For custom model training, the maximum number of pages for training data is 500 for the custom template model and 50,000 for the custom neural model.
For custom extraction model training, the total size of training data is 50 MB for template model and 1G-MB for the neural model.
For custom classification model training, the total size of training data is
1GB
with a maximum of 10,000 pages.
- Supported file formats: JPEG, PNG, PDF, and TIFF
- For PDF and TIFF, up to 2000 pages are processed. For free tier subscribers, only the first two pages are processed.
- The file size must be less than 50 MB and dimensions at least 50 x 50 pixels and at most 10,000 x 10,000 pixels.
Try invoice data extraction
See how data, including customer information, vendor details, and line items, is extracted from invoices. You need the following resources:
An Azure subscription—you can create one for free
A Form Recognizer instance in the Azure portal. You can use the free pricing tier (
F0
) to try the service. After your resource deploys, select Go to resource to get your key and endpoint.
Form Recognizer Studio
On the Form Recognizer Studio home page, select Invoices
You can analyze the sample invoice or select the + Add button to upload your own sample.
Select the Analyze button:
Form Recognizer Sample Labeling tool
Navigate to the Form Recognizer Sample Tool.
On the sample tool home page, select the Use prebuilt model to get data tile.
Select the Form Type to analyze from the dropdown menu.
Choose a URL for the file you would like to analyze from the below options:
In the Source field, select URL from the dropdown menu, paste the selected URL, and select the Fetch button.
In the Form recognizer service endpoint field, paste the endpoint that you obtained with your Form Recognizer subscription.
In the key field, paste the key you obtained from your Form Recognizer resource.
Select Run analysis. The Form Recognizer Sample Labeling tool calls the Analyze Prebuilt API and analyze the document.
View the results - see the key-value pairs extracted, line items, highlighted text extracted and tables detected.
Note
The Sample Labeling tool does not support the BMP file format. This is a limitation of the tool not the Form Recognizer Service.
Supported languages and locales
Note
Form Recognizer auto-detects language and locale data.
Supported languages | Details |
---|---|
• English (en) | United States (us), Australia (-au), Canada (-ca), United Kingdom (-uk), India (-in) |
• Spanish (es) | Spain (es) |
• German (de) | Germany (de) |
• French (fr) | France (fr) |
• Italian (it) | Italy (it) |
• Portuguese (pt) | Portugal (pt), Brazil (br) |
• Dutch (nl) | Netherlands (nl) |
Field extraction
Name | Type | Description | Standardized output |
---|---|---|---|
CustomerName | String | Invoiced customer | |
CustomerId | String | Customer reference ID | |
PurchaseOrder | String | Purchase order reference number | |
InvoiceId | String | ID for this specific invoice (often "Invoice Number") | |
InvoiceDate | Date | Date the invoice was issued | yyyy-mm-dd |
DueDate | Date | Date payment for this invoice is due | yyyy-mm-dd |
VendorName | String | Vendor name | |
VendorTaxId | String | The taxpayer number associated with the vendor | |
VendorAddress | String | Vendor mailing address | |
VendorAddressRecipient | String | Name associated with the VendorAddress | |
CustomerAddress | String | Mailing address for the Customer | |
CustomerTaxId | String | The taxpayer number associated with the customer | |
CustomerAddressRecipient | String | Name associated with the CustomerAddress | |
BillingAddress | String | Explicit billing address for the customer | |
BillingAddressRecipient | String | Name associated with the BillingAddress | |
ShippingAddress | String | Explicit shipping address for the customer | |
ShippingAddressRecipient | String | Name associated with the ShippingAddress | |
PaymentTerm | String | The terms of payment for the invoice | |
SubTotal | Number | Subtotal field identified on this invoice | Integer |
TotalTax | Number | Total tax field identified on this invoice | Integer |
InvoiceTotal | Number (USD) | Total new charges associated with this invoice | Integer |
AmountDue | Number (USD) | Total Amount Due to the vendor | Integer |
ServiceAddress | String | Explicit service address or property address for the customer | |
ServiceAddressRecipient | String | Name associated with the ServiceAddress | |
RemittanceAddress | String | Explicit remittance or payment address for the customer | |
RemittanceAddressRecipient | String | Name associated with the RemittanceAddress | |
ServiceStartDate | Date | First date for the service period (for example, a utility bill service period) | yyyy-mm-dd |
ServiceEndDate | Date | End date for the service period (for example, a utility bill service period) | yyyy-mm-dd |
PreviousUnpaidBalance | Number | Explicit previously unpaid balance | Integer |
CurrencyCode | String | The currency code associated with the extracted amount | |
PaymentDetails | Array | An array that holds Payment Option details such as IBAN and SWIFT |
|
TotalDiscount | Number | The total discount applied to an invoice | Integer |
TaxItems (en-IN only) | Array | AN array that holds added tax information such as CGST , IGST , and SGST . This line item is currently only available for the en-in locale |
Line items
Following are the line items extracted from an invoice in the JSON output response (the following output uses this sample invoice)
Name | Type | Description | Text (line item #1) | Value (standardized output) |
---|---|---|---|---|
Items | String | Full string text line of the line item | 3/4/2021 A123 Consulting Services 2 hours $30.00 10% $60.00 | |
Amount | Number | The amount of the line item | $60.00 | 100 |
Description | String | The text description for the invoice line item | Consulting service | Consulting service |
Quantity | Number | The quantity for this invoice line item | 2 | 2 |
UnitPrice | Number | The net or gross price (depending on the gross invoice setting of the invoice) of one unit of this item | $30.00 | 30 |
ProductCode | String | Product code, product number, or SKU associated with the specific line item | A123 | |
Unit | String | The unit of the line item, e.g, kg, lb etc. | Hours | |
Date | Date | Date corresponding to each line item. Often it's a date the line item was shipped | 3/4/2021 | 2021-03-04 |
Tax | Number | Tax associated with each line item. Possible values include tax amount and tax Y/N | 10.00 | |
TaxRate | Number | Tax Rate associated with each line item. | 10% |
The invoice key-value pairs and line items extracted are in the documentResults
section of the JSON output.
Key-value pairs
The prebuilt invoice 2022-06-30 and later releases support returns key-value pairs at no extra cost. Key-value pairs are specific spans within the invoice that identify a label or key and its associated response or value. In an invoice, these pairs could be the label and the value the user entered for that field or telephone number. The AI model is trained to extract identifiable keys and values based on a wide variety of document types, formats, and structures.
Keys can also exist in isolation when the model detects that a key exists, with no associated value or when processing optional fields. For example, a middle name field may be left blank on a form in some instances. key-value pairs are always spans of text contained in the document. For documents where the same value is described in different ways, for example, customer/user, the associated key is either customer or user (based on context).
Supported locales
Prebuilt invoice v2.1 supports invoices in the en-us locale.
Fields extracted
The Invoice service extracts the text, tables, and 26 invoice fields. Following are the fields extracted from an invoice in the JSON output response (the following output uses this sample invoice).
Name | Type | Description | Text | Value (standardized output) |
---|---|---|---|---|
CustomerName | string | Customer being invoiced | Microsoft Corp | |
CustomerId | string | Reference ID for the customer | CID-12345 | |
PurchaseOrder | string | A purchase order reference number | PO-3333 | |
InvoiceId | string | ID for this specific invoice (often "Invoice Number") | INV-100 | |
InvoiceDate | date | Date the invoice was issued | 11/15/2019 | 2019-11-15 |
DueDate | date | Date payment for this invoice is due | 12/15/2019 | 2019-12-15 |
VendorName | string | Vendor who has created this invoice | CONTOSO LTD. | |
VendorAddress | string | Mailing address for the Vendor | 123 456th St New York, NY, 10001 | |
VendorAddressRecipient | string | Name associated with the VendorAddress | Contoso Headquarters | |
CustomerAddress | string | Mailing address for the Customer | 123 Other Street, Redmond WA, 98052 | |
CustomerAddressRecipient | string | Name associated with the CustomerAddress | Microsoft Corp | |
BillingAddress | string | Explicit billing address for the customer | 123 Bill Street, Redmond WA, 98052 | |
BillingAddressRecipient | string | Name associated with the BillingAddress | Microsoft Services | |
ShippingAddress | string | Explicit shipping address for the customer | 123 Ship Street, Redmond WA, 98052 | |
ShippingAddressRecipient | string | Name associated with the ShippingAddress | Microsoft Delivery | |
SubTotal | number | Subtotal field identified on this invoice | $100.00 | 100 |
TotalTax | number | Total tax field identified on this invoice | $10.00 | 10 |
InvoiceTotal | number | Total new charges associated with this invoice | $110.00 | 110 |
AmountDue | number | Total Amount Due to the vendor | $610.00 | 610 |
ServiceAddress | string | Explicit service address or property address for the customer | 123 Service Street, Redmond WA, 98052 | |
ServiceAddressRecipient | string | Name associated with the ServiceAddress | Microsoft Services | |
RemittanceAddress | string | Explicit remittance or payment address for the customer | 123 Remit St New York, NY, 10001 | |
RemittanceAddressRecipient | string | Name associated with the RemittanceAddress | Contoso Billing | |
ServiceStartDate | date | First date for the service period (for example, a utility bill service period) | 10/14/2019 | 2019-10-14 |
ServiceEndDate | date | End date for the service period (for example, a utility bill service period) | 11/14/2019 | 2019-11-14 |
PreviousUnpaidBalance | number | Explicit previously unpaid balance | $500.00 | 500 |
Following are the line items extracted from an invoice in the JSON output response (the following output uses this sample invoice)
Name | Type | Description | Text (line item #1) | Value (standardized output) |
---|---|---|---|---|
Items | string | Full string text line of the line item | 3/4/2021 A123 Consulting Services 2 hours $30.00 10% $60.00 | |
Amount | number | The amount of the line item | $60.00 | 100 |
Description | string | The text description for the invoice line item | Consulting service | Consulting service |
Quantity | number | The quantity for this invoice line item | 2 | 2 |
UnitPrice | number | The net or gross price (depending on the gross invoice setting of the invoice) of one unit of this item | $30.00 | 30 |
ProductCode | string | Product code, product number, or SKU associated with the specific line item | A123 | |
Unit | string | The unit of the line item, e.g, kg, lb etc. | hours | |
Date | date | Date corresponding to each line item. Often it's a date the line item was shipped | 3/4/2021 | 2021-03-04 |
Tax | number | Tax associated with each line item. Possible values include tax amount, tax %, and tax Y/N | 10% |
JSON output
The JSON output has three parts:
"readResults"
node contains all of the recognized text and selection marks. Text is organized via page, then by line, then by individual words."pageResults"
node contains the tables and cells extracted with their bounding boxes, confidence, and a reference to the lines and words in "readResults"."documentResults"
node contains the invoice-specific values and line items that the model discovered. It's where to find all the fields from the invoice such as invoice ID, ship to, bill to, customer, total, line items and lots more.
Migration guide
- Follow our Form Recognizer v3.0 migration guide to learn how to use the v3.0 version in your applications and workflows.
Next steps
Try processing your own forms and documents with the Form Recognizer Studio
Complete a Form Recognizer quickstart and get started creating a document processing app in the development language of your choice.
Try processing your own forms and documents with the Form Recognizer Sample Labeling tool
Complete a Form Recognizer quickstart and get started creating a document processing app in the development language of your choice.
Feedback
Submit and view feedback for