How to use Eagle Doc Finance Doc Batch Processing API
Eagle Doc's Finance Doc Batch Processing API is a RESTful API that allows you to process multiple finance documents in one go. Even when one PDF file contains multiple invoices/receipts, the API can process them all at once by automatically splitting the PDF file into individual documents. The API is capable of processing documents in various formats such as PDF, PNG, TIFF and JPEG. Besides, the API is designed to be easy to use and can be integrated into your existing applications with minimal effort.
We consistently enhance the performance of our algorithm. While the interface remains unchanged, there will be no increments in the API version. However, you may observe distinct version numbers within 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.
Finance Batch Processing Endpoints
Finance Batch Processing Task submit API version 1 (v1)
This endpoint is intended to summit a batch processing task which converts files with mulitple invoices/receipts into the json result.
Parameters
api-key (header) |
API key which you will receive with your subscription here |
file (form-data) |
File of the receipts or invoices. To be sent in the body as form-data with the key 'file'. Support images(png, tif, jpeg), PDFs, or a mix of them.
|
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. 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 receipt/invoice). The data can be used for example to make receipts/invoices searchable in your database. The default value is false. To change, otherwise you can set it: &fullText=true |
waitTime (query parameter) |
int to indicate the wait time (unit: second) you expect the API to return a result. It is a integer number. The default value is 30. To change, you can set it: &waitTime=60 (or any number). If the API takes longer than the wait time you set, it will return a task "id" for you to inquiry later the result from this task. Otherwise, the API returns extracted invoices/receipts already in the json result. |
Responses
200 |
OK is returned to indicate that the receipts/invoices were 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.
id |
It is the task id. This id can be used to query the task result later if the task can not be completed within the expected time (waitTime).
An example of id: "TASK_1719391144803_dd33f95c-0e00-424f-bcc8-03a14b35fbe9" |
createdTime |
It is the created time of the task in ISO date time format.
An example: "2024-06-26T08:39:04.803Z"
|
finishedTime |
It is the finished time of the task in ISO date time format.
An example: "2024-06-26T08:39:24.803Z"
|
pagesProcessed |
It is the number of pages of files processed in the task.
|
pageGroups |
It is an array of page groups. Each page group contains the first page index and the last page index of an invoice/receipt.
An example: "pageGroups": [[1,2],[3,3]], which means there are two invoices/receipts in the file. The first invoice/receipt is from page 1 to page 2, the second invoice/receipt is on page 3.
|
numberOfFiles |
It is the number of invoices/receipts found and processed in the task.
|
invoices |
It is an array of invoices/receipts. Each invoice/receipt contains the same fields as the response of the single processing task like in this documentation.
|
messages |
The messages from the system about this task. |
|
API of Task Check and Query for Finance Batch Processing version 1 (v1)
This endpoint is intended to check the status of unfishished tasks and get the results of the task.
Parameters
api-key (header) |
API key which you will receive with your subscription here |
id (query parameter) |
It is the task id you got from posting a batch processing task. It looks somthing like: "TASK_..." |
Responses
200 |
OK is returned to indicate that the receipts/invoices were 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.
id |
It is the task id. This id can be used to query the task result later if the task can not be completed within the expected time (waitTime).
An example of id: "TASK_1719391144803_dd33f95c-0e00-424f-bcc8-03a14b35fbe9" |
createdTime |
It is the created time of the task in ISO date time format.
An example: "2024-06-26T08:39:04.803Z"
|
finishedTime |
It is the finished time of the task in ISO date time format.
An example: "2024-06-26T08:39:24.803Z"
|
pagesProcessed |
It is the number of pages of files processed in the task.
|
pageGroups |
It is an array of page groups. Each page group contains the first page index and the last page index of an invoice/receipt.
An example: "pageGroups": [[1,2],[3,3]], which means there are two invoices/receipts in the file. The first invoice/receipt is from page 1 to page 2, the second invoice/receipt is on page 3.
|
numberOfFiles |
It is the number of invoices/receipts found and processed in the task.
|
invoices |
It is an array of invoices/receipts. Each invoice/receipt contains the same fields as the response of the single processing task like in this documentation.
|
messages |
The messages from the system about this task. |
|
Full JSON Example
Request with /api/finance/v1/processing/batch?polygon=false&fullText=true
An example of the whole JSON response of the completed task looks like this (click this link)
An example of the whole JSON response of the task which is not completed within the expected time looks like this (click this link)