Skip to main content

How to get the category tree

Categories organize products in the PIM and often map to external taxonomy on marketplaces.

Prerequisites

Step 1 — List categories

curl -s "https://api.catazenta.com/v1/categories?page=1&page_size=100" \
-H "Authorization: Bearer ${TOKEN}" \
-H "X-Tenant-Id: ${TENANT}"

Each item typically includes:

FieldUse
idAssign to products (category_ids)
codeStable identifier in imports
parent_idBuild tree — null = root
labelDisplay name (may be localized)

Step 2 — Build the tree in code

roots = categories where parent_id is null
for each root:
children = categories where parent_id = root.id
recurse

Paginate if total exceeds page_sizePagination.

Step 3 — Assign categories to a product

When creating or updating a product, pass category IDs:

curl -s -X PATCH "https://api.catazenta.com/v1/products/PRODUCT_UUID" \
-H "Authorization: Bearer ${TOKEN}" \
-H "X-Tenant-Id: ${TENANT}" \
-H "Content-Type: application/json" \
-d '{"category_ids": ["CATEGORY_UUID"]}'

Use the most specific leaf node that fits the SKU.

Step 4 — Channel mappings (marketplaces)

Internal categories often map to Amazon browse nodes or other external taxonomies:

  1. Configure the Amazon connector or channel settings.
  2. Map internal category → external node per export profile.
  3. Validate with a small export job.

UI guide: Categories & channels.

UI equivalent

Categories in the PIM shows the same tree — drag-and-drop ordering depends on tenant configuration.

Next steps