Updating Qty on hand instead of Available Qty via the API

tylerh7
Tourist
4 0 4

Hi All,

 

It seems I can only update the 'available' inventory qty via the API. 

I would like to update the 'On Hand' qty. If we have one unit of stock on order and we count 10 units in a stocktake, if we update this qty via API it will incorrectly lodge 10pc as being available (which equates to 11 onhand units).

 

Am I missing something simple here? 

If not, does anyone have a simple solution they could suggest? I'm guessing it would require a check of on order units then subtracting that number from the available qty. . . seems a little messy and I am not sure how to do this through the API. 

Replies 4 (4)
tylerh7
Tourist
4 0 4

Thank you so much. Appreciate the help. 

tylerh7
Tourist
4 0 4

Although this is very similar to the response i received from Chatgpt and it isn't very clear. In the shopify API docs I cannot find any reference to on_order_qty . . .  

ShopifyDevSup
Shopify Staff
1357 225 475

Hi @tylerh7 ,

 

There is a new GraphQL mutation available as of Admin API version 2023-01 called [inventorySetOnHandQuantities] for setting inventory on-hand quantities using absolute values, which sounds like what you're looking to do. There's no equivalent to this new mutation in the REST Admin API.

 

Hope you have a great day

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Stock_BH
Tourist
6 0 9