Categories
Create categories
Create new categories with hierarchical structure and slug-based paths. Categories organize products into logical groups and support nested hierarchies.
When creating categories:
- Each category requires a unique slug and source.
- To create parent-child relationships, create the slug field in a hierarchical format, for example `men/clothing/pants'.
- A category slug string can contain only lowercase letters, numbers, and hyphens with / used as a separator for hierarchy.
- Create each category as a separate entity.
- Use the name field to define the display name for the category.
- Use the optional description field to provide a full-text description of the category.
- Use the optional families field to associate categories with product families for enhanced organization.
- Use the optional position field to assign a numeric sort order to the category.
- Use the optional metaTags field to define SEO meta tags (title, description, keywords) for the category.
- Use the optional images field to associate images with the category.
- Use the optional attributes field to add additional attributes.
After you create categories, link a product to a category using the path value for the routes field. When you create or update products. The value of path in the route must match the slug value for the category.
To update existing categories, use the update operation.
post/v1/catalog/categories
Headers
Authorizationstring required
Authorization Bearer token
Content-Type'application/json' required
Content-Encoding'gzip'
Use this header if the payload is compressed with gzip.
Request body
Example request
[
{
"slug": "men/clothing/pants",
"source": {
"locale": "English"
},
"name": "Men's Pants",
"description": "Men's clothing, shoes, and accessories",
"families": [
"apparel",
"clothing"
]
}
]Response
All items accepted and will be processed asynchronously