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.

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​

FieldTypeDescription
idIntegerMain category ID
nameStringMain category name
imageUrlStringMain category image URL (may be null)