Create a Category
HTTP Request
POST https://commerce.zoho.com/store/api/v1/categories
OAuthScope
ZohoCommerce.items.CREATE
Body Parameters
Parameter | Description |
name* | string: Name of the category. |
url* | string: URL of the category. The value should be unique [URL can contain only letters (upper and lower cases), numbers, hyphen(-) and underscore(_)]. |
description | string: Description about the category. |
visibility | boolean: Visibility of the category in published site. |
show_in_menu | boolean: Specify whether the category should be shown as a menu item in published site or not. |
seo_keyword | string: Keywords related to category that can be used for SEO (Multiple keywords can be specified by separating them with commas). |
seo_title | string: Title of the category to be used in SEO. |
seo_description | string: Description about the category to be used in SEO. |
parent_category_id | long: Parent ID of the category (Empty will be considered as ROOT). |
Request Example
Copiedcurl -X POST
'https://commerce.zoho.com/store/api/v1/categories'
-H 'Authorization: Zoho-oauthtoken ***'
-H 'Content-Type: application/json'
-H 'X-com-zoho-store-organizationid: 682219181'
-d '{"name":"new category","parent_category_id":"-1","show_in_menu":true,"visibility":true,"seo_title":"new category","seo_keyword":"new,category,new ca
Success Response
Copied{
"code": 0,
"message": "Category added successfully",
"category": {
"category_id": "1706707000000535004",
"name": "new category",
"description": "",
"url": "new-category",
"parent_category_id": "-1",
"parent_category_name": "",
"visibility": true,
"show_in_menu": true,
"seo_title": "new category",
"seo_keyword": "new,category,new category",
"seo_description": "The new category",
"created_time": "2019-12-17T00:28:50-0700",
"last_modified_time": "2019-12-17T00:28:50-0700",
"ancestors": [],
"children": [],
"documents": []
}
}
Failure Response
Copied{
"code": 250001,
"message": "Parent ID not present in the list."
}
{
"code": 250005,
"message": "Category url is already associated with the another category."
}
Use this API to list all the available categories in a particular store in Zoho Commerce.