Adds one or more labels to one or more resources.
Admin SDKAdmin.api('commerce.labels.add', request, function(response) { … });
HTTP POST/api/v10/commerce.labels.add
{
"ids" : [ 1, 5, 12, … ], // identifiers of the labels to add (required) - int(1…64)
"type" : "Product", // type of resources, can be "Customer", "Product", "Order", "Quote", "Invoice", "Receipt", "PackingSlip" or "Return" (required) - string
"resources" : [ 125, 543, … ] // resources (id) to which assign the labels (required) - int(1…)
}
{
"status" : "ok"
}
Field | Type | Description |
---|---|---|
ids | Malformed | An identifier is repeated |
resources | Malformed | A resource is repeated |
resources | Malformed | There cannot be more than 1000 resources |
Returns the labels added to one or more resources.
Admin SDKAdmin.api('commerce.labels.find', request, function(response) { … });
HTTP POST/api/v10/commerce.labels.find
{
"conditions" : { // returns only the labels (required) …
"type" : "Product", // type of resources, can be "Customer", "Product", "Order", "Quote", "Invoice", "Receipt", "PackingSlip" or "Return" or "PackingSlip" (required) - string
"resources" : [ 125, 543, 75, … ], // resources (id) for which to return the labels (required) - int(1…)
"mustHaveName" : true // indicates if the label must have a name - bool
}
}
{
"status" : "ok",
"labels" : { // labels for each resource, only resources with at least one label are returned
"125" : [ 1, 5, 12, … ],
"75" : [ 5, 7, … ]
}
}
Field | Type | Description |
---|---|---|
resources | Malformed | A resource is repeated |
resources | Malformed | There cannot be more than 1000 resources |
Replaces all the labels added to one or more resources.
Admin SDKAdmin.api('commerce.labels.replace', request, function(response) { … });
HTTP POST/api/v10/commerce.labels.replace
{
"ids" : [ 1, 5, 12, … ], // labels (id) that replace the old ones (required) - int(1…64)
"type" : "Product", // type of resources, can be "Customer", "Product", "Order", "Quote", "Invoice", "Receipt", "PackingSlip" or "Return" (required) - string
"resources" : [ 125, 543, … ] // resources (id) in which to replace the labels (required) - int(1…)
}
{
"status" : "ok"
}
Field | Type | Description |
---|---|---|
ids | Malformed | An identifier is repeated |
resources | Malformed | A resource is repeated |
resources | Malformed | There cannot be more than 1000 resources |
Removes one or more labels from one or more resources.
Admin SDKAdmin.api('commerce.labels.remove', request, function(response) { … });
HTTP POST/api/v10/commerce.labels.remove
{
"ids" : [ 1, 5, 12, … ], // labels (id) to remove (required) - int(1…64)
"type" : "Product", // type of resources, can be "Customer", "Product", "Order", "Quote", "Invoice", "Receipt", "PackingSlip" or "Return" (required) - string
"resources" : [ 125, 543, … ] // resources (id) from which to remove the labels, or null to remove the labels from all the resources (can be null) - int(1…)
}
{
"status" : "ok"
}
Field | Type | Description |
---|---|---|
ids | Malformed | An identifier is repeated |
resources | Malformed | A resource is repeated |
resources | Malformed | There cannot be more than 1000 resources |