Skip to main content

List Categories

Retrieve a list of all categories in the system. This endpoint supports both full listing and paginated results.

Endpoint

GET /api/v1/categories
Returns all categories without pagination.

Paginated Endpoint

GET /api/v1/categories/pagination
Returns categories with pagination support.

Query Parameters

page
integer
default:"0"
The page number to retrieve (zero-indexed)
pageSize
integer
default:"10"
The number of categories to return per page

Response

Returns an array of category objects.
id
integer
Unique identifier for the category
name
string
The category name
description
string
Detailed description of the category
parentId
integer
ID of the parent category (null for main categories)
isActive
boolean
Whether the category is currently active
product_ids
array
List of product IDs associated with this category
subcategory_ids
array
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"

Get categories with pagination

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": []
  }
]

Build docs developers (and LLMs) love