# Tax calculation

<figure><img src="/files/lJ18MoZxEhiltMmSweWN" alt=""><figcaption></figcaption></figure>

{% hint style="info" icon="lightbulb" %}
Commerce Layer automatically calculates taxes at checkout using a configurable calculator per market — you can use a supported third-party service, an external integration, or define your own rules manually.
{% endhint %}

## Tax calculators

Taxes are automatically calculated at checkout. If the price list associated with a market does not include taxes, the tax is added to the order total and customers are charged. If the price list includes taxes, the tax is only reflected in the order summary. [Tax calculators](/core-api-reference/tax_calculators.md) use the merchant's address and the shipping address to determine the order's tax rate.

An organization can have one or more tax calculators. You can connect a tax calculator to a market, and all taxes for orders in that market will be calculated automatically. Commerce Layer currently supports **Avalara**, **Stripe Tax**, **TaxJar**, and **Vertex**, plus the option to use a [manual tax calculator](/core-api-reference/manual_tax_calculators.md) or implement custom logic via [external tax calculators](/core/external-resources/external-tax-calculators.md). If you use a manual calculator, you must define its tax rules manually — third-party calculators already provide their own rules by default.

## Tax categories

[Tax categories](/core-api-reference/tax_categories.md) are defined for all SKUs that have special taxation. They are used by the tax calculators that support them — currently Avalara, Stripe Tax, and TaxJar — to determine any reduced tax rate for SKUs.

## Tax rules

[Tax rules](/core-api-reference/tax_rules.md) are associated with manual calculators. They allow you to define matching rules based on the shipping address, unlike third-party calculators which provide tax rules by default. You can use regular expressions to filter shipping addresses by country, state code, and zip code — the applicable tax rule is then determined by matching the order's shipping address against the defined expressions.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.commercelayer.io/data-model/payments-and-tax/tax-calculation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
