# Tax zones

Define the countries and subdivisions where market tax rates apply.

Tax zones belong to a market and use `read_markets` / `write_markets`. A zone may cover only countries assigned to that market. Geography is validated and overlap is rejected, so an address resolves to one specific zone or the optional default zone. Rates owned by a deleted zone are removed only after the confirmation handshake reports the impact.

## General tax settings

Three settings on the market itself decide how all of this applies: `tax_enabled` (whether tax is collected at all; when false, orders in the market carry no tax whatever the classes, zones and rates say), `tax_included` (whether catalog prices are entered with tax included) and `tax_display_mode` (`inclusive` or `exclusive`: how storefront prices are shown, independently of how they are entered). Read them on the market and change them with Update a market (`PATCH /api/2025-01/markets/{marketId}`) on the [Markets](/store-api/markets/markets) page; changing `tax_included` asks for confirmation first. New markets collect tax with tax-exclusive prices, shown without tax.

## Match an order to a jurisdiction

A tax zone describes where a set of rates applies. Its countries must belong to the market, and subdivisions are codes from `province.options` in `GET /reference/address-format/{country}` such as `US-CA` (codes match ignoring case; names are refused with `SUBDIVISION_INVALID`; reads add `subdivisions_display`). Specific zones are matched before the optional default zone. If no zone matches and no default exists, Tringify returns zero zone tax and marks the calculation as unmatched.

Tringify checks tax ID formats and check digits only. It does not verify registrations or exemptions with tax authorities. You are responsible for your tax settings. In a zone with an enabled exemption and effect exempt, a valid tax ID entered for the order removes the tax. With effect invoice_only, tax is always charged and the tax ID marks the order for a business invoice. Orders record the applied source as tax_id or none. Customers keep no tax ID: the shopper enters it for each order and receives field errors. EU VAT uses national published checksum rules; Czech nine-digit birth numbers and Latvian personal numbers receive structural checks only. Canadian BN uses MOD10. Order edits recalculate the identity type, applied exemption source and GSTIN state mismatch with the tax totals.

## Create a zone

```json
// POST /api/2025-01/markets/{marketId}/tax-zones
{
  "name": "California",
  "description": "California shipping addresses",
  "countries": ["US"],
  "subdivisions": ["US-CA"],
  "is_default": false
}
```

Use the available-countries endpoint when building geography controls. It returns market countries together with their subdivision choices and existing zone claims. Business-tax exemption settings belong to the zone because the applicable treatment depends on the jurisdiction that matched the order. Tringify assigns `priority` itself, in creation order; zones never overlap, so it does not change which zone an address matches.

## Endpoints

## Get tax zone limits

`GET /api/2025-01/markets/tax-zones/limits`

Returns the live tax-zone limits — the per-market cap and the name, description, and search length caps (all counted in characters), plus list pagination bounds. Read this instead of hardcoding numbers.

Scope: `read_markets`

Response:

```json
{
  "success": true,
  "data": {
    "limits": {
      "max_per_market": 200,
      "name_max_length": 100,
      "description_max_length": 500,
      "list_page_size": 20,
      "list_max_limit": 200,
      "search_max_length": 100,
      "page_size_options": [10, 20, 50, 100, 200]
    }
  }
}
```

## Get available countries

`GET /api/2025-01/markets/{marketId}/tax-zones/available-countries`

Returns every country in the market stamped with its claim status across the market's zones: `fully_claimed` (a country fallback already exists, named in `claimed_by_zone`) and `claimed_subdivisions` (subdivisions other zones already took). Both can be present for one country. A country fallback does not prevent creating a zone for its unclaimed subdivisions; it only prevents another zone from covering that country whole, that is, listing it with none of its subdivisions. Build zone pickers from this — the server's verdict is the only source of what is still claimable. Pass `exclude_zone_id` when editing a zone so its own claims don't count against it.

Scope: `read_markets`

Response:

