Returns the attributes views that meet the given conditions.
Admin SDKAdmin.api('commerce.attributes-views.find', request, function(response) { … });
HTTP POST/api/v10/commerce.attributes-views.find
{
"conditions" : { // returns only the attributes views …
"after" : 281 // … with identifier after this - int(0…)
},
"fields" : [ "id", "code", … ], // fields to return - string
"order" : [ "name" ], // sort order of returned attributes views, can contain "id", "-id", "name" and "-name" - string
"limit" : 10, // maximum number of attributes views to return - int(1…)
"first" : 0 // index of the first attributes view to return - int(0…)
}
{
"status" : "ok",
"views" : [ {
"id" : 281, // identifier - int(1…)
"code" : "SHOES", // code - string(0…40)
"name" : "Shoes attributes", // name - string(0…60)
"attributes" : [ 43, 25, 108, … ] // attributes - int(1…)
}, … ]
}
Returns an attributes view given its identifier.
Admin SDKAdmin.api('commerce.attributes-views.get', request, function(response) { … });
HTTP POST/api/v10/commerce.attributes-views.get
{
"id" : 281, // identifier of the attributes view (required) - int(1…)
"fields" : [ "id", "code", … ] // fields to return - string
}
{
"status" : "ok",
"view" : { // (can be null)
"id" : 281, // identifier - int(1…)
"code" : "SHOES", // code - string(0…40)
"name" : "Shoes attributes", // name - string(0…60)
"attributes" : [ 43, 25, 108, … ] // attributes - int(1…)
}
}
Number of attributes views that meet the given conditions.
Admin SDKAdmin.api('commerce.attributes-views.count', request, function(response) { … });
HTTP POST/api/v10/commerce.attributes-views.count
{
"conditions" : { // counts only the attributes views …
"after" : 281 // … with identifier after this - int(0…)
}
}
{
"status" : "ok",
"count" : 12 // number of attributes views - int(0…)
}
Creates a new attributes view.
Admin SDKAdmin.api('commerce.attributes-views.create', request, function(response) { … });
HTTP POST/api/v10/commerce.attributes-views.create
{
"view" : { // attributes view to create (required)
"code" : "SHOES", // code - string(0…40)
"name" : "Shoes attributes", // name - string(0…60)
"attributes" : [ 43, 25, 108, … ] // attributes - int(1…)
}
}
{
"status" : "ok",
"id" : 281 // identifier of the new attributes view - int(1…)
}
Field | Type | Description |
---|---|---|
attributes | Malformed | An attribute id is repeated |
attributes | NotFound | Attribute <attribute> does not exist |
code | Malformed | '<code> ' has trailing spaces |
Updates an attributes view. Any fields left out of the request will remain unchanged.
Admin SDKAdmin.api('commerce.attributes-views.update', request, function(response) { … });
HTTP POST/api/v10/commerce.attributes-views.update
{
"id" : 43, // identifier of the attributes view to update (required) - int(1…)
"view" : { // attributes view's fields to update (required)
"code" : "SHOES", // code - string(0…40)
"name" : "Shoes attributes", // name - string(0…60)
"attributes" : [ 43, 25, 108, … ] // attributes - int(1…)
}
}
{
"status" : "ok"
}
Field | Type | Description |
---|---|---|
attributes | Malformed | An attribute id is repeated |
attributes | NotFound | Attribute <attribute> does not exist |
code | Malformed | '<code> ' has trailing spaces |
id | NotFound | Attributes view <id> does not exist |
Deletes one or more attributes views.
Admin SDKAdmin.api('commerce.attributes-views.delete', request, function(response) { … });
HTTP POST/api/v10/commerce.attributes-views.delete
{
"ids" : [ 281, 68, 133, … ] // identifiers of the attributes views to delete (required) - int(1…)
}
{
"status" : "ok"
}