> For the complete Lynkow documentation index in agent-friendly format, see [llms.txt](/llms.txt).

# Get the product category tree

**Published**: 2026-11-30
**Category**: Commerce

## `GET /product-categories/tree`

**Get the product category tree**

Returns the visible product categories as a list of root categories, each nesting its
`children`, siblings in `position` order. An inactive or internal category is left out
with its whole branch.

With `locale`, each category is served in the requested locale or its fallback chain:
base language (`fr-CA` to `fr`), site default locale, then its own language. A locale
the site does not enable counts as a missing translation.

Errors: 404 `PRODUCT_CATEGORY_NOT_FOUND` when the site does not use product
categories, 422 for a non-boolean `fallback`.

> **Note:** Available only on sites with e-commerce enabled.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") |
| `fallback` | query | boolean (default true) | No | With `locale`, `false` drops each category not translated into the requested locale, with its branch. Single-language sites ignore it |


### Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |
| `401` | Missing or invalid storefront publishable key |
| `402` | The site subscription does not currently permit this operation |
| `403` | The storefront key origin is not allowed |
| `404` | Site, resource, or commerce feature not found |
| `422` | Validation error |


### SDK

```typescript
import { createClient } from 'lynkow'

const lynkow = createClient({
  siteId: process.env.LYNKOW_SITE_ID!,
  publishableKey: process.env.LYNKOW_PK,
})

const roots = await lynkow.productCategories.tree({ locale: 'fr' })
for (const root of roots) {
  console.log(root.name, root.path, root.children.map((child) => child.name))
}
```

---