```json
{
  "success": true,
  "data": {
    "countries": [
      {
        "code": "DE",
        "name": "Germany",
        "fully_claimed": true,
        "claimed_by_zone": "European Union"
      },
      {
        "code": "US",
        "name": "United States",
        "fully_claimed": false,
        "claimed_subdivisions": ["US-CA"],
        "claimed_subdivisions_display": ["California"]
      }
    ]
  }
}
```

## List tax zones

`GET /api/2025-01/markets/{marketId}/tax-zones`

Returns paginated tax zones, searchable by name. Each zone carries `rate_count` — how many rate lines it holds — and `is_default` marks the market's catch-all zone if one exists. A market is not required to have a default zone: addresses no zone covers are sold with zero tax, and the tax calculation reports `tax_zone_unmatched`. Pagination and search bounds come from the limits endpoint.

Scope: `read_markets`

Response:

```json
{
  "success": true,
  "data": {
    "tax_zones": [{
    "id": "7c9e4f2b-1a3d-4e5f-8b6c-2d0e1f3a4b5c",
    "market_id": "9a1f2c3d-4e5f-6789-abcd-ef0123456789",
    "name": "European Union",
    "description": "EU member states",
    "countries": ["DE", "FR"],
    "subdivisions": [],
    "subdivisions_display": [],
    "is_default": false,
    "priority": 0,
    "tax_exemption": {
      "enabled": true,
      "type": "eu_vat",
      "effect": "invoice_only",
      "type_mismatch": false,
      "checkout_text": "Enter your EU VAT number.",
      "translations": {}
    },
    "rate_count": 2,
    "created_at": "2026-07-01T06:15:00-04:00",
    "updated_at": "2026-07-09T14:40:00-04:00"
  }],
    "total": 1
  }
}
```

## Create a tax zone

`POST /api/2025-01/markets/{marketId}/tax-zones`

Creates a tax zone. `name` is required and unique within the market. A regular zone needs at least one country or subdivision; every country must belong to the market, every subdivision must be a known ISO subdivision belonging to a selected country, and duplicate subdivision claims or duplicate whole-country claims are rejected. A whole-country zone with an empty `subdivisions` array can coexist with state-specific zones: state matches win, then the country zone covers the rest. For example, a zone with `countries: ["US"]` and `subdivisions: ["US-CA"]` handles California; a second zone with `countries: ["US"]` and `subdivisions: []` handles the rest of the United States. Only the matching zone’s rates apply. One zone can list whole countries and subdivisions of other countries together: each listed country with at least one listed subdivision is claimed only for those subdivisions, and a listed country with none of its subdivisions listed is claimed whole, except subdivisions other zones claim. So `countries: ["CA", "US"]` with `subdivisions: ["CA-ON"]` covers Ontario and all of the US. Addresses are matched with country and state trimmed and case-insensitive, and a state matches a subdivision zone by the address's subdivision code (`CA-ON`); every address write stores the code, whatever spelling it was sent with. When a country has subdivision zones and the address has no state, or one that isn't recognised, tax is not taken from the country zone: the tax calculation reports `tax_zone_unmatched: true` with `tax_zone_needs_state: true` and reports unresolved tax until a recognised state is given. Operational order creation is refused with `ORDER_TAX_ZONE_NEEDS_STATE` and `details.tax_zone_needs_state: true`; it cannot create a payable zero-tax order. A recognised state that no subdivision zone covers uses the whole-country zone. Setting `is_default` instead creates the market's catch-all zone for unmatched addresses; while another zone is the default, that is refused with `TAX_ZONE_DEFAULT_EXISTS`. The optional `tax_exemption` object sets the business treatment: `exempt` removes tax when the buyer enters a valid tax ID, and `invoice_only` keeps tax and marks the order for a business invoice when the buyer enters one. Fires `tax_zones/create`.

Scope: `write_markets`

Response:

