How to use Eagle Doc Invoice OCR

Eagle Doc Invoice OCR enables the accurate extraction of vital details from photos, scanned documents, or digital invoices, elevating the operational efficiency of your invoice processing application.

We continually refine the algorithm's performance. While the interface retains its current form, there will be no adjustments to the API version. However, distinct version numbers will be evident in the 'version' field of the JSON response.

Server

We currently operate one server in Frankfurt, Germany. This server is supported by a load balancer, allowing it to scale smoothly based on the workload. If you require a dedicated server or specific location, please get in touch with us.

alternative



Invoice Processing Endpoints




Invoice API version 1 (v1)
Parameters
Name Description
api-key (header) API key which you will receive with your subscription here
file (form-data) File of the invoice. To be sent in the body as form-data with the key 'file'. If the invoice has multiple pages, you can attach them all as separate image files or as a PDF.
❗ Important: The API does not support batch processing of multiple invoices in one API call. Please call for each invoice the endpoint separately.
privacy (query parameter) Boolean (true, false) to indicate if the uploaded file is stored on the server to further enhance the algorithm or not. 'true' means that the file is not stored, 'false' means that the file is stored. The default value is false. The default value is false. To change, you can set it: &privacy=true
polygon (query parameter) Boolean (true, false) to indicate if you want to receive coordinate information of the extracted data. The data provides you with the ability to draw polygons around the extracted text on the input file. The default value is false. To change, you can set it: &polygon=true
fullText (query parameter) Boolean (true, false) to indicate if you want to receive the full text of the extracted data. The data will be an array of strings per page (in case of multiple pages of the invoice). The data can be used for example to make invoices searchable in your database. The default value is false. To change, you can set it: &fullText=true
Responses
Code Description
200 OK is returned to indicate that the invoice was processed successfully.

The retrieved data is presented in the form of a JSON structure comprising several distinct fields. The below explanation provides further details. It's important to note that the resultant structure exclusively encompasses the detected or available data, implying that not all fields within the JSON structure will be included in the output.
Field Name Description
docType Type of invoice: Invoice or CreditMemo
general Summarizes general information about the invoice, which includes an array of key-value pairs.
Possible keys can be: ShopName, ShopStreet, ShopHouseNumber, ShopCity, ShopZip, ShopState, ShopCountry, TaxNumber, CustomerName, CustomerStreet, CustomerHouseNumber, CustomerCity, CustomerZip, CustomerState, CustomerCountry, InvoiceDate, InvoiceDueDate, InvoiceNumber, TotalPrice, Currency, ReverseCharge
productItems Contains an array of the line items. Each line item is an array of key-value pairs.
Possible keys can be: ProductId, ProductName, ProductPrice, ProductUnitPrice, ProductQuantity, ProductUnit, TaxPercentage, TaxLabel, TaxAmount, TaxNetAmount, TaxGrossAmount, IsRefund
taxes Contains an array of tax infos with different tax types. Each tax info is an array of key-value pairs.
Possible keys can be: TaxPercentage, TaxLabel, TaxAmount, TaxNetAmount, TaxGrossAmount
payments This field is to indicate how the invoice has been paid, for example: paypal, Credit card, Debit card and so on. It contains an array of payment infos with different payment types and the possible card number included in the invoice. Each payment info is an array of key-value pairs.
Possible keys can be: PaymentMethod, PaymentCardNumber
paymentBanks This field is to indicate how the invoice can been paid through banks with BIC and IBAN. It contains an array of payment banks with BIC and IBAN. Each payment info is an array of key-value pairs.
Possible keys can be: BIC, IBAN
performanceOption Indicates which algorithm was used for processing the invoice. At the moment there is 'ACCURACY' and 'FALLBACK' available. 'FALLBACK' indicates that our algorithm encountered challenges while processing the invoice, therefore it provides basic information.
fileHash MD5 hash of the input file. This information can be used to check for duplicates
version Version of the algorithm which was used to process the invoice
pages size information (height and width) of all pages
fullText texts of lines on all pages
languages array of language codes of languages detected in the document
mainLanguage language code of the main language detected in the document

Key-Value pairs
All key value pairs mentioned above have the same format like this:

                                
                                        "key": {
                                            "value": "",
                                            "polygon": {
                                                "p1": {
                                                    "x": 372.0,
                                                    "y": 1282.0
                                                },
                                                "p2": {
                                                    "x": 453.0,
                                                    "y": 1282.0
                                                },
                                                "p3": {
                                                    "x": 453.0,
                                                    "y": 1308.0
                                                },
                                                "p4": {
                                                    "x": 372.0,
                                                    "y": 1308.0
                                                }
                                            },
                                            "page":1
                                        }

Inside the value structure, you can find "value": "". The "value" is represented in a format of String no matter it is a number or text. "polygon" is used to indicate the location of the found result on a page of the invoice. "page" is used to indicate the page number where the found result is on, which starts from 1. If the input parameter "polygon" in request "/api/invoice/v1/processing?polygon=false" set to "false", the polygon information will not be returned. The key-value pair then simplified like this:

                                
                                        "key": {
                                            "value": "",
                                            "page":1
                                        }

403 BadCredentialException is used to indicate that for example the API key is not valid.
404 FileNotFoundException is used to indicate that there is no file found.
405 MethodNotAllowedException: Access to the API not allowed. There are multiple reasons possible: you reached the agreed quota, your contract expired or another internal error. Please contact us if the error persists.
500 InternalServerErrorException is used to indicate that something went wrong. Reason is not known.
Full JSON Example

Request with /api/invoice/v1/processing?polygon=false&fullText=true
An example of the whole JSON response of the parsed invoice in looks like this (click this link).