tanqoryExtInventoryActivateAtLocation
- Mutation
- Inventory and fulfillment
Stocks inventory items at an active location, as inventoryActivate does for one item: each item not yet stocked there gets an inventory level with 0 available and 0 on hand, and an item already stocked there keeps its quantities. Choose the items with productIds (every variant of each product) and inventoryItemIds, at most 250 of each, or with allInventoryItems (every inventory item of the store). Errors: NOT_FOUND (no such location, product or inventory item of the store), INVALID (the location is deactivated, more than 250 ids, or allInventoryItems together with ids), REQUIRED (nothing chosen).
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
allInventoryItems | Boolean | Optional | false |
inventoryItemIds | [ID!] | Optional | |
locationId | ID! | Required | |
productIds | [ID!] | Optional |
Returns
TanqoryExtInventoryActivateAtLocationPayload
| Field | Type | Description |
|---|---|---|
alreadyStockedCount | Int | How many of the chosen inventory items were already stocked there and were left as they are. |
location | Location | The location the items are stocked at. |
stockedCount | Int | How many inventory items were stocked at the location by this call (each with 0 available and 0 on hand). |
userErrors | [TanqoryExtLocationUserError!]! |
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 TanqoryExtInventoryActivateAtLocation($locationId: ID!) {\n tanqoryExtInventoryActivateAtLocation(locationId: $locationId) {\n alreadyStockedCount\n location { id }\n stockedCount\n userErrors {\n code\n field\n message\n }\n }\n}","variables":{"locationId":"gid://tanqory/Type/id"}}'// Node.js 18 or later (fetch is built in). Save as request.mjs and run: node request.mjs
const query = `mutation TanqoryExtInventoryActivateAtLocation(\$locationId: ID!) {
tanqoryExtInventoryActivateAtLocation(locationId: \$locationId) {
alreadyStockedCount
location { id }
stockedCount
userErrors {
code
field
message
}
}
}`;
const variables = {
"locationId": "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 = """mutation TanqoryExtInventoryActivateAtLocation($locationId: ID!) {
tanqoryExtInventoryActivateAtLocation(locationId: $locationId) {
alreadyStockedCount
location { id }
stockedCount
userErrors {
code
field
message
}
}
}"""
variables = json.loads("""{
"locationId": "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))