# Tax classes

Group products by tax treatment and manage the default class through the Store API.

Tax classes belong to a market and use `read_markets` / `write_markets`. They describe what is being taxed; tax zones describe where, and rate lines connect the two. Fetch the limits endpoint before rendering lists or forms. Names are unique within the market, ignoring case. Slugs are generated when omitted and validated exactly when supplied. A market always retains one default class.

## 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.

## Model product tax treatment

A tax class groups products that receive the same treatment inside one market. Create classes such as Standard, Reduced rate, or Exempt, then assign products or variants to them. Rates connect each class to each tax zone. Products without an assignment use the market's default class.

## Create a class

```json
// POST /api/2025-01/markets/{marketId}/tax-classes
{
  "name": "Reduced rate",
  "slug": "reduced-rate",
  "description": "Books and qualifying essentials",
  "is_default": false
}
```

Fetch the limits endpoint before building a form or picker. Deleting a class that still owns rates, product assignments, variant assignments, or price-based rules uses the confirmation handshake before anything is removed. A class used by shipping, checkout fees, cash on delivery, or payment adjustments cannot be deleted until those use another class.

## Endpoints

## Get tax class limits

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

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

Scope: `read_markets`

Response:

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

## List tax classes

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

Returns paginated tax classes, searchable by name. Every market starts with one default class; `is_default` marks it. Pagination and search bounds come from the limits endpoint.

Scope: `read_markets`

Response:

```json
{
  "success": true,
  "data": {
    "tax_classes": [{
    "id": "4e2b8c1a-7f3d-4a5b-9c6d-1e0f2a3b4c5d",
    "store_id": "1f0e2d3c-4b5a-6978-8695-a4b3c2d1e0f9",
    "market_id": "9a1f2c3d-4e5f-6789-abcd-ef0123456789",
    "name": "Reduced rate",
    "slug": "reduced-rate",
    "description": "Food, books, and other reduced-rate goods",
    "is_default": false,
    "created_at": "2026-07-01T06:15:00-04:00",
    "updated_at": "2026-07-09T14:40:00-04:00"
  }],
    "total": 1
  }
}
```

## Create a tax class

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

Creates a tax class. `name` is required. Omit `slug` to have one generated from the name — generation transliterates per the store's default locale and suffixes `-2`, `-3`, … on collision; a slug you provide is validated exactly as sent (lowercase letters, numbers, and hyphens) and rejected on duplicate rather than rewritten. Setting `is_default` makes this the market's default class and clears the previous default in the same write. Fires `tax_classes/create`.

Scope: `write_markets`

Response:

```json
{
  "success": true,
  "data": {
    "tax_class": {
    "id": "4e2b8c1a-7f3d-4a5b-9c6d-1e0f2a3b4c5d",
    "store_id": "1f0e2d3c-4b5a-6978-8695-a4b3c2d1e0f9",
    "market_id": "9a1f2c3d-4e5f-6789-abcd-ef0123456789",
    "name": "Reduced rate",
    "slug": "reduced-rate",
    "description": "Food, books, and other reduced-rate goods",
    "is_default": false,
    "created_at": "2026-07-01T06:15:00-04:00",
    "updated_at": "2026-07-09T14:40:00-04:00"
  }
  }
,"code":"TAX_CLASS_CREATED","message":"Tax class created."}
```

## Get a tax class

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

Returns the tax class.

Scope: `read_markets`

Response:

```json
{
  "success": true,
  "data": {
    "tax_class": {
    "id": "4e2b8c1a-7f3d-4a5b-9c6d-1e0f2a3b4c5d",
    "store_id": "1f0e2d3c-4b5a-6978-8695-a4b3c2d1e0f9",
    "market_id": "9a1f2c3d-4e5f-6789-abcd-ef0123456789",
    "name": "Reduced rate",
    "slug": "reduced-rate",
    "description": "Food, books, and other reduced-rate goods",
    "is_default": false,
    "created_at": "2026-07-01T06:15:00-04:00",
    "updated_at": "2026-07-09T14:40:00-04:00"
  }
  }
}
```

## Update a tax class

`PUT /api/2025-01/markets/{marketId}/tax-classes/{taxClassId}`

Updates the tax class's name, slug, description, and default flag. `name` is required; `slug`, `description` and `is_default` keep their saved values when omitted, so `{"name": "Standard rate"}` renames the class and changes nothing else. A provided slug is validated as-is and rejected on duplicate; an empty slug is refused with `TAX_CLASS_SLUG_REQUIRED`. An empty `description` clears it. Promoting a class to default clears the previous default in the same write; a market always keeps exactly one default class, so `is_default: false` on the default class is refused with `TAX_CLASS_DEFAULT_UNSET_LOCKED`: promote another class instead. Fires `tax_classes/update`.

