seedGlobalTaxRates
Requires the permissions products:tax:create and settings:tenant:update.
Adds the built-in standard tax rates for the countries named, or for every supported country when none are named, and returns the rates created. 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 SeedGlobalTaxRates {
seedGlobalTaxRates {
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 SeedGlobalTaxRates {\n seedGlobalTaxRates {\n id\n code\n postalCode\n name\n groupName\n type\n }\n}"
}
EOF
Response:
{
"data": {
"seedGlobalTaxRates": [
{
"id": "id",
"code": "string",
"postalCode": "string",
"name": "string",
"groupName": "string",
"type": "string"
}
]
}
}
seedGlobalTaxRates(
countries: [String!]
): [TaxRate!]!
Arguments
seedGlobalTaxRates.countries ● [String!] list scalar
The country codes to add rates for. Omit it to add the rates of every supported country.
Type
TaxRate object
A tax rate.