```json
{
  "success": true,
  "data": {
    "tax_zone": {
    "id": "7c9e4f2b-1a3d-4e5f-8b6c-2d0e1f3a4b5c",
    "market_id": "9a1f2c3d-4e5f-6789-abcd-ef0123456789",
    "name": "European Union",
    "description": "EU member states",
    "countries": ["DE", "FR"],
    "subdivisions": [],
    "subdivisions_display": [],
    "is_default": false,
    "priority": 0,
    "tax_exemption": {
      "enabled": true,
      "type": "eu_vat",
      "effect": "invoice_only",
      "type_mismatch": false,
      "checkout_text": "Enter your EU VAT number.",
      "translations": {}
    },
    "rate_count": 2,
    "created_at": "2026-07-01T06:15:00-04:00",
    "updated_at": "2026-07-09T14:40:00-04:00"
  }
  }
,"code":"TAX_ZONE_CREATED","message":"Tax zone created."}
```

## Get a tax zone

`GET /api/2025-01/markets/{marketId}/tax-zones/{taxZoneId}`

Returns the tax zone, with `rate_count`, the number of rate lines it holds.

Scope: `read_markets`

Response:

```json
{
  "success": true,
  "data": {
    "tax_zone": {
    "id": "7c9e4f2b-1a3d-4e5f-8b6c-2d0e1f3a4b5c",
    "market_id": "9a1f2c3d-4e5f-6789-abcd-ef0123456789",
    "name": "European Union",
    "description": "EU member states",
    "countries": ["DE", "FR"],
    "subdivisions": [],
    "subdivisions_display": [],
    "is_default": false,
    "priority": 0,
    "tax_exemption": {
      "enabled": true,
      "type": "eu_vat",
      "effect": "invoice_only",
      "type_mismatch": false,
      "checkout_text": "Enter your EU VAT number.",
      "translations": {}
    },
    "rate_count": 2,
    "created_at": "2026-07-01T06:15:00-04:00",
    "updated_at": "2026-07-09T14:40:00-04:00"
  }
  }
}
```

## Update a tax zone

`PUT /api/2025-01/markets/{marketId}/tax-zones/{taxZoneId}`

Updates the zone's name, description, regions, default flag, and business tax exemption. Send only the fields to change: every field you leave out keeps its saved value, so `{"description": "EU member states"}` changes the description and nothing else. `countries` and `subdivisions`, when sent, replace their whole lists; an empty `description` clears it. Region rules apply to the zone as it is after the update and match create: regular zones need at least one country or subdivision, all regions must be claimable, and the default zone must have none. To make a regular zone the default, send `is_default: true` with empty `countries` and `subdivisions`. A market has at most one default zone: while another zone is the default, `is_default: true` is refused with `TAX_ZONE_DEFAULT_EXISTS` and nothing changes. Give the current default countries or subdivisions and set its `is_default` to false first, so no zone is ever left matching no address. Turning off the default of the default zone requires countries or subdivisions in the same request. Fires `tax_zones/update` with `changed_fields`.

Scope: `write_markets`

Response:

```json
{
  "success": true,
  "data": {
    "tax_zone": {
    "id": "7c9e4f2b-1a3d-4e5f-8b6c-2d0e1f3a4b5c",
    "market_id": "9a1f2c3d-4e5f-6789-abcd-ef0123456789",
    "name": "European Union",
    "description": "EU member states",
    "countries": ["DE", "FR"],
    "subdivisions": [],
    "subdivisions_display": [],
    "is_default": false,
    "priority": 0,
    "tax_exemption": {
      "enabled": true,
      "type": "eu_vat",
      "effect": "invoice_only",
      "type_mismatch": false,
      "checkout_text": "Enter your EU VAT number.",
      "translations": {}
    },
    "rate_count": 2,
    "created_at": "2026-07-01T06:15:00-04:00",
    "updated_at": "2026-07-09T14:40:00-04:00"
  }
  }
,"code":"TAX_ZONE_UPDATED","message":"Tax zone updated."}
```

