customer
- Query
- Storefront
Returns the signed-in customer that a valid customerAccessToken belongs to, or null when the token is unknown or expired.
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
customerAccessToken | String! | Required |
Returns
Customer A shopper's account with the store: name, email, phone, saved addresses, orders, tags and marketing consent.
| Field | Type | Description |
|---|---|---|
acceptsMarketing | Boolean! | |
addresses | MailingAddressConnection! | |
avatarUrl | String | |
createdAt | DateTime! | |
defaultAddress | MailingAddress | |
displayName | String! | |
email | String | |
firstName | String | |
id | ID! | |
lastName | String | |
metafield | Metafield | |
metafields | [Metafield]! |
|
numberOfOrders | UnsignedInt64! | |
orders | OrderConnection! | |
phone | String | |
socialLoginProvider | SocialLoginProvider | |
tags | [String!]! | |
updatedAt | DateTime! | |
tanqoryExtPendingEmail | String | The new email the customer asked for with customerUpdate, waiting for them to confirm it from the link mailed to that address; null when no change is waiting or its link has expired. |
tanqoryExtOrder | Order | One of this customer's own orders by its ID (gid://tanqory/Order/<uuid>); null for any other order. Private token only.
|
tanqoryExtSubscriptionContracts | [TanqoryExtSubscriptionContract!]! | The customer's subscription contracts, newest first (A-09). Private token only. |
tanqoryExtCompanyLocations | [TanqoryExtCompanyLocation!]! | The B2B company locations the customer has a role at (A-23). Private token only. |
tanqoryExtCompanyLocation | TanqoryExtCompanyLocation | One of those locations by id (a CompanyLocation gid), or null when the customer may not buy for it. Private token only.
|
tanqoryExtStoreCreditAccounts | [TanqoryExtStoreCreditAccount!]! | The customer's store credit accounts and balances (A-24). Private token only. |
tanqoryExtMarketingConsent | TanqoryExtCustomerMarketingConsent! | Email, SMS and WhatsApp marketing consent (A-05). Email consent is changed with customerUpdate(acceptsMarketing). Private token only. |
Example request
A starting point: required arguments as variables and a few fields of the result. Replace the placeholders.
Set STORE_ID and TANQORY_STOREFRONT_TOKEN in your environment first (Make your first API call).
curl -X POST "https://$STORE_HOST/api/v1/stores/$STORE_ID/2026-10/graphql" \
-H "X-Tanqory-Storefront-Access-Token: $TANQORY_STOREFRONT_TOKEN" \
-H "Content-Type: application/json" \
--data '{"query":"query Customer($customerAccessToken: String!) {\n customer(customerAccessToken: $customerAccessToken) {\n acceptsMarketing\n avatarUrl\n createdAt\n defaultAddress { id }\n displayName\n email\n firstName\n id\n lastName\n numberOfOrders\n }\n}","variables":{"customerAccessToken":""}}'// Node.js 18 or later (fetch is built in). Save as request.mjs and run: node request.mjs
const query = `query Customer(\$customerAccessToken: String!) {
customer(customerAccessToken: \$customerAccessToken) {
acceptsMarketing
avatarUrl
createdAt
defaultAddress { id }
displayName
email
firstName
id
lastName
numberOfOrders
}
}`;
const variables = {
"customerAccessToken": ""
};
const res = await fetch(`https://${process.env.STORE_HOST}/api/v1/stores/${process.env.STORE_ID}/2026-10/graphql`, {
method: 'POST',
headers: {
'X-Tanqory-Storefront-Access-Token': process.env.TANQORY_STOREFRONT_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 = """query Customer($customerAccessToken: String!) {
customer(customerAccessToken: $customerAccessToken) {
acceptsMarketing
avatarUrl
createdAt
defaultAddress { id }
displayName
email
firstName
id
lastName
numberOfOrders
}
}"""
variables = json.loads("""{
"customerAccessToken": ""
}""")
req = urllib.request.Request(
"https://" + os.environ["STORE_HOST"] + "/api/v1/stores/" + os.environ["STORE_ID"] + "/2026-10/graphql",
data=json.dumps({"query": query, "variables": variables}).encode(),
headers={
"X-Tanqory-Storefront-Access-Token": os.environ["TANQORY_STOREFRONT_TOKEN"],
"Content-Type": "application/json",
},
)
with urllib.request.urlopen(req) as res:
print(res.status, json.dumps(json.load(res), indent=2))