List categories
List all your shop categories. This endpoint return a non ordered list
GET
/categories/list.json
List all your shop categories. This endpoint return a non ordered list
GET
/categories/list.json
$storeden = new Storeden\Storeden($config);
$categories_list = $storeden->get('/categories/list.json');
[
{
"uid": 106090,
"name": "TV LED",
"parentUID": 0, // Legacy field, use parent instead
"parent": 0,
"description": "Discover a new way to watch films",
"seo": {
"title": "",
"description": "",
"keywords": ""
},
"mpc": "562a225c16f46a580d9b91e4"
},
...
]
Return how many categories are listed on your shop
GET
/categories/count.json
$storeden = new Storeden\Storeden($config);
$result = $storeden->get('/categories/count.json');
{
"count": 240
}
Add a new category to your shop. You can add a root category setting parent to 0
POST
/categories/category.json
name required (string) | Category name in your shop default language |
description (string) | Category description, in your shop default language |
parent (int) | Specify a valid parent uid to create this category as a subcategory of {parent-uid} category |
seo_title (string) | Insert here your seo title |
seo_description (string) | Insert here your seo description |
seo_keywords (string) | Insert here your seo description |
status (int) Dec 16th, 2021 | 0 => Disabled category | 1 => Enabled category. Default = 1 |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['name'] = 'Monitors';
$payload['description'] = '';
$payload['parent'] = 114510;
$payload['seo_title'] = '';
$payload['seo_description'] = '';
$payload['seo_keywords'] = '';
$result = $storeden->post('/categories/category.json', $payload);
{
"uid": 114513
}
PUT
/categories/category.json
uid required (int) | A valid category uid |
name required (string) | Specify your category name |
description (string) | Specify your category description in your shop default language |
parent (int) | Specify your category parent category uid. If set to 0 or empty this category will be a root category |
mpc (StoredenID) | Specify a valid Storeden Marketplace category ID |
seo_title (string) | Insert here your seo title |
seo_description (string) | Insert here your seo description |
seo_keywords (string) | Insert here your seo description |
status (int) Dec 16th, 2021 | 0 => Disabled category | 1 => Enabled category. Default = 1 |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['uid'] = 114516;
$payload['name'] = 'Pc Monitors';
$payload['description'] = '';
$payload['parent'] = 114510;
$payload['mpc'] = null;
$payload['seo_title'] = '';
$payload['seo_description'] = '';
$payload['seo_keywords'] = '';
$result = $storeden->put('/categories/category.json', $payload);
{
"ok": 1,
"err": null,
"updatedExisting": true
}
Remove a category from your store. If this category has one or more subcategories those will be marked as orphan categories.
DELETE
/categories/category.json
uid required (int) | Unique identifier of your store category |
If you can't send a body content on DELETE Api Call you can specify the required identifier as questy string.
Example: https://connect.storeden.com/v1.1/categories/category.json?uid=YOUR_ID
$storeden = new Storeden\Storeden($config);
$result = $storeden->delete('/categories/category.json', ['uid' => 114516]);
{
"ok": 1,
"err": null,
}
PUT
/categories/visibility.json
uid required (int) | Unique identifier of your store category |
status required (int) | Specify 1 to make category visible on e-commerce or 0 to hide from storefront |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['uid'] = 114514;
$payload['status'] = 1;
$result = $storeden->put('/categories/visibility.json', $payload);
{
"ok": 1,
"nModified": 1,
"n": 1,
"err": null,
"errmsg": null,
"updatedExisting": true
}
PUT
/categories/bindImage.json
categoryUID required (int) | Unique identifier of your store category |
image_id required (string) | Specify a valid image_id, uploaded to your account. |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['categoryUID'] = 114514;
$payload['image_id'] = '60b5ed83d4029d5e701bf1ed';
$result = $storeden->put('/categories/bindImage.json', $payload);
{
"ok": 1,
"nModified": 1,
"n": 1,
"err": null,
"errmsg": null
}
PUT
/categories/setPosition.json
categoryUID required (int) | Unique identifier of your store category |
position required (int) |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['categoryUID'] = 114514;
$payload['position'] = 2;
$result = $storeden->put('/categories/bindImage.json', $payload);
{
"updated": true,
"previous_position": 3,
"actual_position": 2
}