> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Introduction

## Article: Introduction

## Article Link: https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/categories/introduction.md

## Article Content:

# About the Wix Categories API


The Categories API allows you to create and manage a hierarchical tree of categories for organizing items/products in a Wix Stores catalog.

With this API, you can:
- Create, update, and delete categories.
- Build hierarchical structures with parent and subcategories.
- Add and remove items/products from categories.
- Arrange product order within categories for display.
- Retrieve categories by the specific products they contain.

## Before you begin

It's important to note the following points before starting to code:

- **Wix Stores required:** The Categories API requires Wix Stores. Make sure the user's site has the [Wix Stores app](https://www.wix.com/app-market/wix-stores) installed.
- **Catalog version:** The Categories API currently works exclusively with the [Wix Stores Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/introduction.md).
- **Category tree:** A hierarchical structure that organizes all of a site's categories into parent and child (subcategory) relationships. Each Wix Stores site has one category tree.
- **Tree reference required:** All API requests require a `treeReference` object. For Wix Stores, always use `appNamespace: "@wix/stores"` and `treeKey: null`.
- **Item references:** When adding items/products to categories, use the Wix Stores app ID (`"215238eb-22a5-4c36-9e7b-e7c08025e04e"`) and the product ID as the `catalogItemId`.

## Category visibility

Categories have a `visible` property that controls whether site visitors can see them.

Key visibility behaviors:
- **Default:** Categories are visible (`visible: true`) by default.
- **Cascading:** Setting a parent category's visibility to `false` automatically hides all its subcategories.
- **Restriction:** You can't make a subcategory visible if any of its parent categories are hidden.
- **API access:** Hidden categories and their products are still accessible via API calls. To retrive them, pass `includeHiddenCategories: true` to [Search Categories](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/categories/search-categories.md) or [Query Categories](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/categories/query-categories.md).

## Item arrangement

You can arrange up to 100 items/products within a category to control their display order.

When you call [List Items In Category](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/categories/list-items-in-category.md):
- With `useCategoryArrangement: false` (default): Products are sorted by the date they were added to the category, newest first.
- With `useCategoryArrangement: true`: Manually arranged items/products appear first in their specified order, followed by remaining items/products sorted by date added.

## Managed categories

Third-party apps can create categories that only they can modify by setting the `managingAppId` field. When set, only that app can add or remove items/products from the category.

## Deleting categories

When you delete a category:
- All subcategories are also deleted (cascading delete).
- Items/products remain in the Wix Stores catalog but are no longer associated with the deleted categories.

## Limitations

- **Categories per site:** 1,000
- **Hierarchy depth:** 5 levels maximum
- **Parent categories:** Each category can have only one parent
- **Items per category:** Unlimited, but each item/product can be in up to 1,000 categories
- **Manual arrangement:** Limited to 100 items/products per category

## Sample flows

- [Create category and subcategory](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/categories/sample-use-cases-and-flows.md#create-category-and-subcategory)
- [Add and arrange items in category](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/categories/sample-use-cases-and-flows.md#add-and-arrange-items-in-category)
- [Move subcategory to a different position within a parent category](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/categories/sample-use-cases-and-flows.md#move-subcategory-to-a-different-position-within-a-parent-category)
- [Find all subcategories of a category](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/categories/sample-use-cases-and-flows.md#find-all-subcategories-of-a-category)

## Terminology

- **Tree:** A hierarchical structure of categories. Each Wix Stores site has one category tree.
- **Tree reference:** Identifies which category tree to work with. For Wix Stores, use `appNamespace: "@wix/stores"` and `treeKey: null`.
- **Top-level (root) category:** A category with no parent (`parentCategory.id` is empty or null).
- **Parent category:** The category above another category in the hierarchy. Top-level categories don't have a parent.
- **Subcategory:** A category that is nested under a parent category.
- **Sibling categories:** Categories that share the same parent category.
- **Category index:** The position of a category among its sibling categories within the same parent.
- **Breadcrumbs:** The path from the top-level category down to the current category's parent. Useful for navigation UI and SEO.
- **Item reference:** Identifies an item within a category. Includes `appId` (the Wix Stores app ID) and `catalogItemId` (the Wix Stores product ID).
- **Managing app:** An app that has exclusive control over adding and removing items from a category.

