Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Module: Mage_Catalog

Resource: catalog_product

Aliases:

  • product
Method:
  • catalog_product.list (SOAP V1)
  • catalogProductList (SOAP V2)

Allows you to retrieve the list of products.

Aliases:

  • product.list

Arguments:

TypeNameDescription
stringsessionIdSession ID
arrayfiltersArray of filters by attributes (optional)
stringstoreViewStore view ID or code (optional)

Returns:

TypeNameDescription
arraystoreViewArray of catalogProductEntity

The catalogProductEntity content is as follows:

TypeNameDescription
stringproduct_idProduct ID
stringskuProduct SKU
stringnameProduct name
stringsetProduct attribute set
stringtypeType of the product
ArrayOfStringcategory_idsArray of category IDs
ArrayOfStringwebsite_idsArray of website IDs

Examples

Request Example SOAP V1
$client = new SoapClient('http://magentohost/api/soap/?wsdl');

// If somestuff requires API authentication,
// then get a session token
$session = $client->login('apiUser', 'apiKey');

$result = $client->call($session, 'catalog_product.list');
var_dump($result);

// If you don't need the session anymore
//$client->endSession($session);
Request Example SOAP V2 (List of All Products)
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy->login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary

$result = $proxy->catalogProductList($sessionId);
var_dump($result);
Request Example SOAP V2 (Complex Filter)
$client = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

// If some stuff requires API authentication,
// then get a session token
$session = $client->login('apiUser', 'apiKey');
$complexFilter = array(
    'complex_filter' => array(
        array(
            'key' => 'type',
            'value' => array('key' => 'in', 'value' => 'simple,configurable')
        )
    )
);
$result = $client->catalogProductList($session, $complexFilter);

var_dump ($result);
Request Example SOAP V2 (WS-I Compliance Mode)
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

$sessionId = $proxy->login((object)array('username' => 'apiUser', 'apiKey' => 'apiKey'));

$result = $proxy->catalogProductList((object)array('sessionId' => $sessionId->result, 'filters' => null));
var_dump($result->result);
Response Example SOAP V1
array
  0 =>
    array
      'product_id' => string '1' (length=1)
      'sku' => string 'n2610' (length=5)
      'name' => string 'Nokia 2610 Phone' (length=16)
      'set' => string '4' (length=1)
      'type' => string 'simple' (length=6)
      'category_ids' =>
        array
          0 => string '4' (length=1)
  1 =>
    array
      'product_id' => string '2' (length=1)
      'sku' => string 'b8100' (length=5)
      'name' => string 'BlackBerry 8100 Pearl' (length=21)
      'set' => string '4' (length=1)
      'type' => string 'simple' (length=6)
      'category_ids' =>
        array
          0 => string '4' (length=1)