Skip to main content

Category API

Overview

The Category API provides endpoints for managing product categories in your EverShop store. Categories help organize your product catalog into a hierarchical structure, improving navigation and product discoverability for your customers.

Endpoints

Create a Category

Creates a new product category in the system. Categories can be organized in a hierarchical structure by specifying a parent category.

Request Schema (application/json)
Field NameField TypeRequired
namestringYes
descriptionarray of objectYes
Field NameField TypeRequired
idstringYes
sizenumberYes
columnsarray of objectYes
Field NameField TypeRequired
idstringYes
sizenumberYes
dataobjectYes
imagestringNo
meta_titlestringYes
meta_descriptionstringYes
meta_keywordsstringNo
url_keystring (^\S+$)No
statusinteger or string (0, 1, '0', '1')Yes
include_in_navinteger or string (0, 1, '0', '1')No
parent_idstring or number or nullNo
positionstring or integerNo
POST/api/categories
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/categories
Sample Of Response
{
"data": {
"category_id": 103,
"uuid": "9ab75946a63211edb46b60d819134f39",
"status": 1,
"parent_id": 16,
"include_in_nav": 0,
"position": 22,
"created_at": "2023-02-07 00:01:47",
"updated_at": "2023-02-07 00:01:47",
"category_description_id": 82,
"category_description_category_id": 103,
"name": "Athletic Shoes",
"short_description": null,
"description": "High-performance athletic shoes for sports and training",
"image": "/assets/catalog/categories/athletic-shoes.jpg",
"meta_title": "Athletic Shoes | Performance Footwear",
"meta_keywords": "athletic shoes, running shoes, training footwear",
"meta_description": "Shop our selection of high-performance athletic shoes for all your training needs",
"url_key": "athletic-shoes",
"links": [
{
"rel": "categoryGrid",
"href": "/admin/categories",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "view",
"href": "/category/athletic-shoes",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "edit",
"href": "/admin/categories/edit/9ab75946a63211edb46b60d819134f39",
"action": "GET",
"types": [
"text/xml"
]
}
]
}
}

Update a Category

Modifies an existing product category. You can update any of the category attributes, including its hierarchical position in the catalog.

Request Schema (application/json)
Field NameField TypeRequired
namestringYes
descriptionarray of objectYes
Field NameField TypeRequired
idstringYes
sizenumberYes
columnsarray of objectYes
Field NameField TypeRequired
idstringYes
sizenumberYes
dataobjectYes
imagestringNo
meta_titlestringYes
meta_descriptionstringYes
meta_keywordsstringNo
url_keystring (^\S+$)No
statusinteger or string (0, 1, '0', '1')Yes
include_in_navinteger or string (0, 1, '0', '1')No
parent_idstring or number or nullNo
positionstring or integerNo
PATCH/api/categories/433ba97f-8be7-4be9-be3f-a9f341f2b89f
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/categories/433ba97f-8be7-4be9-be3f-a9f341f2b89f
Sample Of Response
{
"data": {
"category_id": 103,
"uuid": "9ab75946a63211edb46b60d819134f39",
"status": 1,
"parent_id": 16,
"include_in_nav": 1,
"position": 22,
"created_at": "2023-02-07 00:01:47",
"updated_at": "2023-02-07 00:01:47",
"category_description_id": 82,
"category_description_category_id": 103,
"name": "Athletic Shoes",
"short_description": null,
"description": "High-performance athletic shoes for sports and training",
"image": "/assets/catalog/categories/athletic-shoes.jpg",
"meta_title": "Athletic Shoes | Performance Footwear",
"meta_keywords": "athletic shoes, running shoes, training footwear",
"meta_description": "Shop our selection of high-performance athletic shoes for all your training needs",
"url_key": "athletic-shoes",
"links": [
{
"rel": "categoryGrid",
"href": "/admin/categories",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "view",
"href": "/category/athletic-shoes",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "edit",
"href": "/admin/categories/edit/433ba97f-8be7-4be9-be3f-a9f341f2b89f",
"action": "GET",
"types": [
"text/xml"
]
}
]
}
}

Delete a Category

Permanently removes a product category from the system. Note that this does not automatically delete associated products.

Request Schema (application/json)
No request body required
DELETE/api/categories/433ba97f-8be7-4be9-be3f-a9f341f2b89f
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
https://<your domain>/api/categories/433ba97f-8be7-4be9-be3f-a9f341f2b89f
Sample Of Response
{
"data": {
"category_id": 103,
"uuid": "433ba97f-8be7-4be9-be3f-a9f341f2b89f",
"status": 0,
"parent_id": 16,
"include_in_nav": 0,
"position": 22,
"created_at": "2023-02-07 00:01:47",
"updated_at": "2023-02-07 00:01:48",
"category_description_id": null,
"category_description_category_id": null,
"name": null,
"short_description": null,
"description": null,
"image": null,
"meta_title": null,
"meta_keywords": null,
"meta_description": null,
"url_key": null
}
}

Get Category Data with GraphQL

EverShop uses GraphQL for querying category data. For detailed information on how to query categories, refer to the GraphQL API documentation.