inventorySetQuantities - set available and on hand to the same absolute value

Hi,

tl;dr - I just want to set available and on_hand inventory to the same value using inventorySetQuantities, but Shopify won’t let me.

We use inventorySetQuantities to sync our inventory from our backoffice systems to Shopify. We do this once a day, once we are finished processing orders, returns and deliveries for the day, so that every day Shopify gets an accurate inventory update. In other words, just like it says in the documentation for inventorySetQuantities, our backoffice systems are the source of truth for stock levels.

It’s really doing my head in that available and on_hand quantities are getting out of sync with each other, though. I just want to set both of these to the same value. We only have one location, we just want them to be the same. But once they get out of sync, they can NEVER be the same again, because using inventorySetQuantities to update the on_hand quantities results in available quantities being decremented or incremented, and vice versa. Setting ignoreCompareQuantity to true doesn’t stop this. (I’m just setting this to boolean true, but is there some weird graphQL way of doing this, like when you have to json_encode arrays twice to get graphQL to accept them?)

I just want to set them both to the same value in one hit (or two, two would be fine as long as it works) without Shopify interfering. Is there any way to do this?

Many thanks,

Gareth

Hey Gareth,

I think theres a bit of confusion here around the inventory states https://help.shopify.com/en/manual/products/inventory/fundamentals/inventory-states#:~:text=Incoming%20inventory%20state-,Inventory%20states,-Your%20inventory%20can

Inventory state Definition
On hand On hand inventory refers to all inventory units that you have at a location. On hand inventory is made up of the total of your Committed, Unavailable, and Available inventory.
Available Available inventory refers to inventory that you can sell. Available inventory isn’t committed to any orders or reserved for any draft orders. It also doesn’t include inventory that’s considered Incoming.

So you’re on hand and available is likely to be different because shopify will be including any committed inventory on orders etc.

If you don’t want Shopify to manage any inventory, you can turn it off so that inventory is not tracked by Shopify but that also has its downsides.

Thanks. I understand the definitions and purposes.

Since we’re not using Shopify for anything except a storefront and a checkout - stock purchasing and management, order despatch etc is all done on our own systems - updating available levels in Shopify and ceasing to care about on_hand levels will just have to do.

Turning inventory tracking off, or even just using ‘continue selling when out of stock’ does indeed have very serious downsides and I do not want to go there.

G

1 Like

We have an inventory sync app and that’s what we see other merchants do as well who manage inventory outside of Shopify. They just simply set the available quantity in Shopify.

The other inventory states actually didn’t even exist in Shopify when we launched our app some years ago, and we haven’t really gotten any request for syncing other inventory states. So I think with your setup, it’s quite common to only care about the “available” quantity on the Shopify end so you don’t oversell, and then you’d just keep track of the other inventory states outside of Shopify.

This actually made me laugh out loud. Not just me who simply doesn’t care then :slight_smile:

Thank you.