Get All Categories
Get all product categories in a hierarchical tree structure.
Endpoint
Authentication
Not required (public endpoint)
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
search |
string | No | Search by category name (case-insensitive) |
Response
Success (200 OK)
Returns a hierarchical tree structure of categories:
[
{
"id": 1,
"name": "Elektronika",
"name_az": "Elektronika",
"name_en": "Electronics",
"name_es": "Electrónica",
"name_de": "Elektronik",
"image": "https://...",
"parent_id": null,
"children": [
{
"id": 2,
"name": "Noutbuklar",
"name_az": "Noutbuklar",
"name_en": "Laptops",
"name_es": "Portátiles",
"name_de": "Laptops",
"image": "https://...",
"parent_id": 1,
"children": []
},
{
"id": 3,
"name": "Telefonlar",
"name_az": "Telefonlar",
"name_en": "Phones",
"name_es": "Teléfonos",
"name_de": "Telefone",
"image": "https://...",
"parent_id": 1,
"children": []
}
]
},
{
"id": 4,
"name": "Geyim",
"name_az": "Geyim",
"name_en": "Clothing",
"name_es": "Ropa",
"name_de": "Kleidung",
"image": "https://...",
"parent_id": null,
"children": []
}
]
Response Structure
- Categories are returned as a tree structure
- Top-level categories have
parent_id: null - Child categories are nested in the
childrenarray - Each category includes:
id,name(backward compatibility),name_az,name_en,name_es,name_de,image,parent_id,children - All translation fields are included in the response for multi-language support
Example Request
Notes
- Categories are ordered by ID descending (newest first)
- Only non-deleted categories are returned
- Search is case-insensitive and matches category names
- The tree structure allows for unlimited nesting levels