tanqoryExtReportRun
- Query
- Apps and platform
Runs a report query and answers its table. A query with an error answers parseErrors ("Line 3: Column 'x' not found.") and no rows. Amounts are in the store currency; percentages are fractions (0.25 = 25%).
Arguments
| Argument | Type | Required | Default | Description |
|---|---|---|---|---|
currencyCode | String | Optional | The currency to show money in (the Controls panel's Currency). Converted from the store currency at the store's exchange rate; without a rate the answer stays in the store currency ( | |
query | String! | Required |
Returns
TanqoryExtReportResult! The answer of a report query.
| Field | Type | Description |
|---|---|---|
availableDimensions | [TanqoryExtReportField!]! | |
availableMetrics | [TanqoryExtReportField!]! | The table's metrics and dimensions (the Controls panel's add lists). |
columns | [TanqoryExtReportColumn!]! | Dimensions first, then each metric followed by its comparison, percent change and group totals columns. |
compareSince | DateTime | |
compareUntil | DateTime | |
currencyCode | String! | |
otherDimensions | [TanqoryExtReportField!]! | The dimensions of the other data sets, each with its data set in |
otherMetrics | [TanqoryExtReportField!]! | The metrics of the other data sets, each with its data set in |
parseErrors | [String!]! | The query's errors; empty when it ran. |
productCards | [TanqoryExtReportProductCard!]! | The products behind the rows' product titles, for the product cell's card (image, title, ID, status), as the reference's product report cells. Empty when the query has no product_title column. |
rows | [JSON!]! | One object per row, keyed by column name. |
since | DateTime | The period the query covered, and its comparison period (COMPARE TO). |
table | String | The table the query reads (FROM), as written. |
timeseries | String | The time dimension of a time series (day, week, month ...), else null. |
totals | JSON | WITH TOTALS: the metrics over the whole period (computed, not summed), keyed by column name. |
until | DateTime | |
visualization | TanqoryExtReportVisualization | VISUALIZE: the chart type and the columns it draws. |
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 TanqoryExtReportRun($query: String!) {\n tanqoryExtReportRun(query: $query) {\n compareSince\n compareUntil\n currencyCode\n parseErrors\n productCards { id }\n rows\n since\n table\n timeseries\n totals\n }\n}","variables":{"query":""}}'// Node.js 18 or later (fetch is built in). Save as request.mjs and run: node request.mjs
const query = `query TanqoryExtReportRun(\$query: String!) {
tanqoryExtReportRun(query: \$query) {
compareSince
compareUntil
currencyCode
parseErrors
productCards { id }
rows
since
table
timeseries
totals
}
}`;
const variables = {
"query": ""
};
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 TanqoryExtReportRun($query: String!) {
tanqoryExtReportRun(query: $query) {
compareSince
compareUntil
currencyCode
parseErrors
productCards { id }
rows
since
table
timeseries
totals
}
}"""
variables = json.loads("""{
"query": ""
}""")
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))