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
| Parameter | Type | Required | Description |
|---|---|---|---|
| mainCategoryId | Integer | Yes | The 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
| Field | Type | Description |
|---|---|---|
| id | Integer | Category ID |
| name | String | Category name |
| mainCategoryId | Integer | Parent main category ID |