Posted on

Product Stock List using SOAP API

I am using following code to get the stock detail I am getting product stock of productId 149428

$proxy = new SoapClient(‘http://yourstore.com/api/?wsdl’);
$sessionId = $proxy->login(‘apiuser’, ‘apiKey’);
$result = $proxy->call($sessionId, ‘product_stock.list’,’149428′);
var_dump($result);

Result:

array(1) { [0]=> array(4) { [“product_id”]=> string(6) “149428” [“sku”]=> string(13) “n12345” [“qty”]=> string(6) “1.0000” [“is_in_stock”]=> string(1) “1” } }

But I want to retrieve all products stock list instead of getting single product stock details.

I tried using the below method but I am not getting a result,

$result = $proxy->call($sessionId, ‘product_stock.list’);
var_dump($result);

Another:

$result = $client->call($session, ‘cataloginventory_stock_item.list’);
var_dump($result);

Thank you in advance.

Leave a Reply

Your email address will not be published. Required fields are marked *