Dear support,
We try to use inventorySetOnHandQuantities mutation to update on_hand quantity at location for specific InventoryItem “gid://shopify/InventoryItem/45703524974810” in our shop “gid://shopify/Shop/55075799231”:
https://shopify.dev/docs/api/admin-graphql/2023-07/mutations/inventorySetOnHandQuantities
Initial on_hand quantity is 2 as reported by query:
{
inventoryItem(id:“gid://shopify/InventoryItem/45703524974810”){
id
inventoryLevels(first:10){
edges{
node{
id
quantities(names:[
“available”, “committed”, “damaged”, “incoming”,
“on_hand”, “quality_control”, “reserved”,
“safety_stock”])
{
name
quantity
updatedAt
}
location{
id
}
}
}
}
}
}
Response
{
“data”: {
“inventoryItem”: {
“id”: “gid://shopify/InventoryItem/45703524974810”,
“inventoryLevels”: {
“edges”: [
{
“node”: {
“id”: “gid://shopify/InventoryLevel/95432802495?inventory_item_id=45703524974810”,
“quantities”: [
{
“name”: “available”,
“quantity”: 2,
“updatedAt”: “2023-07-21T03:43:45Z”
},
{
“name”: “committed”,
“quantity”: 0,
“updatedAt”: “2023-07-18T13:32:22Z”
},
{
“name”: “damaged”,
“quantity”: 0,
“updatedAt”: null
},
{
“name”: “incoming”,
“quantity”: 0,
“updatedAt”: null
},
{
“name”: “on_hand”,
“quantity”: 2,
“updatedAt”: “2023-07-21T03:43:45Z”
},
{
“name”: “quality_control”,
“quantity”: 0,
“updatedAt”: null
},
{
“name”: “reserved”,
“quantity”: 0,
“updatedAt”: null
},
{
“name”: “safety_stock”,
“quantity”: 0,
“updatedAt”: null
}
],
“location”: {
“id”: “gid://shopify/Location/61122379967”
}
}
}
]
}
}
},
“extensions”: {
“cost”: {
“requestedQueryCost”: 33,
“actualQueryCost”: 6,
“throttleStatus”: {
“maximumAvailable”: 1000,
“currentlyAvailable”: 994,
“restoreRate”: 50
}
}
}
}
When trying to update on_hand quantity to 3 at location nothing is happening:
mutation inventorySetOnHandQuantities($input: InventorySetOnHandQuantitiesInput!) {
inventorySetOnHandQuantities(input: $input) {
userErrors {
field
message
}
inventoryAdjustmentGroup {
createdAt
reason
changes {
item {
inventoryLevels(first: 10) {
edges {
node {
id
quantities(
names: [“available”, “committed”, “damaged”, “incoming”, “on_hand”, “quality_control”, “reserved”, “safety_stock”]
) {
name
quantity
updatedAt
}
location {
id
}
}
}
}
}
}
}
}
}
variables:
{“input”:{“reason”:“correction”,“setQuantities”:[{“inventoryItemId”:“gid://shopify/InventoryItem/45703524974810”,“locationId”:“gid://shopify/Location/61122379967”,“quantity”:3}]}}
Response:
{
“data”: {
“inventorySetOnHandQuantities”: {
“userErrors”: ,
“inventoryAdjustmentGroup”: null
}
},
“extensions”: {
“cost”: {
“requestedQueryCost”: 44,
“actualQueryCost”: 10,
“throttleStatus”: {
“maximumAvailable”: 1000,
“currentlyAvailable”: 990,
“restoreRate”: 50
}
}
}
}
Please help us to debug because no quantity update is happening.