> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cleariflow.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Calculate VAT endpoint

> The `calculate` endpoint enables precise VAT computation for compliant pricing, taking into account country-specific regulations, transaction amounts, and optional product categories for accurate tax calculations.

## Getting started

### Base URL

```
https://vat.cleariflow.com/v1/calculate/
```

### Calculation endpoint

The `calculate` endpoint requires your unique API key, the country and the price you'd like to check:

```
https://vat.cleariflow.com/v1/calculate/
? api_key = YOUR_UNIQUE_API_KEY
& amount = 175  
& country_code = DE
& category = standard
```

This successful request returns comprehensive VAT calculation results including rates, amounts, and country information:

<ResponseExample>
  ```json theme={"system"}
  {
      "amount_excluding_vat": "175.00",
      "amount_including_vat": "208.25",
      "country": {
          "code": "DE",
          "name": "Germany"
      },
      "vat_amount": "33.25",
      "vat_category": "standard",
      "vat_rate": "0.190"
  }
  ```
</ResponseExample>

### Request parameters

<ParamField query="api_key" type="String" required>
  Your unique API key. Note that each user has unique API keys for each of Cleariflow APIs, so your VAT Validation API key will not work for as your IP Geolocation API, for example.
</ParamField>

<ParamField query="amount" type="String" required>
  The amount that you would like to get the VAT amount for or from.
</ParamField>

<ParamField query="country_code" type="String" required>
  The two letter ISO 3166-1 alpha-2 code of the country in which the transaction takes place.
</ParamField>

<ParamField query="category" type="String" required>
  The VAT category to use for calculation. Use "standard" for standard VAT rate, or specific categories like "e-books", "audiobooks", etc. for reduced rates.
</ParamField>

<ParamField query="is_vat_incl" type="Boolean">
  If the amount already has VAT added and you'd like to do the reverse calculation and split out the amount and VAT, set this parameter to true. If this parameter is not explicitly included it will default to false.
</ParamField>

### Response parameters

The API response is returned in a universal and lightweight [JSON format](https://www.json.org/json-en.html).

<ResponseField name="amount_excluding_vat" type="String">
  The amount excluding the VAT.
</ResponseField>

<ResponseField name="amount_including_vat" type="String">
  The sum of the base amount and the VAT, i.e., `amount_excluding_vat` + `vat_amount`.
</ResponseField>

<ResponseField name="vat_amount" type="String">
  The calculated amount of VAT.
</ResponseField>

<ResponseField name="vat_category" type="String">
  The category of the purchase, used to determine whether it qualifies for a reduced rate. See below for a list of supported categories.
</ResponseField>

<ResponseField name="vat_rate" type="String">
  The VAT rate as a decimal string (e.g., "0.190" for 19%).
</ResponseField>

<ResponseField name="country" type="Object">
  Object containing country information.
</ResponseField>

<ResponseField name="country.code" type="String">
  The two letter ISO 3166-1 alpha-2 code of the country in which the transaction takes place.
</ResponseField>

<ResponseField name="country.name" type="String">
  The name of the country the VAT is being calculated from.
</ResponseField>
