Skip to main content

Category API

Use the REST API to interact with EverShop categories.

Create a category

Use this endpoint to create a category.

Request Schema (application/json)
Field NameField TypeRequired
namestringYes
descriptionstringYes
imagestringNo
meta_titlestringYes
meta_descriptionstringYes
meta_keywordsstringNo
url_keystringYes
statusinteger or string (0, 1, '0', '1')Yes
include_in_navinteger or string (0, 1, '0', '1')No
parent_idstring or integerNo
positionstring or integerNo
POST/api/categories
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
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": "2sl0ifz1declc91p67h",
"short_description": null,
"description": "2sl0ifz1declc91p67i",
"image": "2sl0ifz1declc91p67j",
"meta_title": "2sl0ifz1declc91p67k",
"meta_keywords": "2sl0ifz1declc91p67m",
"meta_description": "2sl0ifz1declc91p67l",
"url_key": "2sl0ifz1declc91p67n",
"links": [
{
"rel": "categoryGrid",
"href": "/admin/categories",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "view",
"href": "/category/2sl0ifz1declc91p67n",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "edit",
"href": "/admin/categories/edit/9ab75946a63211edb46b60d819134f39",
"action": "GET",
"types": [
"text/xml"
]
}
]
}
}

Update a category

Use this endpoint to update a category.

Request Schema (application/json)
Field NameField TypeRequired
namestringNo
descriptionstringNo
imagestringNo
meta_titlestringNo
meta_descriptionstringNo
meta_keywordsstringNo
url_keystringNo
statusinteger or string (0, 1, '0', '1')No
include_in_navinteger or string (0, 1, '0', '1')No
parent_idstring or integerNo
positionstring or integerNo
PATCH/api/categories/{id}
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
https://<your domain>/api/categories/{id}
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": "2sl0ifz1declc91p67h",
"short_description": null,
"description": "2sl0ifz1declc91p67i",
"image": "2sl0ifz1declc91p67j",
"meta_title": "2sl0ifz1declc91p67k",
"meta_keywords": "2sl0ifz1declc91p67m",
"meta_description": "2sl0ifz1declc91p67l",
"url_key": "2sl0ifz1declc91p67n",
"links": [
{
"rel": "categoryGrid",
"href": "/admin/categories",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "view",
"href": "/category/2sl0ifz1declc91p67n",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "edit",
"href": "/admin/categories/edit/9ab75946a63211edb46b60d819134f39",
"action": "GET",
"types": [
"text/xml"
]
}
]
}
}

Delete a category

Use this endpoint to delete a category.

Request Schema (application/json)
No request body required
DELETE/api/categories/{id}
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
https://<your domain>/api/categories/{id}
Sample Of Response
{
"data": {
"category_id": 103,
"uuid": "9ab75946a63211edb46b60d819134f39",
"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
}
}