Inventory API
Magento : Inventory API
Allows export/import catalog inventory.
Module: Mage_CatalogInventory
Resource: cataloginventory_stock_item
Aliases:
Allows export/import catalog inventory.
Module: Mage_CatalogInventory
Resource: cataloginventory_stock_item
Aliases:
- product_stock
Methods
cataloginventory_stock_item.list
Retrieve stock data by product ids
Return: array
Arguments:
- array products - list of products IDs or Skus
- product_stock.list
cataloginventory_stock_item.update
Update product stock data
Return: boolean
Arguments:
- mixed product - product ID or Sku
- array data - data to change (qty, is_in_stock)
- product_stock.update
Change manage_stock setting to ‘off’ in the inventory area
$attributeSets = $client→call($session, ‘product_stock.update’, array(’SKU’,array(’manage_stock’⇒‘0’,’use_config_manage_stock’⇒‘0’)));
The use_config_manage_stock unchecks the ‘Use Config Settings’ box which allows you to make changes to this product and not use the global settings that are set by default.
Example 1. Working with stock update
- $proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
- $sessionId = $proxy->login('apiUser', 'apiKey');
- // Get stock info
- var_dump($proxy->call($sessionId, 'product_stock.list', 'Sku'));
- // Update stock info
- $proxy->call($sessionId, 'product_stock.update', array('Sku', array('qty'=>50, 'is_in_stock'=>1)));
- var_dump($proxy->call($sessionId, 'product_stock.list', 'Sku'));
Comments
Post a Comment