Error when call API's POST

Solved
John2578
Tourist
5 1 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
10354 155 1988

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
Tourist
5 1 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
10354 155 1988

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
10354 155 1988

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
Tourist
5 1 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
310 42 53

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
John2578
Tourist
5 1 0

This is an accepted solution.

Jason

I hope you are well

We are using the Graphql mutation "inventoryBulkAdjustQuantityAtLocation", but the problem is:
the quantity of the inventoryItemId is being adjusted instead of been replaced.   we need replace the quantity  dont adjust

how can we do that??  this is the calling example. 

John2578_0-1620914562659.png

 

John2578_1-1620914894986.png

 

but we need the quantity available must be 4.

 

checking the mutations we don't see any like Set REST API to update inventory.  (/admin/api/2021-04/inventory_levels/set.json)

 

John2578_2-1620915244947.png

please help us.

 

 

0 Likes