Solved

availableQuantity does not update quantity

Mugenni
Visitor
2 1 0

I am trying to update product variants inventory stock through productUpdate via:

"mutation ($input: ProductInput!) { productUpdate (input: $input) { product { id } } }"

where input is:

{"title"=>"product", "vendor"=>"pr", :options=>"Produkt",
:variants=>[{"price"=>"11.00",
             :compareAtPrice=>nil,
             "sku"=>"1111", 
             :options=>"*** ***",
             "barcode"=>"1111", 
             :inventoryPolicy=>"CONTINUE", 
             :inventoryItem=>{:cost=>"6.49", :tracked=>true},
             :inventoryQuantities=>{:availableQuantity=>85, 
                                    :locationId=>"gid://shopify/Location/60120137888"}}],
 :id=>"gid://shopify/Product/6622178770997"}

And as result, in the admin panel, I receive available quantity  -41 

How it is possible to send 85 and get -41 ?

Everything else updates right. 

Accepted Solution (1)

Mugenni
Visitor
2 1 0

This is an accepted solution.

Sovled. It was the wrong location id. Still, a mystery why quantity became minus value with a wrong location id, and there were no errors.

View solution in original post

Reply 1 (1)

Mugenni
Visitor
2 1 0

This is an accepted solution.

Sovled. It was the wrong location id. Still, a mystery why quantity became minus value with a wrong location id, and there were no errors.