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.

Faisal Sheikh
1,3901 gold badge9 silver badges18 bronze badges
asked Jul 25, 2019 at 7:19
2
  • Could you please let us know the exact Magento version you are using ? Commented Jul 25, 2019 at 12:57
  • I am using magento 2.2 CE Commented Jul 25, 2019 at 14:27

1 Answer 1

1

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.

answered Jul 25, 2019 at 15:15

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.