Please let me know how we can resolve an issue with inventory level changes
We receive API resposne that location id could not be found however location id is correct
I can share API req ans response
crucial part of API REQ
{“query”:“mutation inventoryAdjustQuantities($input: InventoryAdjustQuantitiesInput!) {\r\n inventoryAdjustQuantities(input: $input) {\r\n userErrors {\r\n field\r\n message\r\n }\r\n inventoryAdjustmentGroup {\r\n createdAt\r\n reason\r\n changes {\r\n name\r\n delta\r\n }\r\n }\r\n }\r\n }”,“variables”:{“input”:{“reason”:“correction”,“name”:“available”,“changes”:[{“inventoryItemId”:“gid://shopify/InventoryItem/49485740474712”,“locationId”:“gid://shopify/Location/85912027480”,“delta”:-1}]}}}
API RESP
{“data”:{“inventoryAdjustQuantities”:{“userErrors”:[{“field”:[“input”,“changes”,“0”,“locationId”],“message”:“The specified location could not be found.”}],“inventoryAdjustmentGroup”:null}},“extensions”:{“cost”:{“requestedQueryCost”:11,“actualQueryCost”:10,“throttleStatus”:{“maximumAvailable”:4000.0,“currentlyAvailable”:3990,“restoreRate”:200.0}}}}
The location in that request for adjusting quantities is for a location that is a fulfillment service. That fulfillment service is marked as inventoryManagement: true meaning that only the app that created the fulfillment service is able to modify the quantities at that location.
For that reason, the if you need to modify the quantity at that location, it must be done through the app that created the location.
If you go to the admin for the shop, you will also not be able to modify the quantity there either.
I can see that the error message sent back was misleading. That is definitely something we can improve upon. The location does exist, instead, the app wasn’t allowed to modify the quantity.
Is there any way this can be changed, or is there a workaround? The old inventoryAdjustQuantity mutation did work perfectly fine, but the new mutation is limited and will give a lot of merchants inventory issues.
@cbella could you expand on this? I am failing to get my API to adjust inventory and I can’t find any resources specific to this issue online.
We have an In-house application that manages inventory and fulfills orders. I created a fulfillment service through the API and made sure inventoryManagment was set to true. I then added an existing product to that app location.
I got the IDs through a query like ‘shop {fulfillmentServices {inventoryLevels{}}}’ and tried to get use the adjust inventory mutation using the same credentials that set up the fulfillment service. But I still get “The specified location could not be found.”
I have tried a number of combinations of ItemIds and LocationIds… but I still get this same response. Is there a way to manage inventory through our shop’s default location? If not, I have a fulfillment service set up, but what steps am I missing to get it to be able to manage inventory?
The inventoryManagement field indicates if apps installed on your shop are allowed to adjust inventory for that location (true means they can’t, false mean they can).
When it’s set to true then only the app that created the app can make adjustments. If the in-house app that manages your inventory and fulfills orders wasn’t the app used to create the fulfillment service, then that may be the reason you’re receiving the location can’t be found type of error.
So if you’re going to adjust inventory with a different app than the one that created the fulfillment service, you’ll want the inventoryManagement field set to false instead.
If that doesn’t help, and if you’re comfortable, can you give me the request you’re making and the response you get back (like what the original poster provided).