tanqoryExtMessagingAutomation
- Query
- Other operations
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
id | ID! | Required |
Returns
| Field | Type | Description |
|---|---|---|
channels | [TanqoryExtMessagingChannel!]! | The channels of its messages. |
createdAt | DateTime! | |
delayMinutes | Int! | Minutes between the trigger and the first message. |
discountCode | String | The discount's code (its first). |
discountId | ID | The code discount its emails offer as {{ discount_code }}; null when none is chosen. |
discountUsable | Boolean! | Whether the chosen discount can be used now (started, not ended); emails naming the code are skipped otherwise. |
id | ID! | |
lapseDays | Int | NO_ORDER_60_DAYS: days since the customer's last order (default 60); null for other triggers. |
lastTriggeredAt | DateTime | |
messages | [TanqoryExtMessagingMessage!]! | |
name | String! | |
offersDiscount | Boolean! | Whether it offers a discount (its template does, or an email names {{ discount_code }}): it is turned on only with one. |
sendTo | TanqoryExtAbandonedCheckoutEmailSendTo | CHECKOUT_ABANDONED automations: who gets the email (SUBSCRIBERS unless the merchant chose ANYONE). Null for the other triggers. |
status | TanqoryExtMessagingAutomationStatus! | |
templateKey | String! | |
trigger | String! | CHECKOUT_ABANDONED, CART_ABANDONED, PRODUCT_BROWSE_ABANDONED, CUSTOMER_SUBSCRIBED, ORDER_PAID, FIRST_ORDER, FIRST_TWO_ORDERS (a thank-you after the first and after the second order, one step each), FIRST_ORDER_NEAR_RETAIL (a first online order shipped near one of the store's retail locations), NO_ORDER_60_DAYS (lapseDays since the last order), CUSTOMER_BIRTHDAY or CUSTOMER_TAGGED_VIP (tagged VIP, or past the VIP thresholds). |
vipMinOrders | Int | CUSTOMER_TAGGED_VIP: besides the VIP tag, at least this many paid orders and vipMinSpent spent make a customer VIP; null = the tag only. |
vipMinSpent | Decimal | CUSTOMER_TAGGED_VIP: the amount spent (store currency, decimal string) that, with vipMinOrders, makes a customer VIP. |
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":"query TanqoryExtMessagingAutomation($id: ID!) {\n tanqoryExtMessagingAutomation(id: $id) {\n channels\n createdAt\n delayMinutes\n discountCode\n discountId\n discountUsable\n id\n lapseDays\n lastTriggeredAt\n messages { id }\n }\n}","variables":{"id":"gid://tanqory/Type/id"}}'// Node.js 18 or later (fetch is built in). Save as request.mjs and run: node request.mjs
const query = `query TanqoryExtMessagingAutomation(\$id: ID!) {
tanqoryExtMessagingAutomation(id: \$id) {
channels
createdAt
delayMinutes
discountCode
discountId
discountUsable
id
lapseDays
lastTriggeredAt
messages { id }
}
}`;
const variables = {
"id": "gid://tanqory/Type/id"
};
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 = """query TanqoryExtMessagingAutomation($id: ID!) {
tanqoryExtMessagingAutomation(id: $id) {
channels
createdAt
delayMinutes
discountCode
discountId
discountUsable
id
lapseDays
lastTriggeredAt
messages { id }
}
}"""
variables = json.loads("""{
"id": "gid://tanqory/Type/id"
}""")
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))