appCreateTaxRate
Requires permission products:tax:create.
Create a tax rate from an installed app. The rate is stored data: ARC decides where it applies and works out every amount. The rate belongs to the app and is switched off when the app is uninstalled. Needs write_tax_rates.
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 AppCreateTaxRate($input: AppCreateTaxRateInput!) {
appCreateTaxRate(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 AppCreateTaxRate($input: AppCreateTaxRateInput!) {\n appCreateTaxRate(input: $input) {\n id\n code\n postalCode\n name\n groupName\n type\n }\n}",
"variables": {
"input": {
"calculationMethod": "ADDITIVE",
"code": "string",
"country": "string",
"jurisdiction": "CITY",
"name": "string",
"rate": "string",
"type": "CARBON_TAX"
}
}
}
EOF
Variables:
{
"input": {
"calculationMethod": "ADDITIVE",
"code": "string",
"country": "string",
"jurisdiction": "CITY",
"name": "string",
"rate": "string",
"type": "CARBON_TAX"
}
}
Response:
{
"data": {
"appCreateTaxRate": {
"id": "id",
"code": "string",
"postalCode": "string",
"name": "string",
"groupName": "string",
"type": "string"
}
}
}
appCreateTaxRate(
input: AppCreateTaxRateInput!
): TaxRate!
Arguments
appCreateTaxRate.input ● AppCreateTaxRateInput! non-null input
The rate, its code and where it applies.
Type
TaxRate object
A tax rate.