Tax

Tax calculation combines the price’s tax behavior, the buyer’s address context, a resolved rate, and the store’s tax rounding mode.

Inclusive and exclusive prices

Each variant price and shipping rate can declare a TaxBehavior:

  • INCLUSIVE means tax is already contained in the stored amount.
  • EXCLUSIVE means tax is calculated and added to the stored amount.

Use one deliberate convention per market where possible. Mixed behavior is supported by the data model but requires careful display and reconciliation.

For a 25% rate, an exclusive net amount of EUR 100.00 produces EUR 25.00 tax and EUR 125.00 gross. An inclusive EUR 125.00 amount contains EUR 25.00 tax and has a EUR 100.00 net amount. Real carts can round at line and tax boundaries, so render Thor’s returned totals instead of deriving them from display strings.

Platform VAT rates

The vatRates query resolves rates by ISO country code and an effective date. A result exposes the winning rate as a fraction—for example, 0.25 for 25%—its effective window and source, and the next known rate when one is scheduled.

Thor distinguishes platform-maintained standard rates from tenant-defined overrides. Use vatRateOverrides to inspect project overrides and create a dated override only when your project must replace the standard rate. Avoid overlapping override windows for the same country.

vatRateCatalogStatus exposes the health and last successful synchronization time of the shared VAT catalog.

External tax configuration

An external tax configuration associates a store with an external tax API URL. Use it when that store’s tax calculation is delegated to an integration. Treat the endpoint as checkout-critical infrastructure: secure it, monitor it, and make its timeout and failure behavior part of your checkout runbook.

Addresses and rounding

Provide a country code and the address fields required by your tax setup before expecting final taxed totals. A store has separate default rounding modes for price and tax calculations. Display the Money, TaxedPrice, and TaxPortion values returned by Thor rather than recomputing customer-facing totals with floating-point arithmetic.

API reference