tanqoryExtShippingLabelRates
- Query
- Inventory and fulfillment
The services a shipping label can be bought with for a fulfillment order, with the same validation (and userErrors codes) as shippingLabelPurchase: the fulfillment order must be fulfillable by shipping and have a destination address, the date must not be in the past, the package dimensions must be positive and the total weight non-zero. totalWeight omitted = the empty package plus the fulfillable lines, as shippingLabelPurchase.
Arguments
| Argument | Type | Required | Default | Description |
|---|---|---|---|---|
customsValues | [TanqoryExtShippingLabelCustomsValueInput!] | Optional | Each line's customs value per unit, in the order's currency, as the label would declare it (omitted lines: the price paid). Quote with the same values the label is bought with. | |
fulfillmentOrderId | ID! | Required | ||
insuredAmount | Decimal | Optional | Quote the services with this shipment value insured, in the order's currency (the price then includes the provider's insurance fee). Omitted = no insurance. | |
packageInfo | PackageInfoInput | Optional | ||
shippingDatetime | DateTime! | Required | ||
totalWeight | WeightInput | Optional |
Returns
TanqoryExtShippingLabelRates! The shipping services offered for one label, or why none can be offered.
| Field | Type | Description |
|---|---|---|
noRatesReason | TanqoryExtShippingLabelNoRatesReason | What the carrier said when it offered no service (with RATES_NOT_FOUND), so the merchant knows what to fix. Null when services are offered, when the input was refused before the carrier was asked, or when the carrier gave no reason. |
purchasesOpen | Boolean! | Whether a label can be bought here now. False on a deployment that takes real money while its label carrier is still a practice one (a sandbox or test environment): the rates are shown, and shippingLabelPurchase answers TANQORY_EXT_LABELS_NOT_OPEN. |
rates | [TanqoryExtShippingLabelRate!]! | The services, in the provider's order (the first is the default selection of shippingLabelPurchase). |
userErrors | [ShippingLabelPurchaseUserError!]! | Why no rate can be offered (the shippingLabelPurchase codes). |
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 TanqoryExtShippingLabelRates($fulfillmentOrderId: ID!, $shippingDatetime: DateTime!) {\n tanqoryExtShippingLabelRates(fulfillmentOrderId: $fulfillmentOrderId, shippingDatetime: $shippingDatetime) {\n purchasesOpen\n userErrors {\n code\n field\n message\n }\n }\n}","variables":{"fulfillmentOrderId":"gid://tanqory/Type/id","shippingDatetime":""}}'// Node.js 18 or later (fetch is built in). Save as request.mjs and run: node request.mjs
const query = `query TanqoryExtShippingLabelRates(\$fulfillmentOrderId: ID!, \$shippingDatetime: DateTime!) {
tanqoryExtShippingLabelRates(fulfillmentOrderId: \$fulfillmentOrderId, shippingDatetime: \$shippingDatetime) {
purchasesOpen
userErrors {
code
field
message
}
}
}`;
const variables = {
"fulfillmentOrderId": "gid://tanqory/Type/id",
"shippingDatetime": ""
};
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 TanqoryExtShippingLabelRates($fulfillmentOrderId: ID!, $shippingDatetime: DateTime!) {
tanqoryExtShippingLabelRates(fulfillmentOrderId: $fulfillmentOrderId, shippingDatetime: $shippingDatetime) {
purchasesOpen
userErrors {
code
field
message
}
}
}"""
variables = json.loads("""{
"fulfillmentOrderId": "gid://tanqory/Type/id",
"shippingDatetime": ""
}""")
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))