Inventory Level set API 404 error

Topic summary

Developers are encountering 404 errors when attempting to use Shopify’s /inventory_levels/set.json API endpoint, despite having correct credentials, inventory scope enabled, and valid inventory item IDs.

Root Cause Identified:
The issue stems from using vanity/storefront URLs (e.g., shopify.someshopname.com) instead of the proper myshopify.com domain format. When POSTing to vanity URLs, requests redirect and fail with 404 errors.

Solution:

  • Use the format: https://{store_id}.myshopify.com/admin/api/2024-07/inventory_levels/set.json
  • Replace {store_id} with your actual store ID (not necessarily numeric)
  • Find your store ID in Shopify admin under Settings > Domains
  • Ensure you’re making POST requests (not GET)

Additional Notes:

  • The official documentation may be misleading on this point
  • Same solution applies to /inventory_levels/adjust.json endpoint
  • Multiple users confirmed this workaround resolves the issue
  • Shopify staff acknowledged the error message could be improved
Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

I am trying to set inventory level using /inventory_levels/set.json and always getting error 404. I have followed documentation and verified APO credentials. other endpoint works fine with same credentials. Inventory scope also enabled for this. In fact same method works for another shopify store (using as trial) but does not work for this store.

*Here “inventory_item_id” and “location_id” has 1:1 relation

  • Authentication and other headers are present for API

  • Shopify is subscribed to basic package with POS lite

  • /inventory_levels/set.json and /inventory_levels/adjust.json both does not work

  • this app access_token has inventory scope

Am I missing something or is there any setting required in admin panel for this operation.

1 Like

Hey @Posware

Can you confirm the inventory item ID is correct? It looks like the API endpoint is found and responding that the inventory ID isn’t found. If you’re still stuck please DM store/inventory ID details.

Hi. Thanks for responding. I confirmed that Inventory Item ID is correct. Please see below images. First I called all inventory levels.

and then I have used same result for inventory set.

Hey @Posware

Can you confirm you’re POSTing to /admin/api/2023-07/inventory_levels/set.json?

Curl example:

curl -d '{"location_id":61107961909,"inventory_item_id":44204478332981,"available":42}' \
-X POST "https://{store}.myshopify.com/admin/api/2023-07/inventory_levels/set.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"

Hi @SBD

I confirm that i have used mentioned endpoint.

Please note that I have tested the same (I have changed access token and store name) and that working with another trial shopify.

Thanks. Is there a request ID attached to the response headers? and if so can you please provide it.

Hi, here is the request id attached to the header.
e5703902-42fc-4835-aec5-94bab44b42bf

Thanks @Posware . Logs indicate that’s a GET request, you’ll need to POST to this endpoint. We could really improve our error message here :sweat_smile:

Thank you for your response, However this can’t be a GET request. Please see the following video. X-Request-ID: e01cb1bb-3f61-41d3-acea-7875d03cd5b6

Hi. It’s been long and am still stuck there. Please have a look and advise me.

Best regard.

1 Like

@Posware were you able to resolve this? I have same issue

1 Like

After experiencing this issue I noticed different responses based on whether you use the vanity url or the myshopify.com url.

For instance if I make the request using the storefront url:

https://shopify.someshopname.com/admin/api/2024-07/inventory_levels/adjust.json

It will redirect to a myshopify.com url and then return a 404.

If you instead make the POST request via the myshopify.com domain instead, the operation is a success.

https://123456-1.myshopify.com/admin/api/2024-07/inventory_levels/adjust.json

3 Likes

It is correct as mentioned by JamesRecogg

It does not work as it appears in the official documentation

It is required to adjust the url as follows

https://{store_id}.myshopify.com/admin/api/2024-07/inventory_levels/set.json

you need to replace it with whatever your {store_id} is in the url

2 Likes

Thank you very much to all. Very helpful!!!

attention le store-id n’est pas obligatoirement une suite de chiffre, afin de trouver celui correspondant a votre boutique il vous faut aller dans paramètres>Domaine et vous trouverez ici votre URL avec xxxxxxx.myshopify.com

Je pense d’ailleurs qu’il faut utiliser uniquement cette URL pour toutes les requêtes http.