There’s a new GraphQL endpoint that allows on hand quantities to be set via the API: inventorySetOnHandQuantities. The problem is this requires one to specify the quantities for all locations. If you want to change change quantities at a single location, calling this mutation with only that location will set the other location’s quantities to 0!
Is this bug or API design?
How to set on hand quantities for a single location? Is the only workaround to fetch the values and all locations and provide no values for locations that will not change?
Locations vary but this is what we see as only workaround. It is unfortunate because 1) resulting GraphQL for this is quite ugly 2) docs do not state that you must specify all locations. This is why I say bug. When you set inventory quantities to 0, merchants get very mad!
Update: inventorySetOnHandQuantities does only set for the specified location and does not affect others. Something else was 0ing out the other locations! ?