Solved

API call getting 404 Error back

YaoWu
Visitor
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)

awwdam
Shopify Staff
249 42 36

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 3 (3)

awwdam
Shopify Staff
249 42 36

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

YaoWu
Visitor
2 0 0

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

test-warehouse
Visitor
1 0 0

hi @awwdam :
I'm facing same issue, but both my locationId and Inventory item id is correct, but still getting not found error 404 on adjust inventory
URL: admin/api/2023-10/inventory_levels/adjust.json (POST)


X-Request-ID: 8c640015-66a6-4b4f-9df1-13765abcf38f


Body: 

{
    "location_id": 62358323267,
    "inventory_item_id": 42269704028227,
    "available_adjustment": 1
}
 
Response: 404
{
    "errors": "Not Found"
}