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 at 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 select from the fields that you have 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 run. If the supplier had any combination of VAT rates added to the dataset before, the plugin takes the results from the net and gross fields and attempts to find the best solution for all the trained combinations of VAT rates.

This means that for suppliers that have multiple different combinations of VAT rates - for example, the first invoice has a 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 been trained with the combination, that VAT rate combination will not be calculated correctly.

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 vat_rate_net will also contain 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
          }
        ]
      }
    ]
]

Last updated