tax-classes

tax-classes.find

Returns all the tax classes.

JS
CR.api('commerce.tax-classes.find', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.tax-classes.find

request

{
  "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…100)
  "first" : 0 // index of the first tax class to return - int(0…)
}

response

{
  "status" : "ok",
  "taxClasses" : [ {
    "id" : 7, // identifier - int(1…)
    "code" : "TVA", // code - string(1…32)
    "name" : "Europe" // name - string(0…60)
  }, … ]
}

tax-classes.get

Returns a tax class given its identifier.

JS
CR.api('commerce.tax-classes.get', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.tax-classes.get

request

{
  "id" : 7, // identifier (required) - int(1…)
  "fields" : [ "id", "code", … ] // fields to return - string
}

response

{
  "status" : "ok",
  "taxClass" : { // (can be null)
    "id" : 7, // identifier - int(1…)
    "code" : "TVA", // code - string(1…32)
    "name" : "Europe" // name - string(0…60)
  }
}

tax-classes.count

Number of all the tax classes.

JS
CR.api('commerce.tax-classes.count', null, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.tax-classes.count

response

{
  "status" : "ok",
  "count" : 9 // number of tax classes - int(0…)
}

tax-classes.create

Creates a new tax class.

JS
CR.api('commerce.tax-classes.create', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.tax-classes.create

request

{
  "taxClass" : { // tax class to create (required)
    "code" : "TVA", // code (required) - string(1…32)
    "name" : "Europe" // name - string(0…60)
  }
}

response

{
  "status" : "ok",
  "id" : 7 // identifier of the new tax class - int(1…)
}

tax-classes.update

Updates a tax class. Any fields left out of the request will remain unchanged.

JS
CR.api('commerce.tax-classes.update', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.tax-classes.update

request

{
  "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)
  }
}

response

{
  "status" : "ok"
}

Errors

Field Type Description
id NotFound Tax class <id> does not exist

tax-classes.delete

Deletes one o more tax classes.

JS
CR.api('commerce.tax-classes.delete', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.tax-classes.delete

request

{
  "ids" : [ 7, 3, 5, … ] // identifiers of the tax classes to delete (required) - int(1…)
}

response

{
  "status" : "ok"
}