Skip to content

Get category collection (storefront callers see published categories only)​

GET
/rest/v1/product/category

Storefront callers — guest (no token) and customer — receive only published categories (shop_product_category.published = 1): filter[published] is server-forced to 1 for them, so a supplied value is ignored rather than combined. This is LEGACY PARITY, not a tightening: every storefront read in Adv_product_category_model already gates the flag — the root menu (:265), the anchor tree (:374-:394), the child listing (:957), the vendor and sitemap trees (:1436, :1444) and the product-join listing (:1905, :1936) all constrain published = 1 — while REST published the flag as a freely settable filter and merely hid it from the projection. THE ROW RULE AND THE RELATION RULE ARE DELIBERATELY NOT THE SAME RULE: this endpoint tests a category OWN published flag, whereas the four scoped relations (?with=children, ?with=children*, ?with=parent, ?with=parent*, ?with=relativeCategories) apply the stricter #588 ANCESTOR-CHAIN rule. So a category that is published beneath an UNPUBLISHED ancestor is still listed here while correctly vanishing from those embeds. That asymmetry is intended, not an oversight — forcing a filter sets a scalar and cannot express the ancestor walk — and it errs toward showing MORE on the endpoint, never less. ?with=articles is scoped too: unpublished blog articles are withheld from it. Backend callers are unaffected and may filter and sort by filter[published] freely.

Parameters​

Query Parameters

filter[id]

Filter by category IDs

Type
string
filter[parentId]

Filter by parent ID

Type
string
filter[published]

Filter by published status. Backend callers only — for storefront (guest/customer) callers this value is server-forced to 1 and any supplied value is ignored.

Type
boolean
filter[isSensitive]

Filter by sensitive status

Type
boolean
filter[hasSellableProducts]

Keep only categories whose PUBLISHED SUBTREE holds at least one SELLABLE product (active, not soft-deleted, price > 0, and negative_stock = 1 or an active, non-soft-deleted product code with stock > 0). Subtree means exactly what filter[categoryDescendantId] expands to on GET /rest/product/product: the category itself when published, plus descendants reached through published children only — so a published parent with no direct products is kept when a descendant sells, and an unpublished category is never kept. 1, true, yes or on applies it; 0, empty or any other value applies no filter (it never inverts to empty categories).

Type
boolean
filter[name.el]

Filter by category name (Greek)

Type
string
filter[name.en]

Filter by category name (English)

Type
string
filter[slug.el]

Filter by category slug (Greek)

Type
string
filter[slug.en]

Filter by category slug (English)

Type
string
sort

Sort order

Type
string
page

Page number

Type
integer
limit

Pagination limit

Type
integer
with

With relations (e.g., translations,parent,children)

Type
string

Responses​

Successful operation

application/json
JSON
"string"

Playground​

Variables
Key
Value

Samples​

Powered by VitePress OpenAPI