0

I followed the Magento documentation regarding fetching Product Salable quantity using REST API.

https://devdocs.magento.com/guides/v2.3/rest/modules/inventory/check-salable-quantity.html

But I'm getting only 0 value for all products when I use get-product-salable-quantity API.

Can anyone help with this ASAP?

fmsthird
4,6224 gold badges18 silver badges42 bronze badges
asked Mar 18, 2019 at 11:14

1 Answer 1

2

To check product salable quantity you can use this endpoint:

/V1/stockItems/{productSku} 

or

/V1/stockStatuses/{productSku}

method GET

more magento 2 endpoints here https://devdocs.magento.com/swagger/

especially catalogInventoryStockRegistryV1 group

answered Mar 18, 2019 at 14:47
6
  • Thanks I can able to get stock statuses of products. Can you help me in getting the same salable quantity and max_sale_qty values for the product programmatically ? Commented Mar 20, 2019 at 10:53
  • If You want to use api, just call that endpoints i meant ealier. Commented Mar 21, 2019 at 14:51
  • and take what You need from product object. salable quantity is under data['quantity_and_stock_status']['qty'] Tell me if this solve your problems. Unfortunatelly I don't know what You mean about max_sale_qty Commented Mar 21, 2019 at 15:01
  • protected $_productloader; public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Catalog\Model\ProductFactory $_productloader ) { $this->_productloader = $_productloader; parent::__construct($context); } public function getLoadProduct($id) { return $this->_productloader->create()->load($id); } Commented Mar 21, 2019 at 15:02
  • Thanks I got all the required stock datas using the above API, but except one. Can you also help me in getting "Source Item Status", explained below. With the above API we can only get the stock statuses of current store or source. In Magento 2.3 we use MSI, I have two sources(source1 and source2). I need to fetch the "Source Item Status" of both the Sources programmatically or using API. Can you please help me with that ? Commented Mar 21, 2019 at 15:10

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.