Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

inventory_levels set API return with "not found" error. All other APIs working correctly.

Solved

inventory_levels set API return with "not found" error. All other APIs working correctly.

ppvijeesh
Shopify Partner
2 1 0

We have a stock and price update service, which is trying to update the stock of an item through API. But, it fails with a message "not found".
  

The same service was working fine with a test account. Price and stock were updating correctly. When we switched credentials to the actual site, only the price update worked and the stock update failed with "not found" message.
This happens every time. It happens even if I try the same request from Postman.
  
 
We tried with API versions 2024-04 and 2023-07.
 
Is it happening only via the API. We can directly update the stock by logging in to the shopify admin console.


Request
/admin/api/2024-04/inventory_levels.json?inventory_item_ids=51191952113953
Response
{
    "inventory_levels": [
        {
            "inventory_item_id"51191952113953,
            "location_id"76281872673,
            "available"2,
            "updated_at""2024-06-04T11:52:50+03:00",
            "admin_graphql_api_id""gid://shopify/InventoryLevel/112663920929?inventory_item_id=51191952113953"
        }
    ]
}


Please find the below request where it failed to update the inventory level 
Request
/admin/api/2024-04/inventory_levels/set.json
{
   "inventory_item_id"51191952113953,
    "location_id"76281872673,
    "available"3
}
Response
{
    "errors""Not Found"
}

Please note that I contacted Shopify support team and there is no response from them after the initial email.

 
Accepted Solution (1)
ppvijeesh
Shopify Partner
2 1 0

This is an accepted solution.

I wanted to share that I've been able to identify and resolve the problem.

The Issue:

It turns out the API currently only works when using the default Shopify domain (e.g., abcd123.shopify.com). When using a custom domain, whether it's a Shopify subdomain (e.g., customsite.shopify.com) or a completely different domain (e.g., customsite.com), the API calls will fail.

The Resolution:

While I didn't receive direct support from Shopify, I was able to troubleshoot and determine the API's behavior with different domain configurations.

Key Takeaway:

For now, it seems using the default Shopify domain is necessary for successful API calls.

If you're facing a similar issue:

Double-check the domain you're using in your API requests. Ensure it matches your shop's default Shopify domain.

View solution in original post

Replies 2 (2)

clarelv
Shopify Partner
3 1 0

Hello, I also encountered the same problem as yours. I wonder if you have solved it. I see that it has been a long time since the problem was solved.

ppvijeesh
Shopify Partner
2 1 0

This is an accepted solution.

I wanted to share that I've been able to identify and resolve the problem.

The Issue:

It turns out the API currently only works when using the default Shopify domain (e.g., abcd123.shopify.com). When using a custom domain, whether it's a Shopify subdomain (e.g., customsite.shopify.com) or a completely different domain (e.g., customsite.com), the API calls will fail.

The Resolution:

While I didn't receive direct support from Shopify, I was able to troubleshoot and determine the API's behavior with different domain configurations.

Key Takeaway:

For now, it seems using the default Shopify domain is necessary for successful API calls.

If you're facing a similar issue:

Double-check the domain you're using in your API requests. Ensure it matches your shop's default Shopify domain.