Skip to main content

Get Main Categories

You can list all main categories using this service. Main category IDs returned here can be used as the mainCategoryId filter parameter on the Get Products service, and are the top level of the category tree also used when creating or updating a product by name.

Request

curl --location --request GET '<BASE_URL>/main-categories'
--header 'Content-Type: application/json'
--header 'Authorization: <jwtToken>'

Response

200 OK
[
{
"id": 1,
"name": "Electronics"
},
{
"id": 2,
"name": "Home Appliances"
}
]

Response Fields

FieldTypeDescription
idIntegerMain category ID
nameStringMain category name