tanqoryExtShippingDocumentsPdf
- Mutation
- Orders and payments
The same documents as tanqoryExtShippingDocumentsRender, as one ready PDF: each document looks exactly like its template (colours, table lines, images), laid out on paperSize (default LETTER), documentsPerPage documents to a sheet (1 or 2, default 1), with no browser header or footer. Answers a signed link to the file, valid for 15 minutes, and its name: shipping_documents_8_x_11.pdf (the paper) for several documents, packing_slip_1003_20261124T024902Z.pdf (kind, order number, UTC time) for one. Works only while the documents_pdf switch is on (tanqoryExtShippingDocumentsPdfEnabled); otherwise NOT_ALLOWED. Same userErrors as tanqoryExtShippingDocumentsRender, plus one with no code when the PDF cannot be made now.
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
collate | Boolean | Optional | |
documentsPerPage | Int | Optional | |
kinds | [TanqoryExtShippingDocumentKind!]! | Required | |
orderIds | [ID!]! | Required | |
paperSize | TanqoryExtShippingDocumentPaperSize | Optional | |
templateIds | [ID!] | Optional |
Returns
TanqoryExtShippingDocumentsPdfPayload
| Field | Type | Description |
|---|---|---|
fileName | String | The PDF's file name. |
url | String | A signed link to the PDF, valid for 15 minutes. |
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 TanqoryExtShippingDocumentsPdf($kinds: [TanqoryExtShippingDocumentKind!]!, $orderIds: [ID!]!) {\n tanqoryExtShippingDocumentsPdf(kinds: $kinds, orderIds: $orderIds) {\n fileName\n url\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 TanqoryExtShippingDocumentsPdf(\$kinds: [TanqoryExtShippingDocumentKind!]!, \$orderIds: [ID!]!) {
tanqoryExtShippingDocumentsPdf(kinds: \$kinds, orderIds: \$orderIds) {
fileName
url
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 TanqoryExtShippingDocumentsPdf($kinds: [TanqoryExtShippingDocumentKind!]!, $orderIds: [ID!]!) {
tanqoryExtShippingDocumentsPdf(kinds: $kinds, orderIds: $orderIds) {
fileName
url
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))