inventoryAdjustQuantities - not changed the available inventory by use of delta.

Solved

inventoryAdjustQuantities - not changed the available inventory by use of delta.

Av18
Shopify Partner
13 1 0
query = <<~QUERY
mutation {
inventoryAdjustQuantities(
input: {reason: "correction", name: "available", changes: [{inventoryItemId: "gid://shopify/InventoryItem/#{inventory_item_id}", delta: #{available}, locationId: #{location}}]}
) {
inventoryAdjustmentGroup {
createdAt
reason
changes {
name
delta
}
}
userErrors {
field
message
}
}
}
QUERY

Here delta i've got -23. This means that the available quantity of that product in inventory will decrease by 23 from 158, and will update to 135. However, the available quantity will not be updated.
Have any solution for this kind of problem?
Accepted Solution (1)

Av18
Shopify Partner
13 1 0

This is an accepted solution.

Solution:-

Previously I've sent #{location} -> gid://shopify/Location/location_id like this,  Now I changed it to a string format like:- "gid://shopify/Location/location_id"

 

View solution in original post

Reply 1 (1)

Av18
Shopify Partner
13 1 0

This is an accepted solution.

Solution:-

Previously I've sent #{location} -> gid://shopify/Location/location_id like this,  Now I changed it to a string format like:- "gid://shopify/Location/location_id"