tanqoryExtShippingDocumentsRender
- Mutation
- Orders and payments
The printable HTML of the orders' shipping documents ("Print packing slips", "Print multiple documents"): for each order, each kind asked for (packing slip, invoice, pick list order), rendered from the store's default template of that kind (Settings > Shipping and delivery > Documents). Each document is one printed page. templateIds adds documents printed from those templates of the store (any of its documents, a Blank template included: the "Print multiple documents" dialog lists them all), after the kinds asked for, in the given order. collate (default true) keeps each order's documents together; false prints every document of one kind, then the next kind. BLANK (no order, or neither a kind nor a template), TOO_LONG (more than 50 orders, or more than 20 templates), NOT_FOUND (an order or a template of another store, or unknown).
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
collate | Boolean | Optional | |
kinds | [TanqoryExtShippingDocumentKind!]! | Required | |
orderIds | [ID!]! | Required | |
templateIds | [ID!] | Optional |
Returns
TanqoryExtShippingDocumentsRenderPayload
| Field | Type | Description |
|---|---|---|
html | String | A whole HTML page, ready to print. |
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 -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 TanqoryExtShippingDocumentsRender($kinds: [TanqoryExtShippingDocumentKind!]!, $orderIds: [ID!]!) {\n tanqoryExtShippingDocumentsRender(kinds: $kinds, orderIds: $orderIds) {\n html\n userErrors {\n code\n field\n message\n }\n }\n}","variables":{"kinds":[],"orderIds":[]}}'// Node.js 18 or later (fetch is built in). Save as request.mjs and run: node request.mjs
const query = `mutation TanqoryExtShippingDocumentsRender(\$kinds: [TanqoryExtShippingDocumentKind!]!, \$orderIds: [ID!]!) {
tanqoryExtShippingDocumentsRender(kinds: \$kinds, orderIds: \$orderIds) {
html
userErrors {
code
field
message
}
}
}`;
const variables = {
"kinds": [],
"orderIds": []
};
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 TanqoryExtShippingDocumentsRender($kinds: [TanqoryExtShippingDocumentKind!]!, $orderIds: [ID!]!) {
tanqoryExtShippingDocumentsRender(kinds: $kinds, orderIds: $orderIds) {
html
userErrors {
code
field
message
}
}
}"""
variables = json.loads("""{
"kinds": [],
"orderIds": []
}""")
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))