Categories
This is used to view, create, update and delete categories.
Category Properties
id |
{ "id" : 255 }
The unique ID of the category |
title |
{ "title" : "Shoes" }
The title/name of the category |
description |
{ "description" : "All of our latest shoes."}
The description for the category |
url |
{ "url" : "http://www.shopname.com/shoes" }
The full URL for the category |
active |
{ "active" : true }
Either true or false |
metaTitle |
{ "metaTitle" : "Discount Shoes - From Eazy Shoes" }
The title tag for the category page |
metaDescription |
{ "metaDescription" : "Come and take a look at our shoes." }
The meta description for the category page |
metaKeywords |
{ "metaKeywords" : "shoes, discount shoes" }
The meta keywords for the category page |
image |
{ "image" : "https://static.ecommercedns.uk/images/bb3a70.jpg" }
The image object (present only when the category has an image), the image object has a single property url |
parents |
{ "parents" : [
{
"id": 2,
"title": "...",
"description": "...",
"url": "http://www.domain.com/slug",
"active": true,
"metaTitle": "...",
"metaKeywords": "...",
"metaDescription": "...",
"image": { "url": "..." }
}
]
}
The parent categories of the category (present only when embed=parents |
What you can do with Categories
GET /v1/categories
Receive a list of all categories
GET /v1/categories/count
Count the number of categories
GET /v1/categories/ID
Receive a single category
POST /v1/categories
Create a new category
PUT /v1/categories/ID
Update a category
DELETE /v1/categories/ID
Delete a category
GET /v1/categories
Returns all categories. By default the first 50 categories (both active and inactive) are returned, sorted by creation date.
embed | parents |
fields | Comma separated list of properties to include |
sort | title or title_desc (default is creation date) |
active | 0 or 1 |
count | Count |
offset | Offset |
GET /v1/categories
HTTP/1.1 200 OK [ { "id": 1, "title": "...", "description": "...", "url": "http://www.shopname.com/slug", "active": true, "metaTitle": "...", "metaKeywords": "...", "metaDescription": "...", "image": { "url": "https://static.ecommercedns.uk/images/456e70cea611e36883b4dd3e02bb3a70.jpg?1" } } ]
GET /v1/categories/count
Returns a count of the categories.
active | 0 or 1 |
GET /v1/categories/count
HTTP/1.1 200 OK { "count": 99 }
GET /v1/categories/ID
Returns a single category.
embed | parents |
fields | Comma separated list of properties to include |
GET /v1/categories/1
HTTP/1.1 200 OK { "id": 1, "title": "...", "description": "...", "url": "http://www.shopname.com/slug", "active": true, "metaTitle": "...", "metaKeywords": "...", "metaDescription": "...", "image": { "url": "https://static.ecommercedns.uk/images/456e70cea611e36883b4dd3e02bb3a70.jpg?1" }, "parents": [ { "id": 2, "title": "...", "description": "...", "url": "http://www.shopname.com/slug", "active": true, "metaTitle": "...", "metaKeywords": "...", "metaDescription": "..." } ] }
POST /v1/categories
Creates a new category.
title | required |
description | optional |
active | default is true |
metaTitle | optional |
metaDescription | optional |
metaKeywords | optional |
slug | optional, do not include the domain name |
image | URL or base64 encoded image |
parents | optional (by ID) |
POST /v1/categories
POST /v1/categories { "title": "Category Title" "slug": "category-title", "image": "http://www.domain.com/images/test.jpg", "parents": [1, 2] }
POST /v1/categories
HTTP/1.1 201 Created { "id": 3, "title": "Category Title", "description": "", "url": "http://www.shopname.com/category-title", "active": true, "metaTitle": "", "metaKeywords": "", "metaDescription": "", "image": { "url": "https://static.ecommercedns.uk/images/456e70cea611e36883b4dd3e02bb3a70.jpg?1" } }
PUT /v1/categories/ID
Update a category. All object properties are allowed.
PUT /v1/categories/3
PUT /v1/categories/3 { "active": false, "slug": "category" }
PUT /v1/categories/3
HTTP/1.1 200 OK { "id": 3, "title": "Category Title", "description": "", "url": "http://www.domain.com/category", "active": false, "metaTitle": "", "metaKeywords": "", "metaDescription": "", "image": { "url": "https://static.ecommercedns.uk/images/456e70cea611e36883b4dd3e02bb3a70.jpg?1" } }
DELETE /v1/categories/ID
Deletes an existing category.
Returns 204 No Content on success.