POST inventory_levels/set 404 response

Solved
VeraCore
Shopify Partner
4 1 0

We are receiving a 404 Not found on every inventory/set call we make within a single store. We are not having this issue on other stores

Prior to performing this call, we perform inventory_levels GET which provides our inventory_item_id & location_id

 

admin/api/2021-04/inventory_levels/set.json

Body: {   “available” : 0,   “inventory_item_id” : 41650641436781,   “location_id” : 46696213 }

Response: Code 404: Not Found Data: {“errors”:“Not Found”}

X-Request-ID: 83f647bf-9aae-484a-84f0-c12866e31443

 

and 

 

Body: {   “available” : 45,   “inventory_item_id” : 41666909831277,   “location_id” : 46696213 }

Response: Code 404: Not Found Data: {“errors”:“Not Found”}

X-Request-ID: 88a19d93-5169-4b7d-bce9-6d372af7d2d3

Accepted Solution (1)

Accepted Solutions
VeraCore
Shopify Partner
4 1 0

This is an accepted solution.

Thank you for the reply Graham, we found from our client that they provided the incorrect URL. The API was rerouting the request because of it.

View solution in original post

Replies 3 (3)
VeraCore
Shopify Partner
4 1 0

After looking more into the logs, it seems like Shopify is rerouting the request to a GET. 

 

Any information on what would cause Shopify to do this?

GrahamS
Shopify Staff
157 25 32

Hello @VeraCore ,

 

I looked into the x-request-id you provided, and I do see that your request is hitting our server as a GET, which you noted and would explain why you are receiving a 404. 

 

That said, there shouldn't be any way for Shopify to redefine requests from a client - if you send a POST, it'll be received as a POST, if you send a GET it'll be received as a GET. Can you expand a bit on what you've found that is indicating that we are changing your HTTP method at the server side? I didn't see anything to match that in our logs but am open to investigate further.

 

Best,

Graham S | 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

VeraCore
Shopify Partner
4 1 0

This is an accepted solution.

Thank you for the reply Graham, we found from our client that they provided the incorrect URL. The API was rerouting the request because of it.

View solution in original post