## Delete a tax zone

`DELETE /api/2025-01/markets/{marketId}/tax-zones/{taxZoneId}`

Deletes the tax zone. If it still has rate lines, the first call returns `CONFIRMATION_REQUIRED`; retry with `confirmed` and the returned `confirmation_token`. The token is for that number of rate lines: if lines are added before the retry, the zone asks for confirmation again. Cascaded rate lines do not fire individual `tax_rates/delete` events, so re-sync rates after the `tax_zones/delete` event. The default zone can't be deleted while it is the default. After deletion, addresses are matched again: any remaining state-specific zone wins, then a whole-country zone, then the default zone. If none matches, no tax is applied.

Scope: `write_markets`

Response:

```json
{
  "success": true,
  "data": { "success": true }
,"code":"TAX_ZONE_DELETED","message":"Tax zone deleted."}
```

## Webhook events

Tax-zone events are published for every write, and the saved change and its event become visible together. Making a zone the default also publishes an update for the zone that stops being the default. Update payloads contain the complete saved geography and exemption configuration; delete payloads retain the removed zone's identity.

## Tax zone created

Event: `tax_zones/create` · App scope: `read_markets` · Staff permission: `markets:write`

Subscribe to receive the saved tax zone after it is created in a market.

```json
{
  "tax_zone": {
    "countries": [
      "US"
    ],
    "created_at": "2026-06-09T12:00:00-04:00",
    "description": "California shipping addresses",
    "id": "7c9e4f2b-1a3d-4e5f-8b6c-2d0e1f3a4b5c",
    "is_default": false,
    "market_id": "9a1f2c3d-4e5f-6789-abcd-ef0123456789",
    "name": "California",
    "priority": 10,
    "rate_count": 2,
    "subdivisions": [
      "US-CA"
    ],
    "subdivisions_display": [
      "California"
    ],
    "tax_exemption": {
      "checkout_text": "Enter your business tax ID for your invoice.",
      "effect": "exempt",
      "enabled": true,
      "translations": {},
      "type": "ein",
      "type_mismatch": false
    },
    "updated_at": "2026-06-09T12:00:00-04:00"
  }
}
```

## Tax zone updated

Event: `tax_zones/update` · App scope: `read_markets` · Staff permission: `markets:write`

Subscribe to receive the current tax zone after its geography, priority, default status, or exemption settings change.

```json
{
  "changed_fields": [
    "countries",
    "subdivisions",
    "subdivisions_display"
  ],
  "tax_zone": {
    "countries": [
      "US"
    ],
    "created_at": "2026-06-09T12:00:00-04:00",
    "description": "California shipping addresses",
    "id": "7c9e4f2b-1a3d-4e5f-8b6c-2d0e1f3a4b5c",
    "is_default": false,
    "market_id": "9a1f2c3d-4e5f-6789-abcd-ef0123456789",
    "name": "California",
    "priority": 10,
    "rate_count": 2,
    "subdivisions": [
      "US-CA"
    ],
    "subdivisions_display": [
      "California"
    ],
    "tax_exemption": {
      "checkout_text": "Enter your business tax ID for your invoice.",
      "effect": "exempt",
      "enabled": true,
      "translations": {},
      "type": "ein",
      "type_mismatch": false
    },
    "updated_at": "2026-06-09T12:00:00-04:00"
  }
}
```

## Tax zone deleted

Event: `tax_zones/delete` · App scope: `read_markets` · Staff permission: `markets:write`

Subscribe to remove a deleted tax zone from your integration. Its rate lines are removed with it without separate tax_rates/delete events, so use the zone id to refresh affected rates.

```json
{
  "tax_zone": {
    "id": "7c9e4f2b-1a3d-4e5f-8b6c-2d0e1f3a4b5c",
    "market_id": "9a1f2c3d-4e5f-6789-abcd-ef0123456789",
    "name": "California"
  }
}
```

