Skip to main content

Description

The VatAPI.calculate() method is used to communicate with this endpoint as seen below: VatAPI.calculate(amount, country_code, Optional[is_vat_incl, vat_category])

Query Parameters

Below are the query parameters for this method:
String
required
The amount that you would like to get the VAT amount for or from.
  • For: That is, vat is not included in the price and you want to add it.
  • From: That is, vat is already included in the price and you want to extract it
String
required
The two letter ISO 3166-1 alpha-2 code of the country in which the transaction takes place.
Boolean
Used to declare if vat fee has already been included in the amount. If the amount already has VAT added, set this to True. The response data will split out the amount and VAT. If this parameter is not set, it will default to false.
String
Some countries offer a reduced VAT rate for certain categories of goods. To determine if a reduced VAT is available and to apply it to the final amount, include the vat_category in the request.

Usage

Below is a code snippet to query the VatAPI.calculate() method:
Below is the response object:

Response Fields

Float
The amount excluding the VAT.
Float
The calculated amount of VAT.
Float
The sum of the base amount and the VAT, i.e., amount_excl_vat + vat_amount.
Float
The VAT rate, from 0.01 to 0.99.
String
The optional category of the purchase, used to determine whether it qualifies for a reduced rate. See below for a list of supported categories.
String
The two letter ISO 3166-1 alpha-2 code of the country in which the transaction takes place.
String
The name of the country the VAT is being calculated from.

Using optional arguments

Below is a code snippet on how to use optional arguments in the VatAPI.calculate() method:
Below is the response object: