EvaInvoice API Documentation

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.

Key Features

  • Invoice Data Extraction: Upload your invoice documents and let our advanced extraction technology handle the rest.
  • Multiple Format Support: We support a variety of document formats, including PDF, JPEG, PNG, DOC, and DOCX.
  • Flexible Output Options: Choose how you receive your extracted data - available in JSON, CSV, or Excel formats.
  • Task Management: Easily manage your data extraction tasks and track their progress through our API.

Getting Started

To begin using the EvaInvoice API, follow these simple steps:

  1. Authenticate: Use your API key for authentication, provided upon account creation.
  2. Upload Invoices: Upload your invoice documents using our 'Upload Invoice' endpoint.
  3. Specify Output Format: During the upload, choose your desired output format (JSON, CSV, or Excel) for the extracted data (Default value is JSON).
  4. Track Progress: Monitor the status of your extraction tasks and their associated files with the 'Retrieve Task Information' endpoint.
  5. Download Results: Once processing is complete, download your extracted data using the 'Download Processed File' endpoint.

Authentication

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

Upload Invoice

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/Upload

Request Parameters:

Parameter 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.

Request Example with curl:

    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.

Response Example:

    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"
                }
            ]
        }
    }

Common Error Responses:

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"

Retrieve File Information

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}

URL Parameters:

Parameter Type Description
id Integer The unique identifier of the file.

Request Example with curl:

    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.

Response Example:

    HTTP/1.1 200 OK
    Content-Type: application/json

    {
        "OriginalName": "example_invoice.pdf",
        "ContentType": "application/pdf",
        "Id": 12345,
        "Size": 204800,
        "Status": "finished"
    }

Common Error Responses:

Status Code Message
404 Not Found "No file found"

Download Processed File

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}

URL Parameters:

Parameter Type Description
id Integer The unique identifier of the processed file to download.

Request Example with curl:

    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.

Response Description:

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.

Common Error Responses:

Status Code Message
404 Not Found "No file found"
400 Bad Request "File still processing, please check later."

Retrieve Task Information

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}

URL Parameters:

Parameter Type Description
id Integer The unique identifier of the task.

Request Example with curl:

    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.

Response Example:

    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"
            }
        ]
    }

Common Error Responses:

Status Code Message
404 Not Found "No task found"