List attributes
List all available attributes on this shop.
GET
/attributes/list.json
List all available attributes on this shop.
GET
/attributes/list.json
$storeden = new Storeden\Storeden($config);
$attributes_list = $storeden->get('/attributes/list.json');
[
{
"label": "Internal Code",
"type": "text",
"data": [],
"id": "586bbfa002e58e586f154824"
},
{
"label": "Warehouse Location",
"type": "text",
"data": [],
"id": "586bca86ffe48e9dbcc2207f"
},
{
"label": "Manufacturer",
"type": "select",
"data": [
"Manufacturer 1",
"Manufacturer 2"
],
"id": "586bcb33ffe48ea8bec21ff4"
}
]
Add a new attribute to your shop attributes pool.
POST
/attributes/attribute.json
label required (string) | Name of your custom product attribute |
type required (string) | Type of your custom product attribute. You can download a valid value list here |
data[] repetable (string) | Predefinited set of values. Available only on "select" type. |
read_only (int) | If read_only setted to 1, the attribute will be edited only via API and not from store backoffice. |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['label'] = 'Manufacturer';
$payload['type'] = 'select';
$payload['data'] = ['Manufacturer 1', 'Manufacturer 2', 'Manufacturer 3'];
$result = $storeden->post('/attributes/attribute.json', $payload);
{
"id": "586bcb33ffe48ea8bec21ff4"
}
Search an attribute. Search by label field
GET
/attributes/search.json?label={attribute-label}
label required (string) | Name of your custom product attribute |
$storeden = new Storeden\Storeden($config);
$result = $storeden->get('/attributes/search.json?label=Manufacturer');
[
{
"label": "Manufacturer",
"type": "select",
"data": [
"Manufacturer 1",
"Manufacturer 2",
"Manufacturer 3"
],
"id": "586bcb33ffe48ea8bec21ff4"
}
]
Add a new value to predefinited element.
POST
/attributes/attribute_addValue.json
id required (StoredenId) | A valid attribute ID that must exists on your store. |
value required (string) | Value of a new entry value to add to the list. Only "select" attribute type can be used with this api. |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['id'] = '586bcb33ffe48ea8bec21ff4';
$payload['value'] = 'Manufacturer 4';
$result = $storeden->post('/attributes/attribute_addValue.json', $payload);
{
"ok": 1,
"err": null
}
Remove an existing attribute from your shop.
DELETE
/attributes/attribute.json
id required (StoredenId) | A valid attribute ID that must exists on your store. |
$storeden = new Storeden\Storeden($config);
$result = $storeden->delete('/attributes/attribute.json', ['id' => '586bcb33ffe48ea8bec21ff4']);
{
"ok": 1,
"err": null
}
Get a list of supported attributes type.
GET
/attributes/types.json
$storeden = new Storeden\Storeden($config);
$types = $storeden->get('/attributes/types.json');
[
"text",
"number",
"real",
"select"
]