Skip to main content
GET
/
categories
List Categories
curl --request GET \
  --url https://api.example.com/categories
{
  "200": {},
  "500": {},
  "id": 123,
  "name": "<string>"
}

Description

This endpoint retrieves all categories in the system. Categories are used to organize and classify products in the ecommerce platform.

Request

No parameters required.

Response

Returns an array of category objects.
id
long
Unique identifier for the category
name
string
The category name (unique across all categories)

HTTP Status Codes

200
OK
Successfully retrieved the list of categories
500
Internal Server Error
An error occurred while processing the request

Example Request

curl -X GET http://localhost:8080/categories \
  -H "Content-Type: application/json"

Example Response

[
  {
    "id": 1,
    "name": "Electronics"
  },
  {
    "id": 2,
    "name": "Clothing"
  },
  {
    "id": 3,
    "name": "Books"
  }
]

Build docs developers (and LLMs) love