Prompt
Why is my VAT API returning the wrong country tax rate?
Latest observation
Nov 3, 2026
OpenAI APIWeb search: off
A VAT API usually returns the “wrong” country rate for one of a few common reasons:
-
You’re querying the wrong country code
- VAT rates are country-specific, and APIs typically expect an ISO 3166-1 alpha-2 code like
DE,FR,GB,ES. - If you pass a city, locale, or non-standard code, the API may default or fail over to another country.
- VAT rates are country-specific, and APIs typically expect an ISO 3166-1 alpha-2 code like
-
You’re using the wrong rate type
- Many countries have multiple VAT rates:
- standard rate
- reduced rate
- super-reduced rate
- zero rate
- If your API returns the standard rate but you expected a reduced one, it may be behaving correctly.
- Many countries have multiple VAT rates:
-
The API uses the customer’s location, not the business location
- Some VAT systems calculate based on destination country or customer VAT status, not the seller’s country.
- For B2B transactions, VAT can depend on whether the customer has a valid VAT number.
-
The API is caching outdated tax tables
- VAT rates change over time.
- If the provider hasn’t updated its data, you may see an old rate.
-
Your request is malformed
- Missing headers, incorrect currency, or wrong transaction type can cause fallback logic.
- Example: “digital service” vs “physical goods” may produce different tax treatment.
-
Special regions are being mapped incorrectly
- Some countries have special tax regions or exemptions:
- Canary Islands
- Åland Islands
- Channel Islands
- overseas territories
- These can produce different tax treatment than the main country.
- Some countries have special tax regions or exemptions:
-
You’re seeing rounding or conversion artifacts
- If the API returns a calculated tax amount rather than a rate, rounding may make it look wrong.
- Make sure you’re comparing the rate and not the final tax amount.
-
Sandbox/test data differs from production
- Some VAT APIs use mock rates in test environments.
What to check
- Confirm the country code you’re sending
- Verify whether the API expects shipping country, billing country, or merchant country
- Check whether you’re asking for standard VAT or another rate type
- Compare the returned value against the provider’s latest documentation
- Test with a known example and inspect the raw API response
If you want, paste:
- the API endpoint,
- the request payload,
- the response you’re getting,
- and the country you expected,
and I can help pinpoint the exact issue.