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.
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.
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.