Categories [API]

The categories are the categories of the product. Category-subcategory scheme is supported.

Description List categories
Action GET
URL <your URL here>/api/categories
Sample request parameters (empty – no data required)
Sample Successful Response
[{"id":1,"name":"Bowls","description":"","meta_description":"","is_active":true,"discount":null,"created_at":"2014-11-17T06:33:33.000Z","updated_at":"2015-12-04T14:16:00.000Z","parent_id":null,"lft":1,"rgt":22,"depth":0,"measurement_unit_id":null,"meta_title":null,"image_file_name":null,"image_content_type":null,"image_file_size":null,"image_updated_at":null,"is_private":false,"subcategories_private":false, "category_path":"Sample Category 2/Bowls"},{"id":2,"name":"Jars with Lid","description":"","meta_description":"","is_active":false,"discount":null,"created_at":"2014-11-17T09:03:50.000Z","updated_at":"2016-08-15T14:03:07.000Z","parent_id":1,"lft":2,"rgt":3,"depth":1,"measurement_unit_id":null,"meta_title":null,"image_file_name":null,"image_content_type":null,"image_file_size":null,"image_updated_at":null,"is_private":false,"subcategories_private":false, "category_path":"Jars with Lid"},{"id":3,"name":"Balls","description":"","meta_description":"","is_active":true,"discount":null,"created_at":"2014-11-17T09:33:54.000Z","updated_at":"2015-12-04T14:16:00.000Z","parent_id":1,"lft":4,"rgt":5,"depth":1,"measurement_unit_id":null,"meta_title":null,"image_file_name":null,"image_content_type":null,"image_file_size":null,"image_updated_at":null,"is_private":false,"subcategories_private":false, "category_path":"Balls"},{"id":4,"name":"Glasses","description":"","meta_description":"","is_active":true,"discount":null,"created_at":"2014-11-17T09:34:26.000Z","updated_at":"2015-12-04T14:16:00.000Z","parent_id":1,"lft":6,"rgt":7,"depth":1,"measurement_unit_id":null,"meta_title":null,"image_file_name":null,"image_content_type":null,"image_file_size":null,"image_updated_at":null,"is_private":false,"subcategories_private":false, "category_path":"Glasses"}]<br>
Available parameters name_eq (category name) name_cont (category name wildcard match)
Description Create Category
Action POST
URL <your URL here>/api/categories
Sample request parameters
{"category":{"name":"Test category"}}
		
Sample Successful Response
{"id":75,"name":"Test category","description":null,"meta_description":null,"is_active":true,"discount":null,"created_at":"2016-09-11T19:28:04.000Z","updated_at":"2016-09-11T19:28:04.000Z","parent_id":null,"lft":113,"rgt":114,"depth":0,"measurement_unit_id":null,"meta_title":null,"image_file_name":null,"image_content_type":null,"image_file_size":null,"image_updated_at":null,"is_private":false,"subcategories_private":false, "category_path":"Test Category"}<br>
Required fields name
Notes Use field parent_id if the category belongs to another category


Field descriptions for Categories

Name Type Description Required
name string Name of category yes
description text - no
meta_description text - no
parent_id integer Parent category id (if category belongs to other). Multiple levels are supported. no
is_active boolean Is category active for customers or not? If not, the products that belong to this category will not be visible no – default: true
discount decimal If there is discount for a specific category it will be applied to allo products no
created_at datetime Create Time auto calculated
updated_at datetime Update Time auto calculated
lft integer Internal use - ignore auto calculated
rgt integer Internal use - ignore auto calculated
depth integer Internal use - ignore auto calculated
measurement_unit_id integer - Not currently supported by API no
meta_title string - Not currently supported by API no
image_file_name string - Not currently supported by API no
image_content_type string - Not currently supported by API no
image_file_size integer - Not currently supported by API no
image_updated_at datetime - Not currently supported by API no
is_private boolean If category is private, it will be visible only to specific customers no -default: false
subcategories_private boolean If category has subcategories, then subcategories should be private too no -default: false
category_path
string Name of category or "name of parent category / name of subcategory" if this is a subcategory no

Still need help? Contact Us Contact Us