Tax Categories
Tax Categories define how Products are to be taxed in different countries.
A maximum number of 100 TaxCategories can be created per Project. Learn more about this limit.
Representations
TaxCategory
idString | Unique ID of the TaxCategory. |
versionInt | Current version of the TaxCategory. |
keyString | User-defined unique identifier for the TaxCategory. MinLength:2MaxLength: 256Pattern: ^[A-Za-z0-9_-]+$ |
createdAt | Date and time (UTC) the TaxCategory was initially created. |
createdByBETA | Present on resources created after 1 February 2019 except for events not tracked. |
lastModifiedAt | Date and time (UTC) the TaxCategory was last updated. |
lastModifiedByBETA | Present on resources created after 1 February 2019 except for events not tracked. |
nameString | Name of the TaxCategory. |
descriptionString | Description of the TaxCategory. |
ratesArray of TaxRate | Tax rates and subrates of states and countries. Each TaxRate in the array has a unique ID assigned by the platform. |
TaxCategoryDraft
keyString | User-defined unique identifier for the TaxCategory. MinLength:2MaxLength: 256Pattern: ^[A-Za-z0-9_-]+$ |
nameString | Name of the TaxCategory. |
descriptionString | Description of the TaxCategory. |
ratesArray of TaxRateDraft | Tax rates and subrates of states and countries. |
TaxCategoryPagedQueryResponse
PagedQueryResult with results containing an array of TaxCategory.
limitInt | Number of results requested in the query request. |
offsetInt | Offset supplied by the client or the server default. It is the number of elements skipped, not a page number. |
countInt | Actual number of results returned. |
totalInt | Total number of results matching the query.
This number is an estimation that is not strongly consistent.
This field is returned by default.
For improved performance, calculating this field can be deactivated by using the query parameter |
resultsArray of TaxCategory | TaxCategories matching the query. |
TaxCategoryReference
Reference to a TaxCategory.
idString | Unique ID of the referenced TaxCategory. |
typeIdString | "tax-category" |
obj | Contains the representation of the expanded TaxCategory. Only present in responses to requests with Reference Expansion for TaxCategory. |
TaxCategoryResourceIdentifier
idString | Unique ID of the referenced TaxCategory. Either |
keyString | Unique key of the referenced TaxCategory. Either 2MaxLength: 256Pattern: ^[A-Za-z0-9_-]+$ |
typeIdString | "tax-category" |
TaxRate
idString | Present if the TaxRate is part of a TaxCategory. Absent for external TaxRates in LineItem, CustomLineItem, and ShippingInfo. |
nameString | Name of the TaxRate. |
amountFloat | Tax rate. If subrates are used, the amount must be the sum of all subrates. Maximum:1 |
includedInPriceBoolean | |
country | Country in which the tax rate is applied in ISO 3166-1 alpha-2 format. Pattern:^[A-Z]{2}$ |
stateString | State within the country, such as Texas in the United States. |
subRatesArray of SubRate | Used to calculate the taxPortions field in a Cart or Order. It is useful if the total tax of a country (such as the US) is a combination of multiple taxes (such as state and local taxes). |
SubRate BETA
It is used to calculate the taxPortions field in a Cart or Order.
nameString | Name of the SubRate. |
amountFloat | Maximum: 1 |
TaxRateDraft
nameString | Name of the TaxRate. |
amountFloat | Tax rate.
Must be supplied if no 1 |
includedInPriceBoolean | Set to |
country | Country in which the tax rate is applied in ISO 3166-1 alpha-2 format. Pattern:^[A-Z]{2}$ |
stateString | State within the country, such as Texas in the United States. |
subRatesArray of SubRate | Used to calculate the taxPortions field in a Cart or Order. It is useful if the total tax of a country (such as the US) is a combination of multiple taxes (such as state and local taxes). |
Get TaxCategory
Get TaxCategory by ID
view_products:{projectKey}, view_tax_categories:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
idString |
|
expand | The parameter can be passed multiple times. |
200TaxCategory
curl -X GET https://api.{region}.commercetools.com/{projectKey}/tax-categories/{id} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
Get TaxCategory by Key
view_products:{projectKey}, view_tax_categories:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
keyString |
|
expand | The parameter can be passed multiple times. |
200TaxCategory
curl -X GET https://api.{region}.commercetools.com/{projectKey}/tax-categories/key={key} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
Query TaxCategories
view_products:{projectKey}, view_tax_categories:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
where | The parameter can be passed multiple times. |
/^var[.][a-zA-Z0-9]+$/Any string parameter matching this regular expression | Predicate parameter values. The parameter can be passed multiple times. |
sort | The parameter can be passed multiple times. |
expand | The parameter can be passed multiple times. |
limitInt | Number of results returned. |
offsetInt | Number of results skipped. |
withTotalBoolean | Controls the calculation of the total number of query results. Set to |
curl -X GET https://api.{region}.commercetools.com/{projectKey}/tax-categories -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
Create TaxCategory
manage_products:{projectKey}, manage_tax_categories:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
expand | The parameter can be passed multiple times. |
201TaxCategory
curl -X POST https://api.{region}.commercetools.com/{projectKey}/tax-categories -i \--header 'Authorization: Bearer ${BEARER_TOKEN}' \--header 'Content-Type: application/json' \--data-binary @- << DATA{"name" : "test-tax-category","rates" : [ {"name" : "test-tax-category","amount" : 0.2,"includedInPrice" : true,"country" : "DE"} ]}DATA
Update TaxCategory
Update TaxCategory by ID
manage_products:{projectKey}, manage_tax_categories:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
idString |
|
expand | The parameter can be passed multiple times. |
versionInt | Expected version of the TaxCategory on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned. |
actionsArray of TaxCategoryUpdateAction | Update actions to be performed on the TaxCategory. |
200TaxCategory
curl -X POST https://api.{region}.commercetools.com/{projectKey}/tax-categories/{id} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}' \--header 'Content-Type: application/json' \--data-binary @- << DATA{"version" : 1,"actions" : [ {"action" : "changeName","name" : "New Name"} ]}DATA
Update TaxCategory by Key
manage_products:{projectKey}, manage_tax_categories:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
keyString |
|
expand | The parameter can be passed multiple times. |
versionInt | Expected version of the TaxCategory on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned. |
actionsArray of TaxCategoryUpdateAction | Update actions to be performed on the TaxCategory. |
200TaxCategory
curl -X POST https://api.{region}.commercetools.com/{projectKey}/tax-categories/key={key} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}' \--header 'Content-Type: application/json' \--data-binary @- << DATA{"version" : 1,"actions" : [ {"action" : "changeName","name" : "New Name"} ]}DATA
Update actions
Change Name
actionString | "changeName" |
nameString | New value to set. Must not be empty. |
{"action" : "changeName","name" : "name"}
Set Key
keyString | Value to set. If empty, any existing value will be removed. MinLength:2MaxLength: 256Pattern: ^[A-Za-z0-9_-]+$ |
actionString | "setKey" |
{"action" : "setKey","key" : "keyString"}
Set Description
actionString | "setDescription" |
descriptionString | Value to set. If empty, any existing value will be removed. |
{"action" : "setDescription","description" : "new Description"}
Add TaxRate
actionString | "addTaxRate" |
taxRate | Value to append to the |
{"action" : "addTaxRate","taxRate" : {"name" : "TaxRateName","amount" : 0.3,"includedInPrice" : true,"country" : "DE"}}
Replace TaxRate
actionString | "replaceTaxRate" |
taxRateIdString | ID of the TaxRate to replace. |
taxRate | New TaxRate to replace with. |
{"action" : "replaceTaxRate","taxRateId" : "{{taxRateID}}","taxRate" : {"name" : "TaxRateName","amount" : 0.4,"includedInPrice" : true,"country" : "DE"}}
Remove TaxRate
actionString | "removeTaxRate" |
taxRateIdString | ID of the TaxRate to remove. |
{"action" : "removeTaxRate","taxRateId" : "{{taxRateID}}"}
Delete TaxCategory
Delete TaxCategory by ID
manage_products:{projectKey}, manage_tax_categories:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
idString |
|
expand | The parameter can be passed multiple times. |
versionInt | Last seen version of the resource. |
200TaxCategory
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/tax-categories/{id}?version={version} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
Delete TaxCategory by Key
manage_products:{projectKey}, manage_tax_categories:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
keyString |
|
expand | The parameter can be passed multiple times. |
versionInt | Last seen version of the resource. |
200TaxCategory
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/tax-categories/key={key}?version={version} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'