# Tax rules

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: 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/core-api-reference/tax_rules.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.