Scope: `write_markets`

Response:

```json
{
  "success": true,
  "data": {
    "tax_class": {
    "id": "4e2b8c1a-7f3d-4a5b-9c6d-1e0f2a3b4c5d",
    "store_id": "1f0e2d3c-4b5a-6978-8695-a4b3c2d1e0f9",
    "market_id": "9a1f2c3d-4e5f-6789-abcd-ef0123456789",
    "name": "Reduced rate",
    "slug": "reduced-rate",
    "description": "Food, books, and other reduced-rate goods",
    "is_default": false,
    "created_at": "2026-07-01T06:15:00-04:00",
    "updated_at": "2026-07-09T14:40:00-04:00"
  }
  }
,"code":"TAX_CLASS_UPDATED","message":"Tax class updated."}
```

## Bulk delete tax classes

`POST /api/2025-01/markets/{marketId}/tax-classes/bulk-delete`

Send 1 to `list_max_limit` unique tax-class UUIDs from the same market. The service validates the full selection before deleting anything. A default class, a class assigned to shipping, checkout fees, cash on delivery or payment adjustments, a missing class, a duplicate or malformed id, or an oversized selection rejects the whole request. If any class has dependent rates, product or variant assignments, or price rules, the first request returns all warnings and a confirmation token bound to the exact sorted selection. Repeat the identical selection with `confirmed` and `confirmation_token`. All deletions, per-class audit records, and `tax_classes/delete` webhook events commit in one transaction or all roll back.

Scope: `write_markets`

Response:

```json
{
  "success": true,
  "data": {
    "deleted_ids": ["4e2b8c1a-7f3d-4a5b-9c6d-1e0f2a3b4c5d"]
  }
}
```

## Delete a tax class

`DELETE /api/2025-01/markets/{marketId}/tax-classes/{taxClassId}`

Deletes the tax class together with its rates, product and variant assignments, and price rules. Only `tax_classes/delete` is published: the rates and price rules deleted with it send no `tax_rates/delete` or `tax_price_rules/delete`, so re-sync them from the class id. The default class can't be deleted — promote another class first. Shipping settings and shipping methods must be reassigned before deleting their tax class (`TAX_CLASS_SHIPPING_ASSIGNED`), and so must checkout fees, cash-on-delivery settings and payment adjustments (`TAX_CLASS_CHARGES_ASSIGNED`). When the class still has dependents, the first call returns a confirmation response listing what will be removed; retry with `confirmed` and the returned `confirmation_token` to proceed. Products left without a class are taxed by the market's default class. Fires `tax_classes/delete`.

Scope: `write_markets`

Response:

```json
{
  "success": true,
  "data": { "success": true }
,"code":"TAX_CLASS_DELETED","message":"Tax class deleted."}
```

## Webhook events

Tax-class events are published for every create, update, and confirmed delete. Making a class the default also publishes an update for the class that stops being the default. The saved change and its event become visible together. Delete payloads preserve the class identity after its dependent data has been removed.

## Tax class created

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

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

```json
{
  "tax_class": {
    "created_at": "2026-06-09T12:00:00-04:00",
    "description": "Books and qualifying essentials",
    "id": "4e2b8c1a-7f3d-4a5b-9c6d-1e0f2a3b4c5d",
    "is_default": false,
    "market_id": "9a1f2c3d-4e5f-6789-abcd-ef0123456789",
    "name": "Reduced rate",
    "slug": "reduced-rate",
    "updated_at": "2026-06-09T12:00:00-04:00"
  }
}
```

## Tax class updated

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

Subscribe to receive the current tax class after its name, slug, description, or default status changes.

```json
{
  "changed_fields": [
    "name"
  ],
  "tax_class": {
    "created_at": "2026-06-09T12:00:00-04:00",
    "description": "Books and qualifying essentials",
    "id": "4e2b8c1a-7f3d-4a5b-9c6d-1e0f2a3b4c5d",
    "is_default": false,
    "market_id": "9a1f2c3d-4e5f-6789-abcd-ef0123456789",
    "name": "Reduced rate",
    "slug": "reduced-rate",
    "updated_at": "2026-06-09T12:00:00-04:00"
  }
}
```

## Tax class deleted

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

Subscribe to remove a deleted tax class from your integration. The payload keeps its id, market id, last known name, and slug.

```json
{
  "tax_class": {
    "id": "4e2b8c1a-7f3d-4a5b-9c6d-1e0f2a3b4c5d",
    "market_id": "9a1f2c3d-4e5f-6789-abcd-ef0123456789",
    "name": "Reduced rate",
    "slug": "reduced-rate"
  }
}
```

