Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Inventory API

Last modified by Michael on Fri, July 4, 2008 13:36
Source|Old Revisions  

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

Aliases:

  • 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)

Aliases:

  • product_stock.update

Faults

Fault Code Fault Message
101 Product not exists.
102 Product inventory not updated. Details in error message.

Examples

Example 1. Working with stock update

  1. $proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
  2. $sessionId = $proxy->login('apiUser', 'apiKey');
  3.  
  4.  
  5. // Get stock info
  6. var_dump($proxy->call($sessionId, 'product_stock.list', 'Sku'));
  7.  
  8.  
  9. // Update stock info
  10. $proxy->call($sessionId, 'product_stock.update', array('Sku', array('qty'=>50, 'is_in_stock'=>1)));
  11.  
  12. var_dump($proxy->call($sessionId, 'product_stock.list', 'Sku'));



 

Popular Wiki Tags  |  View all

 module   routes   resource   list   data accessing   backend   mysql4   action   api   controller   getModel   php   model   custom attributes   eav 

Professional Services from the Magento Team

Professional Installation from the Magento Team

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
50171 users|617 users currently online|102326 forum posts