Error when call API's POST

John2578
New Member
3 0 0

When we call  POST API's are not working. example

url: https://leonisa-webstore.myshopify.com/admin/api/2021-04/inventory_levels/set.json

Body:

{
"location_id": 62184521926,
"inventory_item_id": 39742665720006,
"available": 2
}

Response:

{"errors":"Not Found"}

John2578_0-1620141589625.png

 

GET  API's works well.

0 Likes
Jason
Shopify Expert
10260 142 1940

What are you using to make the POST request?

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.


★ http://freakdesign.com.au ★
0 Likes
John2578
New Member
3 0 0

Hi Jason..

URL:    https://XXXXXXXX:YYYYYYYYYY@leonisa-webstore.myshopify.com/admin/api/2021-04/inventory_levels/set.json

Body:

{
"location_id": 62184521926,
"inventory_item_id": 41837133267142,
"available": 2
}

 

 

 

 

 

0 Likes
Jason
Shopify Expert
10260 142 1940

oh no @John2578 . Please edit  your post immediately and remove the key/password details! Never post those. You'll also need to delete that key and make a new one. I might mark your post as spam (just to remove it) if you don't get to it quickly.

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.


★ http://freakdesign.com.au ★
0 Likes
Jason
Shopify Expert
10260 142 1940

Secondly, if that is the desktop version of postman be sure to click the cookies option on the right hand side and remove all cookies. The online version won't give you that option and will always send cookies. A change request (such as POST) will be blocked for key/password calls with a cookie attached.

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.


★ http://freakdesign.com.au ★
0 Likes
John2578
New Member
3 0 0

Jason.

I update the publications.   Thank you..

And I download a new postman version and now the response is well..

John2578_0-1620145891427.png

 

now I need to understand why is 

"Inventory item does not have inventory tracking enabled"

 

 

 
0 Likes
Kevin_A
Shopify Staff
Shopify Staff
290 35 46

Hey @John2578 

The error "Inventory item does not have inventory tracking enabled" is likely because the variant doesn't have "shopify" set to manage inventory. See the "inventory_management" field in the product variant API docs.

Kevin_A | Developer 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

0 Likes