Storeden Developers

Attributes API

Current version: v1.1

List attributes

List all available attributes on this shop.

GET
/attributes/list.json
List attributes Request

$storeden = new Storeden\Storeden($config);
$attributes_list = $storeden->get('/attributes/list.json');
					
List attributes Response

[
	{
		"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 attribute

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.
Add attribute Request

$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);
					
Add attributes Response

{
	"id": "586bcb33ffe48ea8bec21ff4"
}
					

Search attribute

Search an attribute. Search by label field

GET
/attributes/search.json?label={attribute-label}
label required (string) Name of your custom product attribute
Search attribute Request

$storeden = new Storeden\Storeden($config);
$result = $storeden->get('/attributes/search.json?label=Manufacturer');
					
Search attribute Response

[
	{
		"label": "Manufacturer",
		"type": "select",
		"data": [
			"Manufacturer 1",
			"Manufacturer 2",
			"Manufacturer 3"
		],
		"id": "586bcb33ffe48ea8bec21ff4"
	}
]
					

Edit attribute list

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.
Edit attribute list Request

$storeden = new Storeden\Storeden($config);

$payload = array();
$payload['id'] = '586bcb33ffe48ea8bec21ff4';
$payload['value'] = 'Manufacturer 4';

$result = $storeden->post('/attributes/attribute_addValue.json', $payload);
					
Edit attribute list Response

{
	"ok": 1,
	"err": null
}
					

Delete attribute

Remove an existing attribute from your shop.

DELETE
/attributes/attribute.json
id required (StoredenId) A valid attribute ID that must exists on your store.
Delete attribute Request

$storeden = new Storeden\Storeden($config);
$result = $storeden->delete('/attributes/attribute.json', ['id' => '586bcb33ffe48ea8bec21ff4']);
					
Delete attribute Response

{
	"ok": 1,
	"err": null
}
					

List attribute Type

Get a list of supported attributes type.

GET
/attributes/types.json
List attribute Type Request

$storeden = new Storeden\Storeden($config);
$types = $storeden->get('/attributes/types.json');
					
List attribute Type Response

[
	"text",
	"number",
	"real",
	"select"
]