autoConfigureTax
Requires the permissions products:tax:create and settings:tenant:update.
Sets up tax for a country in one step: adds the country's standard tax rates and creates its standard tax groups. Needs both the tax create and the tenant settings update permissions.
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 AutoConfigureTax($countryCode: String!) {
autoConfigureTax(countryCode: $countryCode) {
defaultSalesTaxGroupId
groupsCreated
ratesCreated
success
taxSystemType
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation AutoConfigureTax($countryCode: String!) {\n autoConfigureTax(countryCode: $countryCode) {\n defaultSalesTaxGroupId\n groupsCreated\n ratesCreated\n success\n taxSystemType\n }\n}",
"variables": {
"countryCode": "string"
}
}
EOF
Variables:
{
"countryCode": "string"
}
Response:
{
"data": {
"autoConfigureTax": {
"defaultSalesTaxGroupId": "string",
"groupsCreated": 0,
"ratesCreated": 0,
"success": true,
"taxSystemType": "string"
}
}
}
autoConfigureTax(
countryCode: String!
currency: String
): AutoConfigureTaxResult!
Arguments
autoConfigureTax.countryCode ● String! non-null scalar
The country to set up tax for.
autoConfigureTax.currency ● String scalar
The currency code to configure the country's tax with. Omit it to use the organization's.
Type
AutoConfigureTaxResult object
The result of setting up tax automatically for an organization.