Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: POST inventory_levels/set 404 response

Solved

POST inventory_levels/set 404 response

VeraCore
Shopify Partner
5 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)
VeraCore
Shopify Partner
5 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
5 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 (Retired)
193 37 55

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,

To learn more visit the Shopify Help Center or the Community Blog.

VeraCore
Shopify Partner
5 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.