GraphQL inventorySetQuantities mutation errors if product not stocked at location

Good morning,

We noticed that for a product which is not stocked at a location:

  • calling the REST /inventory_levels/set.json endpoint works just fine, setting the new inventory level in that location
  • calling the GraphQL inventorySetQuantities mutation returns an error with code ITEM_NOT_STOCKED_AT_LOCATION

It seems we need to manually edit the product to enable the location (the Edit locations button in the product’s Inventory section) for the GraphQL mutation to work.

Is there a way to enable the location (for stocking the product) by calling a GraphQL endpoint?

Hi @Piotr_Wojcicki,

Yes, you can enable the inventory at a specific location by using the inventoryActivate mutation. Once that’s done you should be able to set the inventory level for that location.

The one exception is if that inventory location is managed by another app. Under the REST API you could still set the inventory levels for those locations but under GraphQL it’s no longer possible to. I don’t think this applies in your case but just wanted to mention it in case you still had issues.

Best,
Daniel

great, thanks @Daniel_Ablestar !