Tax GraphQL
View as MarkdownQuery and mutate taxes and rates on the commerce tax subgraph.
Store-scoped tax GraphQL over HTTP. Use commerce.tax:read to query,
commerce.tax:create / commerce.tax:write / commerce.tax:delete to mutate
(by operation). See Commerce API Scopes.
Endpoint: POST /v2/commerce/stores/{storeId}/tax-subgraph
Send the same store ID in the {storeId} path and the x-store-id header. The
header is required. If they differ, the subgraph uses the header. A missing
header returns HTTP 200 AUTHENTICATION_ERROR (Failed to authorize), not HTTP
401.
For SimpleMoneyInput.value, send 1999 for $19.99 USD, not 19.99.
Sidebar is grouped by action/resource. Expand a resource, then Query
(commerce.tax:read, 8 fields) or Mutation
(38 fields; scope depends on the verb). The live gateway also
exposes _service; it is omitted here.
Example query
queryRequires commerce.tax:read. See classification for the full schema.
query GetClassification($id: ID!) {
classification(id: $id) {
id
name
label
}
}curl -X POST "https://api.godaddy.com/v2/commerce/stores/{storeId}/tax-subgraph" \
-H "Authorization: Bearer $GODADDY_PAT" \
-H "Content-Type: application/json" \
-H "x-store-id: {storeId}" \
-d '{
"query": "query GetClassification($id: ID!) { classification(id: $id) { id name label } }",
"variables": { "id": "CLASSIFICATION_ID" }
}'Example mutation
mutationRequires commerce.tax:create. See createRate for the full schema.
mutation CreateRate($input: MutationCreateRateInput!) {
createRate(input: $input) {
id
name
status
}
}{
"input": {
"label": "Sales tax",
"value": { "percentage": "8.5" }
}
}HTTP reference
OpenAPI contract for the subgraph POST (headers, auth, response envelope):
Personal Access Token (PAT). Include as Authorization: Bearer $GODADDY_PAT. Required scopes: commerce.tax:read, commerce.tax:create, commerce.tax:write, commerce.tax:delete.
In: header
Scope: commerce.tax:read
Path Parameters
A universally unique identifier (UUID) in RFC-4122 format.
uuidHeader Parameters
Required store ID. Send the same value as {storeId} in the path. If they differ, the subgraph uses this header.
uuidRequest Body
application/json
Response Body
application/json
curl -X POST "https://example.com/stores/497f6eca-6276-4993-bfeb-53cbbbba6f08/tax-subgraph" \ -H "x-store-id: 497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "Content-Type: application/json" \ -d '{ "query": "query GetClassification($id: ID!) { classification(id: $id) { id } }", "variables": { "id": "CLASSIFICATION_ID" } }'{ "data": {}, "errors": [ {} ]}Last updated on
How is this guide?