0

I am using "http://localhost/rest/V1/products" api to get product details but not able to get product quantity in response.

So I searched and found that we can get product quantity with extension attributes. eg. extension_attributes": { "logo size": "small", "stock_item" : { "status" : "in_stock" "quantity": 70 } } but these are not showing in API response. I am using admin token for authentication.

  • Could you please let us know the exact Magento version you are using ? – Abdul Pathan Jul 25 at 12:57
  • I am using magento 2.2 CE – vartika sharma Jul 25 at 14:27
0

To get any information about product inventory you must use API from CatalogInventory module.

There are two ways to tackle your problem

  1. Using "/V1/stockItems/:productSku" endpoint to get Inventory Information for each individual product.

  2. Code Customising to create a new endpoint for your need. Refer this link to know more about creating new endpoint.

Hope it finds helpful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.