Categories Overview
The Categories resource allows you to manage product categories in a hierarchical structure. Categories can have parent-child relationships, enabling you to organize products into main categories and subcategories.Category Hierarchy
Categories support a parent-child hierarchy:- Main Categories: Categories without a parent (
parentIdis null) - Subcategories: Categories that belong to a parent category
/api/v1/categories/main and subcategories for a specific parent using /api/v1/categories/parent/{parentId}.
Category Object
A category contains the following information:Unique identifier for the category
The category name
Detailed description of the category
ID of the parent category (null for main categories)
Whether the category is currently active
List of product IDs associated with this category
List of subcategory IDs that belong to this category
Available Endpoints
CRUD Operations
- List all categories -
GET /api/v1/categories - Get category by ID -
GET /api/v1/categories/{id} - Create a category -
POST /api/v1/categories - Update a category -
PUT /api/v1/categories/{id} - Delete a category -
DELETE /api/v1/categories/{id}
Search and Filter
- Search categories - Various search endpoints for filtering categories
Common Use Cases
Creating a Category Hierarchy
- Create a main category (e.g., “Furniture”)
- Use the returned category ID as
parentIdwhen creating subcategories (e.g., “Tables”, “Chairs”) - Retrieve the hierarchy using
/mainand/parent/{parentId}endpoints
Managing Active Categories
Categories have anisActive flag that allows you to enable or disable them without deletion. Use the /active endpoint to retrieve only active categories.