Welcome to the EvaInvoice API, your automated solution for extracting data from invoice documents. Our API simplifies the data extraction process, enabling you to upload invoice documents and receive detailed extractions in the format of your choice.
To begin using the EvaInvoice API, follow these simple steps:
All API requests require the use of an API key, which is provided upon account creation. This key must be included in the header of each request.
Authorization: Bearer YOUR_API_KEY
This endpoint allows users to upload invoice documents for processing. The API accepts PDF, JPEG, PNG, DOC, and DOCX file formats.
POST https://api.evainvoice.com/Files/UploadParameter | Type | Description |
---|---|---|
outputFormat | String (optional) | Desired output format for the extracted data. Options: 'JSON', 'Excel', 'CSV'. Default is 'JSON'. |
ExtractItemsOnly | Boolean (optional) | Set to true to extract only itemized data. Default is false. |
curl -X POST 'https://api.evainvoice.com/Files/Upload' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: multipart/form-data' \ -F 'file=@/path/to/example_invoice.pdf' \ -F 'outputFormat=json' \ -F 'ExtractItemsOnly=false'
Note: Replace '/path/to/example_invoice.pdf'
with the actual path to your invoice file.
HTTP/1.1 200 OK Content-Type: application/json { "Message": "succeeded", "Task": { "TaskId": 12345, "NumberOfFiles": 1, "CreatedAt": "2023-04-01T12:00:00Z", "Status": "processing", "OutputFormat": "JSON", "ExtractionPreference": "WholeInvoice", "Files": [ { "OriginalName": "example_invoice.pdf", "Size": 102400, "Id": 54321, "ContentType": "application/pdf", "Status": "processing" } ] } }
Status Code | Message |
---|---|
400 Bad Request | "No files to upload" |
400 Bad Request | "One or more files are invalid. Please upload only PDF, JPEG, PNG, DOC, or DOCX files with size less than 50 MB." |
400 Bad Request | "Missing or invalid 'outputFormat' parameter" |
This endpoint allows users to retrieve information about a specific file by its ID. The information includes the file name, type, size, and its processing status.
GET https://api.evainvoice.com/Files/{id}Parameter | Type | Description |
---|---|---|
id | Integer | The unique identifier of the file. |
curl -X GET 'https://api.evainvoice.com/Files/12345' \ -H 'Authorization: Bearer YOUR_API_KEY'
Note: Replace 12345
with the actual ID of the file you wish to retrieve.
HTTP/1.1 200 OK Content-Type: application/json { "OriginalName": "example_invoice.pdf", "ContentType": "application/pdf", "Id": 12345, "Size": 204800, "Status": "finished" }
Status Code | Message |
---|---|
404 Not Found | "No file found" |
This endpoint allows users to download a processed file in JSON, Excel, or CSV format, based on the user's preference set during upload. The download is available only if the file's processing status is 'finished'.
GET https://api.evainvoice.com/Files/Download/{id}Parameter | Type | Description |
---|---|---|
id | Integer | The unique identifier of the processed file to download. |
curl -X GET 'https://api.evainvoice.com/Files/Download/12345' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -o 'downloaded_file'
Note: Replace 12345
with the actual ID of the file to download and specify the correct file extension (e.g., .json, .xlsx, .csv) in the -o
flag based on the expected format.
If the file is found and processing is finished, the API will stream the file for download in the specified format (JSON, Excel, or CSV). If the file is not found or still processing, an error message will be returned.
Status Code | Message |
---|---|
404 Not Found | "No file found" |
400 Bad Request | "File still processing, please check later." |
This endpoint provides detailed information about a specific invoice processing task, including the status of each file associated with the task.
GET https://api.evainvoice.com/Tasks/{id}Parameter | Type | Description |
---|---|---|
id | Integer | The unique identifier of the task. |
curl -X GET 'https://api.evainvoice.com/Tasks/12345' \ -H 'Authorization: Bearer YOUR_API_KEY'
Note: Replace 12345
with the actual ID of the task you wish to retrieve information about.
HTTP/1.1 200 OK Content-Type: application/json { "TaskId": 12345, "NumberOfFiles": 2, "CreatedAt": "2023-04-01T12:00:00Z", "Status": "processing", "OutputFormat": "JSON", "ExtractionPreference": "WholeInvoice", "Files": [ { "OriginalName": "invoice1.pdf", "Size": 204800, "Id": 54321, "ContentType": "application/pdf", "Status": "processing" }, { "OriginalName": "invoice2.jpg", "Size": 102400, "Id": 54322, "ContentType": "image/jpeg", "Status": "finished" } ] }
Status Code | Message |
---|---|
404 Not Found | "No task found" |