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.
Request
curl --location --request GET '<BASE_URL>/main-categories'
--header 'Content-Type: application/json'
--header 'Authorization: Basic ZGVtbzpwQDU1dzByZA=='
Response
200 OK
[
{
"id": 1,
"name": "Electronics",
"imageUrl": "https://cdn.egaranti.com/categories/electronics.png"
},
{
"id": 2,
"name": "Home Appliances",
"imageUrl": null
}
]
Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Main category ID |
| name | String | Main category name |
| imageUrl | String | Main category image URL (may be null) |