createTaxGroup
Requires permission products:tax:create.
Creates a tax group from existing tax rates. Every rate listed must exist, and the code must not be used by another tax group. Needs the tax create permission.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation CreateTaxGroup($input: CreateTaxGroupInput!) {
createTaxGroup(input: $input) {
id
code
name
createdAt
calculationMethod
description
taxRates {
id
createdAt
taxGroupId
taxRateId
updatedAt
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation CreateTaxGroup($input: CreateTaxGroupInput!) {\n createTaxGroup(input: $input) {\n id\n code\n name\n createdAt\n calculationMethod\n description\n taxRates {\n id\n createdAt\n taxGroupId\n taxRateId\n updatedAt\n }\n }\n}",
"variables": {
"input": {
"calculationMethod": "ADDITIVE",
"code": "string",
"isActive": true,
"name": "string",
"taxRateIds": [
"string"
]
}
}
}
EOF
Variables:
{
"input": {
"calculationMethod": "ADDITIVE",
"code": "string",
"isActive": true,
"name": "string",
"taxRateIds": [
"string"
]
}
}
Response:
{
"data": {
"createTaxGroup": {
"id": "id",
"code": "string",
"name": "string",
"createdAt": "2025-01-15T00:00:00Z",
"calculationMethod": "string",
"description": "string",
"taxRates": [
{
"id": "id",
"createdAt": "2025-01-15T00:00:00Z",
"taxGroupId": "string",
"taxRateId": "string",
"updatedAt": "2025-01-15T00:00:00Z"
}
]
}
}
}
createTaxGroup(
input: CreateTaxGroupInput!
): TaxGroup!
Arguments
createTaxGroup.input ● CreateTaxGroupInput! non-null input
The tax group's name, code and the tax rates it holds.
Type
TaxGroup object
A set of tax rates applied together.