Skip to main content

Create a Category

HTTP Request

POST https://commerce.zoho.com/store/api/v1/categories

 

OAuthScope

ZohoCommerce.items.CREATE

 

Body Parameters

ParameterDescription
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(_)].
descriptionstring: Description about the category.
visibilityboolean: Visibility of the category in published site.
show_in_menuboolean: Specify whether the category should be shown as a menu item in published site or not.
seo_keywordstring: Keywords related to category that can be used for SEO (Multiple keywords can be specified by separating them with commas).
seo_titlestring: Title of the category to be used in SEO.
seo_descriptionstring: Description about the category to be used in SEO.
parent_category_idlong: 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.