"inventory_items" call returns empty

wellica
New Member
1 0 0

Hello,

We are unable to get the cost of our products using API.

The call always returns empty : 
/admin/api/2021-01/inventory_items.json?ids=5698307031204
{
"inventory_items": [

]
}

Tracking options are activated

Shopify Admin API permissions : Inventory
Access scopes: read_inventory, write_inventory

Could tell us why we are unable to get the cost back ?

Thank you.



0 Likes
syf_
Shopify Staff
Shopify Staff
89 20 15

Hi @wellica,

Usually, when such queries return an empty result set, the reason is that the id provided is either invalid or not available. My guess is that the id you provided is not a valid inventory_item_id. Could you double check to make sure the id you're passing is the required one? If it's an issue of passing an invalid id, you could use the ProductVariant resource which has an inventory_item_id property to find the inventory_item_id and use that with your query.

If you have any additional questions or require further clarification, please do let me know.

Best,
Seth.

 

syf_ | 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