updateTaxRate
Requires permission products:tax:update.
Updates a tax rate. A code already used by another rate is refused. A rate cannot be deactivated while the catalog or the organization's defaults rely on it, or when it is the only live rate of a group in use. Needs the tax update 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 UpdateTaxRate($input: UpdateTaxRateInput!) {
updateTaxRate(input: $input) {
id
code
postalCode
name
groupName
type
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation UpdateTaxRate($input: UpdateTaxRateInput!) {\n updateTaxRate(input: $input) {\n id\n code\n postalCode\n name\n groupName\n type\n }\n}",
"variables": {
"input": {
"id": "id"
}
}
}
EOF
Variables:
{
"input": {
"id": "id"
}
}
Response:
{
"data": {
"updateTaxRate": {
"id": "id",
"code": "string",
"postalCode": "string",
"name": "string",
"groupName": "string",
"type": "string"
}
}
}
updateTaxRate(
input: UpdateTaxRateInput!
): TaxRate!
Arguments
updateTaxRate.input ● UpdateTaxRateInput! non-null input
The ID of the tax rate and the fields to change.
Type
TaxRate object
A tax rate.