Postman collection
General Read

pixiGetVATByCountries

Returns the high and low VAT rates per country that are valid at a given point in time, filtered by ISO country code and/or VAT charge flag.

Looks up VAT rates from the VAT master data (VATs) joined with the country master data (Countries) on VATs.Country = Countries.CntCode.

Parameter handling

  • Empty strings in CntCodeISO2, CntCodeISO3 and ChargeVAT are treated as not specified (NULL).
  • A Datetime earlier than 1990-01-01 is replaced by the current date and time.

Validation An error row is returned instead of data if Datetime is not specified, or if none of CntCodeISO2, CntCodeISO3 and ChargeVAT is specified. A date plus at least one further filter is therefore required.

Filtering

  • CntCodeISO2: only countries with this ISO 3166 alpha-2 code.
  • CntCodeISO3: only countries with this ISO 3166 alpha-3 code.
  • ChargeVAT: only VAT records with this ChargeVAT value.
  • Datetime: only VAT records whose validity period contains the date (DateStart <= Datetime <= DateEnd, both bounds inclusive).

All given filters are combined with AND. The result has no explicit sort order.

Notes

  • Both tables are read with NOLOCK, so uncommitted changes may be visible.
  • VAT records with a NULL in DateStart or DateEnd never match, because the date comparison is not true for NULL.
  • Passing a very old date (before 1990) silently returns the currently valid rates instead of historical ones.
  • DateEnd is compared inclusively including the time part; if DateEnd is stored as midnight, a Datetime later on that day no longer matches.
  • The meaning of the ChargeVAT values is not defined in this procedure; it depends on the content of the VATs table.
  • Several rows per country can be returned, e.g. one per ChargeVAT value, if only a country code is given.

Tables used

VATs · Read Countries · Read
SQL object:
dbo.pipiGetVATByCountries
Updated at 2026-10-30