Categories & Tree
List categories, hierarchical tree, single category details, and category products
Last updated: Feb 09, 2026
Categories & Tree
List Categories
Get all categories.
GET /api/v1/categories
Category Tree
Get hierarchical category structure.
GET /api/v1/categories/tree
Response: 200 OK
{
"success": true,
"data": [
{
"id": 1,
"name": "Electronics",
"slug": "electronics",
"image": "https://domain.com/storage/categories/electronics.jpg",
"children": [
{
"id": 2,
"name": "Smartphones",
"slug": "smartphones",
"children": []
},
{
"id": 3,
"name": "Laptops",
"slug": "laptops",
"children": []
}
]
}
]
}
Get Category
Get single category details.
GET /api/v1/categories/{id}
Category Products
Get products in a category.
GET /api/v1/categories/{id}/products?per_page=20
| Parameter | Type | Description |
|---|---|---|
per_page | integer | Items per page |
