Returns the tax areas that meet the given conditions.
Admin SDKAdmin.api('commerce.tax-areas.find', request, function(response) { … });
HTTP POST/api/v10/commerce.tax-areas.find
{
"conditions" : { // returns the tax areas …
"isActive" : true, // … that are active or not - bool
"country" : "GB", // … that have this country - string(2)
"after" : 5 // … with identifier after this value - int(0…)
},
"fields" : [ "id", "code", "name", … ], // fields to return - string
"order" : [ "name" ], // sort order of returned tax areas, can contain "id", "-id", "name", "-name", "isActive", "-isActive",
// "taxCompanies", "-taxCompanies", "countries" and "-countries" - string
"limit" : 10, // maximum number of tax areas to return - int(1…)
"first" : 0 // index of the first tax area to return - int(0…)
}
{
"status" : "ok",
"taxAreas" : [ {
"id" : 5, // identifier - int(1…)
"code" : "EUROPE", // code - string(0…32)
"name" : "Europe", // name - string(0…60)
"isActive" : true, // indicates if it is active - bool
"taxCompanies" : true, // indicates if taxes are also applied to companies - bool
"countries" : [ "FR", "GB", … ], // countries which it is applied - string(2)
"rates" : { // tax rate for each tax class - int(1…) -> decimal[4,2](0…100)
"1" : 19.50,
"3" : 0.00,
"4" : 12.00
}
}, … ]
}
Returns a tax area given its identifier.
Admin SDKAdmin.api('commerce.tax-areas.get', request, function(response) { … });
HTTP POST/api/v10/commerce.tax-areas.get
{
"id" : 5, // identifier (required) - int(1…)
"fields" : [ "id", "code", "name", … ] // fields to return - string
}
{
"status" : "ok",
"taxArea" : { // (can be null)
"id" : 5, // identifier - int(1…)
"code" : "EUROPE", // code - string(0…32)
"name" : "Europe", // name - string(0…60)
"isActive" : true, // indicates if it is active - bool
"taxCompanies" : true, // indicates if taxes are also applied to companies - bool
"countries" : [ "FR", "GB", … ], // countries which it is applied - string(2)
"rates" : { // tax rate for each tax class - int(1…) -> decimal[4,2](0…100)
"1" : 19.50,
"3" : 0.00,
"4" : 12.00
}
}
}
Number of tax areas that meet the given conditions.
Admin SDKAdmin.api('commerce.tax-areas.count', request, function(response) { … });
HTTP POST/api/v10/commerce.tax-areas.count
{
"conditions" : { // counts the tax areas …
"isActive" : true, // … that are active or not - bool
"country" : "GB", // … that have this country - string(2)
"after" : 5 // … with identifier after this value - int(0…)
}
}
{
"status" : "ok",
"count" : 6 // number of tax areas - int(0…)
}
Creates a new tax area.
Admin SDKAdmin.api('commerce.tax-areas.create', request, function(response) { … });
HTTP POST/api/v10/commerce.tax-areas.create
{
"taxArea" : { // tax area to create (required)
"code" : "EUROPE", // code - string(0…32)
"name" : "Europe", // name - string(0…60)
"isActive" : true, // indicates if it is active - bool
"taxCompanies" : true, // indicates if taxes are also applied to companies - bool
"countries" : [ "FR", "GB", … ], // countries which it is applied - string(2)
"rates" : { // tax rate for each tax class - int(1…) -> decimal[4,2](0…100)
"1" : 19.50,
"3" : 0.00,
"4" : 12.00
}
}
}
{
"status" : "ok",
"id" : 5 // identifier of the new tax area - int(1…)
}
Field | Type | Description |
---|---|---|
countries | InvalidValue | Country code '<country>' does not exist |
countries | Malformed | Country '<country>' is not a valid country code |
countries | Repeated | Repeated country code '<country>' |
isActive | Invalid | Default tax area must be active |
rates | NotFound | Tax class <taxClass> does not exist |
Updates a tax area. Any fields left out of the request will remain unchanged.
Admin SDKAdmin.api('commerce.tax-areas.update', request, function(response) { … });
HTTP POST/api/v10/commerce.tax-areas.update
{
"id" : 5, // identifier of the tax area to update (required) - int(1…)
"taxArea" : { // tax area's fields to update (required)
"code" : "EUROPE", // code - string(0…32)
"name" : "Europe", // name - string(0…60)
"isActive" : true, // indicates if it is active - bool
"taxCompanies" : true, // indicates if taxes are also applied to companies - bool
"countries" : [ "FR", "GB", … ], // countries which it is applied - string(2)
"rates" : { // tax rate for each tax class - int(1…) -> decimal[4,2](0…100)
"1" : 19.50,
"3" : 0.00,
"4" : 12.00
}
}
}
{
"status" : "ok"
}
Field | Type | Description |
---|---|---|
countries | InvalidValue | Country code '<country>' does not exist |
countries | Malformed | Country '<country>' is not a valid country code |
countries | Repeated | Repeated country code '<country>' |
id | NotFound | Tax area <id> does not exist |
isActive | InvalidValue | Default tax area must be active |
rates | NotFound | Tax class <taxClass> does not exist |
Deletes one or more tax areas.
Admin SDKAdmin.api('commerce.tax-areas.delete', request, function(response) { … });
HTTP POST/api/v10/commerce.tax-areas.delete
{
"ids" : [ 5, 1, 6, … ] // identifiers of the tax areas to delete (required) - int(1…)
}
{
"status" : "ok"
}
Field | Type | Description |
---|---|---|
ids | InvalidValue | Tax area <id> is used by customer group <group> |