I have an integration with a Shopify store and update the inventory level for products via the API https://help.shopify.com/en/api/guides/updating-inventory
This is working fine for 95% of products, however a few products when I send the set request I end up with "not found" for example:
POST to https://myshop.myshopify.com/admin/inventory_levels/set.json
With:
{ "location_id": XXXX, "inventory_item_id": XXXX, "available": 120 }
But I end up with:
{ "errors":"Not Found" }
I know the location_id is correct as this is used across all products and there is only one location set up.
The fetch product result give me:
{ "product":{ "id":XX, "title":"Gems", "body_html":"", "vendor":"London", "product_type":"", "created_at":"2019-05-23T19:54:50+01:00", "handle":"gems", "updated_at":"2019-05-29T10:37:27+01:00", "published_at":"2019-05-24T11:50:34+01:00", "template_suffix":null, "tags":"category:jewels", "published_scope":"web", "admin_graphql_api_id":"gid:\/\/shopify\/Product\/XX", "variants":[ { "id":XXX, "product_id":XX, "title":"Nights", "price":"5.95", "sku":"X", "position":1, "inventory_policy":"deny", "compare_at_price":null, "fulfillment_service":"manual", "inventory_management":"shopify", "option1":"Nights", "option2":null, "option3":null, "created_at":"2019-05-24T11:23:17+01:00", "updated_at":"2019-05-29T10:37:19+01:00", "taxable":false, "barcode":"654674", "grams":0, "image_id":null, "weight":0.0, "weight_unit":"g", "inventory_item_id":XXXX, "inventory_quantity":0, "old_inventory_quantity":0, "requires_shipping":true, "admin_graphql_api_id":"gid:\/\/shopify\/ProductVariant\/XX" } ], "options":[ { "id":XX, "product_id":X, "name":"Color", "position":1, "values":[ "Nights" ] } ], "images":[ ], "image":null } }
The inventory_item_id returned is what im using and i cant see any other reason why this product wouldn't allow me to update its inventory. Any ideas?