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: Basic ZGVtbzpwQDU1dzByZA=='

Request Parameters

ParameterTypeRequired
Description
mainCategoryIdIntegerYesThe main category ID to list categories for

Response

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

Response Fields

FieldTypeDescription
idIntegerCategory ID
nameStringCategory name
mainCategoryIdIntegerParent main category ID
imageUrlStringCategory image URL (may be null)
serialNoInfoStringInformational text about serial number requirements for this category (may be null)