abstract_api.vat package#
Submodules#
Module contents#
- class abstract_api.vat.VAT(api_key: str | None = None)[source]#
Bases:
BaseServiceAbstractAPI 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.
- class abstract_api.vat.VATCalculationResponse(response: Response)[source]#
Bases:
NestedEntitiesMixin,JSONResponseVAT calculation service response.
- property amount_excluding_vat: str | None#
The amount excluding the VAT.
- property amount_including_vat: str | None#
The sum of the base amount and the VAT.
It is amount_excl_vat + vat_amount.
- property vat_amount: str | None#
The calculated amount of VAT.
- property vat_category: str | None#
The optional category of the purchase.
Used to determine whether it qualifies for a reduced rate.
- property vat_rate: str | None#
The VAT rate, from 0.01 to 0.99.
- class abstract_api.vat.VATCategoriesResponse(response: Response)[source]#
Bases:
JSONResponseVAT categories service response.
- class abstract_api.vat.VATValidationResponse(response: Response)[source]#
Bases:
NestedEntitiesMixin,JSONResponseVAT validation service response.
- property valid: bool | None#
Is true if the submitted VAT number is valid.
- property vat_number: str | None#
The submitted VAT number.