In the latest Magento version 2.3, you might have noticed an additional quantity parameter ‘Salable Quantity’. Today we will see how to get a product’s salable quantity in Magento 2.3
Unlike in previous versions of Magento, the quantity of a product does not decrease when an order is placed.
Instead, the quantity remains the same but the salable quantity gets reduced. The quantity of the product decrease only after shipping is completed.

To get salable quantity use the following code –
namespace Webkul\Module\ModelName; use Magento\InventorySalesAdminUi\Model\GetSalableQuantityDataBySku; class ClassName { private $getSalableQuantityDataBySku; public function __construct( GetSalableQuantityDataBySku $getSalableQuantityDataBySku ) { $this->getSalableQuantityDataBySku = $getSalableQuantityDataBySku; } public function execute() { $sku = "testsimpleproduct1"; $salable = $this->getSalableQuantityDataBySku->execute($sku); echo json_encode($salable); } }
This will give the output as –
[{“stock_name”:”Default Stock”,”qty”:4,”manage_stock”:true}]
Hope this helps. Please visit our Magento 2 affiliate Extension.
Happy coding 🙂
10 comments
If the issue still persists then please raise a ticket to https://webkul.uvdesk.com
$this->getSalableQuantityDataBySku->execute($sku);
But do remember to include the declare getSalableQuantityDataBySku variable like shown.
* Not all of your products are available in the requested quantity.
Magento Version – 2.3 Can you help inthis
is there a way to skip the reservation ?
We would like to skip the “The quantity of the product decrease only after shipping is completed.” part to how it was before .