Category

Contain data reffered to category.


Receive a list of all Categories

Query parameters:
  • fields - list of fields returning in response
  • limit - number of returned categories (default: 50)
  • page - currently displayed page (default: 1)
  • since_id - restrict categories to greater identifiers than specified id
  • product_id - filter with product id
  • parent_id - filter with category parent id
  • created_at_min - shows categories, which creation date was later than specified (format: 2011-06-19 13:18:50)
  • created_at_max - shows categories, which creation date was earlier than specified (format: 2011-06-19 13:18:50)
  • updated_at_min - shows categories, which modification date was later than specified (format: 2011-06-19 13:18:50)
  • updated_at_max - shows categories, which modification date was earlier than specified (format: 2011-06-19 13:18:50)
GET /services/categories

Returns all categories

HTTP/1.1 200 OK
{
	"categories": [
		{
			"id" : 1,
			"pos" : 1,
			"name" : "Women",
			"url" : "women",
			"description" : "Stylish clothes for Females",
			"parent" : 0,
			"created_at" : "2011-09-22 01:15:35",
			"updated_at" : "2011-09-22 01:15:35",
			"metadata" : [
				{
					"meta_title" : "Female clothes",
					"meta_description" : "Clothes for Females",
					"meta_keywords" : "clothes, female, stylish, modern",
				},
			],
		},
		{
			"id" : 2,
			"pos" : 2,
			"name" : "Kids",
			"url" : "kids",
			"description" : "Clothes made for Kids",
			"parent" : 0,
			"created_at" : "2011-09-22 01:19:35",
			"updated_at" : "2011-09-22 01:19:35",
			"metadata" : [
				{
					"meta_title" : "Kids clothes",
					"meta_description" : "Clothes for Kids",
					"meta_keywords" : "clothes, kids, stylish, modern",
				},
			],
		},
	]
}

Receive a count of all Categories

Query parameters:
  • since_id - restrict categories to greater identifiers than specified id
  • product_id - filter with product id
  • parent_id - filter with category parent id
  • created_at_min - counts categories, which creation date was later than specified (format: 2011-06-19 13:18:50)
  • created_at_max - counts categories, which creation date was earlier than specified (format: 2011-06-19 13:18:50)
  • updated_at_min - counts categories, which modification date was later than specified (format: 2011-06-19 13:18:50)
  • updated_at_max - counts categories, which modification date was earlier than specified (format: 2011-06-19 13:18:50)
GET /services/categories/count

Receive a count of all Categories

HTTP/1.1 200 OK
{
	"count": 250
}

Receive a single Category

Query parameters:
  • fields - list of fields returning in response
GET services/categories/{id}

Receive a single Category

Response
HTTP/1.1 200 OK
{
	"category": {
		"id" : 1,
		"uuid": "ed084cba-6b1d-4ee0-9c70-d9676f5a3b59",
		"pos" : 1,
		"name" : "Women",
		"url" : "women",
		"description" : "Stylish clothes for Females",
		"parent" : 0,
		"created_at" : "2011-09-22 01:15:35",
		"updated_at" : "2011-09-22 01:15:35",
		"metadata" : [
			{
				"meta_title" : "Female clothes",
				"meta_description" : "Clothes for Females",
				"meta_keywords" : "clothes, female, stylish, modern",
			},
		],
	},
}

Create a Category

POST services/categories

Create category with specified parameters

Request
{
	"category": {
		"title" : "Male Clothes",
		"url" : "male-clothes",
		"parent_id"	: 4,
		"description"	: "",
		"metadata" : [
			{
				"meta_title" : "",
				"meta_description" : "",
				"meta_keywords" : "",
			},
		],
		"force_save"	: false,
	},
}
Response
HTTP/1.1 200 OK
{
	"category": {
		"id"	: 5,
		"uuid"	: "41eb33e3-baac-4954-becb-88fe434af0e1",
		"pos"	: 5,
		"name"	: "Male Clothes",
		"url"	: "male-clothes",
		"description"	: "",
		"parent"	: 4,
		"global_parent"	: 1,
		"tree"	: "0-1-4-5",
		"sort_order"	: 0,
		"created_at" : "2011-05-08 21:26:27",
		"updated_at" : "2011-05-08 21:26:27",
		"metadata" : [
			{
				"meta_title" : "",
				"meta_description" : "",
				"meta_keywords" : "",
			},
		],

	},
}

Update an existing Category

PUT services/categories/{id}

You can update a title, url, description or meta data of a given category

Request
{
	"category": {
		"title"	: "Modern Male Clothes",
		"url"	: "modern-male-clothes",
		"description"	: "Modern clothes just for men",
		"metadata" : [
			{
				"meta_title" : "",
				"meta_description" : "",
				"meta_keywords" : "",
			},
		],

	},
}
Response
HTTP/1.1 200 OK
{
	"id"	: 5,
}

Delete an existing Category

DELETE services/categories/{id}

Delete an existing category from a shop

Response
HTTP/1.1 200 OK
{
	"status"	: "ok",
}