> For the complete documentation index, see [llms.txt](https://docs.commercelayer.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.commercelayer.io/core-api-reference/tax_rules.md).

# Tax rules

The tax rule object and the allowed CRUD operations on the related resource endpoint

Create a tax rule to be associated with a [manual tax calculator](/core-api-reference/manual_tax_calculators.md). Use the available regular expressions to match the order shipping address and apply the specified `tax_rate` (default is `0`). You can optionally define the tax rule taxable preferences by setting the `freight_taxable`, `payment_method_taxable`, `gift_card_taxable`, and `adjustment_taxable` attributes to `true` (all `false` by default).

{% hint style="info" %}
Manual tax calculators support **location-based** tax rules only, meaning that they can evaluate RegEx (max **5000** chars allowed) to match the shipping address country, state, and zip codes. For any other use case please consider creating an [external tax calculator](/core-api-reference/external_tax_calculators.md) that handles your own custom tax calculation logic or leveraging our out-of-the-box integrations with [Avalara](/core-api-reference/avalara_accounts.md), [Stripe Tax](/core-api-reference/stripe_tax_accounts.md), [TaxJar](/core-api-reference/taxjar_accounts.md), and [Vertex](/core-api-reference/vertex_accounts.md).
{% endhint %}

<details>

<summary>Data model</summary>

Check the related [ER diagram](/data-model/payments-and-tax/tax-calculation.md) and explore the flowchart that illustrates how the tax rule resource relates to the other API entities.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.commercelayer.io/core-api-reference/tax_rules.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
