Calculate VAT.
This endpoint allows you to calculate VAT on the prices of goods in a particular country.
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:
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
The two letter ISO 3166-1 alpha-2 code of the country in which the transaction takes place.
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.
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
The amount excluding the VAT.
The calculated amount of VAT.
The sum of the base amount and the VAT, i.e., amount_excl_vat
+ vat_amount
.
The VAT rate, from 0.01 to 0.99.
The optional category of the purchase, used to determine whether it qualifies for a reduced rate. See below for a list of supported categories.
The two letter ISO 3166-1 alpha-2 code of the country in which the transaction takes place.
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: