FROM CACHE - en_header

Setting Shopify Inventory via API results in 'not found' for some products

Phil_Zoio
New Member
1 0 1

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?

Replies 6 (6)
Josh
Shopify Staff
Shopify Staff
1134 83 215

Hey Phil, 

 

This generally happens when an ID being used is incorrect, but I'd need some kind of identifier to be able to verify that for you. 

 

Would you be able to post the inventory_item_id and a timeframe you were trying to update it in, or an X-Request-Id response header? I could check our logs with either of those and let you know what is going on. 

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

leonmunir
New Member
1 0 0

I am having the same issue via Dell Boomi's Shopify Connector

akochiss
New Member
2 0 0

@leonmunir did you resolve this issue with the Boomi Shopify Connector? 

Jmontelus
New Member
2 0 0

I'm actually having a similar issue, did you ever solve it and how? but mine is happening with the close.json

shopfiy_user
New Member
1 0 0

I am also running into the same issue, is the API working fine or not. Can someone from the shopfiy API team confirm about inventory API's?. 

API Post call: 

https://username:password@lologen.myshopify.com/admin/api/2020-10/inventory_levels/set.json

The json request I am using is below:

{
"location_id": 40648016009,
"inventory_item_id": 37571466887367,
"available": 1
}

 

 

 

mextest_Admin
Tourist
4 0 0

I have experienced the same issue in the last few days. Any solution?