tanqoryExtCustomerContact
- Mutation
- Customers and B2B
Writes to a customer by email (the reference admin's Contact customer): the store's CONTACT_CUSTOMER notification with the staff member's message, and their subject in place of the template's when one is given. It goes to the customer's own email address, or with orderId to that order's address; an order of another customer is NOT_FOUND. Refused (NOT_ALLOWED) while the platform switch customer_contact_email is off.
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
customerId | ID! | Required | |
input | TanqoryExtCustomerContactInput! | Required |
Returns
TanqoryExtCustomerAccountPayload
| Field | Type | Description |
|---|---|---|
customer | Customer | The customer as stored after the change. |
userErrors | [TanqoryExtCustomerUserError!]! |
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
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 TanqoryExtCustomerContact($customerId: ID!, $input: TanqoryExtCustomerContactInput!) {\n tanqoryExtCustomerContact(customerId: $customerId, input: $input) {\n customer { id }\n userErrors {\n code\n field\n message\n }\n }\n}","variables":{"customerId":"gid://tanqory/Type/id","input":{"message":""}}}'Node.js
// Node.js 18 or later (fetch is built in). Save as request.mjs and run: node request.mjs
const query = `mutation TanqoryExtCustomerContact(\$customerId: ID!, \$input: TanqoryExtCustomerContactInput!) {
tanqoryExtCustomerContact(customerId: \$customerId, input: \$input) {
customer { id }
userErrors {
code
field
message
}
}
}`;
const variables = {
"customerId": "gid://tanqory/Type/id",
"input": {
"message": ""
}
};
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
# Python 3, standard library only. Save as request.py and run: python3 request.py
import json, os, urllib.request
query = """mutation TanqoryExtCustomerContact($customerId: ID!, $input: TanqoryExtCustomerContactInput!) {
tanqoryExtCustomerContact(customerId: $customerId, input: $input) {
customer { id }
userErrors {
code
field
message
}
}
}"""
variables = json.loads("""{
"customerId": "gid://tanqory/Type/id",
"input": {
"message": ""
}
}""")
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))