Returns all the tax classes.
Admin SDKAdmin.api('commerce.tax-classes.find', request, function(response) { … });
HTTP POST/api/v10/commerce.tax-classes.find
{
"conditions" : { // counts the tax classes …
"after" : 2 // … with identifier after this value - int(0…)
},
"fields" : [ "id", "code", … ], // fields to return - string
"order" : [ "name" ], // sort order of returned tax classes, can contain "id", "-id", "code", "-code", "name" and "-name" - string
"limit" : 10, // maximum number of tax classes to return - int(1…)
"first" : 0 // index of the first tax class to return - int(0…)
}
{
"status" : "ok",
"taxClasses" : [ {
"id" : 7, // identifier - int(1…)
"code" : "TVA", // code - string(1…32)
"name" : "Europe" // name - string(0…60)
}, … ]
}
Returns a tax class given its identifier.
Admin SDKAdmin.api('commerce.tax-classes.get', request, function(response) { … });
HTTP POST/api/v10/commerce.tax-classes.get
{
"id" : 7, // identifier (required) - int(1…)
"fields" : [ "id", "code", … ] // fields to return - string
}
{
"status" : "ok",
"taxClass" : { // (can be null)
"id" : 7, // identifier - int(1…)
"code" : "TVA", // code - string(1…32)
"name" : "Europe" // name - string(0…60)
}
}
Number of tax classes that meet the given conditions.
Admin SDKAdmin.api('commerce.tax-classes.count', request, function(response) { … });
HTTP POST/api/v10/commerce.tax-classes.count
{
"conditions" : { // counts the tax classis …
"after" : 2 // … with identifier after this value - int(0…)
}
}
{
"status" : "ok",
"count" : 9 // number of tax classes - int(0…)
}
Creates a new tax class.
Admin SDKAdmin.api('commerce.tax-classes.create', request, function(response) { … });
HTTP POST/api/v10/commerce.tax-classes.create
{
"taxClass" : { // tax class to create (required)
"code" : "TVA", // code (required) - string(1…32)
"name" : "Europe" // name - string(0…60)
}
}
{
"status" : "ok",
"id" : 7 // identifier of the new tax class - int(1…)
}
Field | Type | Description |
---|---|---|
code | AlreadyExists | Tax class code '<code> ' already exists |
Updates a tax class. Any fields left out of the request will remain unchanged.
Admin SDKAdmin.api('commerce.tax-classes.update', request, function(response) { … });
HTTP POST/api/v10/commerce.tax-classes.update
{
"id" : 43, // identifier of the tax class to update (required) - int(1…)
"taxClass" : { // tax class's fields to update (required)
"code" : "TVA", // code - string(1…32)
"name" : "Europe" // name - string(0…60)
}
}
{
"status" : "ok"
}
Field | Type | Description |
---|---|---|
code | AlreadyExists | Tax class code '<code> ' already exists |
id | NotFound | Tax class <id> does not exist |
Deletes one o more tax classes.
Admin SDKAdmin.api('commerce.tax-classes.delete', request, function(response) { … });
HTTP POST/api/v10/commerce.tax-classes.delete
{
"ids" : [ 7, 3, 5, … ] // identifiers of the tax classes to delete (required) - int(1…)
}
{
"status" : "ok"
}