API call getting 404 Error back

Solved
YaoWu
New Member
2 0 0

Hello, When using API call to adjust inventory, the call received 404 error back.

API:inventory_levels/adjust.json

Path : https://c2f650ca0a99f8ce68a3a247c4f815fc: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@developermk.myshopif...

Post content: {"location_id": 61929390243,"inventory_item_id": 43914601693347,"available_adjustment": 1000}

The code worked until yesterday.

Please help!

Thanks.

Accepted Solution (1)

Accepted Solutions
awwdam
Shopify Staff
175 32 17

This is an accepted solution.

Hey @YaoWu

Generally a 404 error presents itself when a specific resource can't be found - `404 Not Found` - often related to an id that is no longer accessible. There are many moving parts when it comes to inventory management with the API, as outlined in our docs here. Generally, I would suggest troubleshooting start by using a GET request to the InventoryItem and or InventoryLevel resources to confirm the ids are valid, are indeed found and accurate.

From there, if you are still facing an issue of unexpected 404 errors, please log the full request body, and the x-request-id response header returned with the error and share them here. I can take closer look and pass on any insights or next steps from there - Cheers!

awwdam | API Support @ 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 Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 2 (2)
awwdam
Shopify Staff
175 32 17

This is an accepted solution.

Hey @YaoWu

Generally a 404 error presents itself when a specific resource can't be found - `404 Not Found` - often related to an id that is no longer accessible. There are many moving parts when it comes to inventory management with the API, as outlined in our docs here. Generally, I would suggest troubleshooting start by using a GET request to the InventoryItem and or InventoryLevel resources to confirm the ids are valid, are indeed found and accurate.

From there, if you are still facing an issue of unexpected 404 errors, please log the full request body, and the x-request-id response header returned with the error and share them here. I can take closer look and pass on any insights or next steps from there - Cheers!

awwdam | API Support @ 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 Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

YaoWu
New Member
2 0 0

Thank you for your reply. We have figured out the cause of the problem, which is incorrect inventory location ID.