Skip to main content

Get Categories

You can list all categories belonging to a main category using this service. Category IDs returned here can be used as the categoryId filter parameter on the Get Products service.

Request

curl --location --request GET '<BASE_URL>/categories?mainCategoryId=1'
--header 'Content-Type: application/json'
--header 'Authorization: <jwtToken>'

Request Parameters

ParameterTypeRequired
Description
mainCategoryIdIntegerYesThe main category ID to list categories for

Response

200 OK
[
{
"id": 7,
"name": "Mobile Phones",
"mainCategoryId": 1
},
{
"id": 8,
"name": "Laptops",
"mainCategoryId": 1
}
]

Response Fields

FieldTypeDescription
idIntegerCategory ID
nameStringCategory name
mainCategoryIdIntegerParent main category ID