VAT rate plugin

Support for multiple vat rates on invoice documents

You can extract multiple different VAT rates from invoices by enabling the VAT rates plugin for your document type. You can do that in the Advanced settings section on the bottom of the page when creating or editing the document type.
Once the plugin is enabled you need to set which fields will represent the required number fields.
Your document type must contain fields that represent:

  • Net amount of the invoice (number type)
  • Gross amount of the invoice (number type)

You must choose from the fields that you configured which will correspond to the required fields.
We provided an example configuration below:

Setting up the vat rate plugin

How does it work?

The vat rate plugin calculates and recognizes all the possible VAT rates based on the extracted values for the net and gross amount.
To explain the plugin flow:

  1. First the extraction is done for all the defined fields
  2. After the extraction is finished the configured VAT rate plugin is ran. If the supplier had any combination of a VAT rate added to the dataset before, the plugin takes the results from the net and gross fields and tries to find the best solution for all the trained combinations of VAT rates.

This means that for suppliers which have multiple different combinations of VAT rates - for example, first invoice has 20% VAT rate, the second has 20% and 8% - you will have to train and provide all the different combinations to support all the different cases.
Until the particular supplier has not been trained with the combination, that VAT rate combination will not be calculated correctly.

🚧

Limitations

Currently there are the following limits you need to take into account when using the vat rate plugin:

  • The values can only be calculated from numbers which are present on the document. We use the document as the source of truth for the input information. If the number is not present, the plugin will not calculate the result
  • Multiple different values on one invoice for the same vat percentage are not supported. Eg. if there are multiple 0% net values for different services the plugin will not correctly calculate the solution.

Example

VAT rates are returned in the extraction response in the vat_rates property of the JSON object.
They are returned as a list of lists with every list containing two extracted field values for the VAT rate percentage and the VAT rate net value. The vat_rate_percentage value is calculated and does not contain correct positional information, while the vat_rate_net will also contain the positional information of the extracted net value.

"vat_rates": [
    [
      {
        "data_type": "NUMBER",
        "name": "vat_rate_percentage",
        "values": [
          {
            "confidence_score": 0.99,
            "height": -1,
            "page_number": -1,
            "value": "9.5000",
            "width": -1,
            "x": -1,
            "y": -1
          }
        ]
      },
      {
        "data_type": "NUMBER",
        "name": "vat_rate_net",
        "values": [
          {
            "confidence_score": 0.99,
            "height": 31,
            "page_number": 0,
            "value": "404.1400",
            "width": 117,
            "x": 540,
            "y": 2843
          }
        ]
      }
    ],
    [
      {
        "data_type": "NUMBER",
        "name": "vat_rate_percentage",
        "values": [
          {
            "confidence_score": 0.99,
            "height": -1,
            "page_number": -1,
            "value": "22.0000",
            "width": -1,
            "x": -1,
            "y": -1
          }
        ]
      },
      {
        "data_type": "NUMBER",
        "name": "vat_rate_net",
        "values": [
          {
            "confidence_score": 0.99,
            "height": 31,
            "page_number": 0,
            "value": "240.0000",
            "width": 115,
            "x": 540,
            "y": 2913
          }
        ]
      }
    ]
  ]