tanqoryExtCompanyLocationTaxExemptionExpirySet
- Mutation
- Customers and B2B
Sets or clears the expiry dates of a company location's tax exemption certificates. Each exemption must be one the location holds (CompanyLocation.taxExemptions); expiresOn: null clears its date. Revoking an exemption also clears its date. Refused with INVALID while the staff switch b2b_exemption_dates is off.
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
companyLocationId | ID! | Required | |
expiries | [TanqoryExtTaxExemptionExpiryInput!]! | Required |
Returns
TanqoryExtCompanyLocationTaxExemptionExpirySetPayload
| Field | Type | Description |
|---|---|---|
companyLocation | CompanyLocation | |
userErrors | [BusinessCustomerUserError!]! | RESOURCE_NOT_FOUND at ["companyLocationId"]; INVALID_INPUT at ["expiries", i, "exemption"] for an exemption the location does not hold; INVALID while the switch is off. |
Example request
A starting point: required arguments as variables and a few fields of the result. Replace the placeholders.
Set STORE_ID and TANQORY_ACCESS_TOKEN in your environment first (Make your first API call).
curl -X POST "https://api.tanqory.com/admin/2026-10/stores/$STORE_ID/graphql" \
-H "Authorization: Bearer $TANQORY_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
--data '{"query":"mutation TanqoryExtCompanyLocationTaxExemptionExpirySet($companyLocationId: ID!, $expiries: [TanqoryExtTaxExemptionExpiryInput!]!) {\n tanqoryExtCompanyLocationTaxExemptionExpirySet(companyLocationId: $companyLocationId, expiries: $expiries) {\n companyLocation { id }\n userErrors {\n code\n field\n message\n }\n }\n}","variables":{"companyLocationId":"gid://tanqory/Type/id","expiries":[]}}'// Node.js 18 or later (fetch is built in). Save as request.mjs and run: node request.mjs
const query = `mutation TanqoryExtCompanyLocationTaxExemptionExpirySet(\$companyLocationId: ID!, \$expiries: [TanqoryExtTaxExemptionExpiryInput!]!) {
tanqoryExtCompanyLocationTaxExemptionExpirySet(companyLocationId: \$companyLocationId, expiries: \$expiries) {
companyLocation { id }
userErrors {
code
field
message
}
}
}`;
const variables = {
"companyLocationId": "gid://tanqory/Type/id",
"expiries": []
};
const res = await fetch(`https://api.tanqory.com/admin/2026-10/stores/${process.env.STORE_ID}/graphql`, {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + process.env.TANQORY_ACCESS_TOKEN,
'Content-Type': 'application/json',
},
body: JSON.stringify({ query, variables }),
});
console.log(res.status, JSON.stringify(await res.json(), null, 2));# Python 3, standard library only. Save as request.py and run: python3 request.py
import json, os, urllib.request
query = """mutation TanqoryExtCompanyLocationTaxExemptionExpirySet($companyLocationId: ID!, $expiries: [TanqoryExtTaxExemptionExpiryInput!]!) {
tanqoryExtCompanyLocationTaxExemptionExpirySet(companyLocationId: $companyLocationId, expiries: $expiries) {
companyLocation { id }
userErrors {
code
field
message
}
}
}"""
variables = json.loads("""{
"companyLocationId": "gid://tanqory/Type/id",
"expiries": []
}""")
req = urllib.request.Request(
"https://api.tanqory.com/admin/2026-10/stores/" + os.environ["STORE_ID"] + "/graphql",
data=json.dumps({"query": query, "variables": variables}).encode(),
headers={
"Authorization": "Bearer " + os.environ["TANQORY_ACCESS_TOKEN"],
"Content-Type": "application/json",
},
)
with urllib.request.urlopen(req) as res:
print(res.status, json.dumps(json.load(res), indent=2))