List Categories
Retrieve a list of all categories in the system. This endpoint supports both full listing and paginated results.
Endpoint
Returns all categories without pagination.
Paginated Endpoint
GET /api/v1/categories/pagination
Returns categories with pagination support.
Query Parameters
The page number to retrieve (zero-indexed)
The number of categories to return per page
Response
Returns an array of category objects.
Unique identifier for the category
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
Status Codes
200 - Success, returns array of categories
Examples
Get all categories
curl -X GET "https://api.example.com/api/v1/categories" \
-H "Content-Type: application/json"
curl -X GET "https://api.example.com/api/v1/categories/pagination?page=0&pageSize=20" \
-H "Content-Type: application/json"
Response Example
[
{
"id": 1,
"name": "Living Room",
"description": "Furniture for living spaces",
"parentId": null,
"isActive": true,
"product_ids": [101, 102, 103],
"subcategory_ids": [10, 11]
},
{
"id": 10,
"name": "Sofas",
"description": "Comfortable seating furniture",
"parentId": 1,
"isActive": true,
"product_ids": [201, 202],
"subcategory_ids": []
}
]