abstract_api.vat.vat module#

class abstract_api.vat.vat.VAT(api_key: str | None = None)[source]#

Bases: BaseService

AbstractAPI VAT categories, validation, and calculation service.

Used to validate and calculate VAT numbers and also to inquery about VAT categories.

Attributes:

_subdomain: VAT service subdomain.

calculate(amount: float, country_code: str, is_vat_incl: bool | None = None, vat_category: str | None = None) VATCalculationResponse[source]#

Calculates a VAT compliant price given a country and price.

Args:
amount: The amount that you would like to get the VAT amount

for or from.

country_code: The two-letter ISO 3166-1 alpha-2 code of the

country in which the transaction takes place.

is_vat_incl: 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.

vat_category: 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.

Returns:

VATCalculationResponse representing API call response.

categories(country_code: str) VATCategoriesResponse[source]#

Gets the list of VAT categories for a country.

Args:
country_code: The two-letter ISO 3166-1 alpha-2 code of the

country in which the transaction takes place.

Returns:

VATCategoriesResponse representing API call response.

check(vat_number: str) VATValidationResponse[source]#

Validates a VAT number.

Args:

vat_number: The VAT number to validate.

Returns:

VATValidationResponse representing API call response.