Magento 1.x Software Support Notice

For Magento Commerce 1, Magento is providing software support through June 2020. Depending on your Magento Commerce 1 version, software support may include both quality fixes and security patches. Please review our Magento Software Lifecycle Policy to see how your version of Magento Commerce 1 is supported.

For Magento Open Source 1.5 to 1.9, Magento is providing software security patches through June 2020 to ensure those sites remain secure and compliant. Visit our information page for more details about our software maintenance policy and other considerations for your business.

Catalog Product Attribute Media

Edit this page on GitHub

Module: Mage_Catalog

The Mage_Catalog module allows you to manage categories and products.

Product Images

Allows you to manage product images.

Resource Name: catalog_product_attribute_media




Fault Code Fault Message
100 Requested store view not found.
101 Product not exists.
102 Invalid data given. Details in error message.
103 Requested image not exists in product images’ gallery.
104 Image creation failed. Details in error message.
105 Image not updated. Details in error message.
106 Image not removed. Details in error message.
107 Requested product doesn’t support images


Example 1. Working with product images
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');

$newImage = array(
    'file' => array(
        'name' => 'file_name',
        'content' => base64_encode(file_get_contents('product.jpg')),
        'mime'    => 'image/jpeg'
    'label'    => 'Cool Image Through Soap',
    'position' => 2,
    'types'    => array('small_image'),
    'exclude'  => 0

$imageFilename = $proxy->call($sessionId, 'product_media.create', array('Sku', $newImage));


// Newly created image file
var_dump($proxy->call($sessionId, 'product_media.list', 'Sku'));

$proxy->call($sessionId, 'product_media.update', array(
    array('position' => 2, 'types' => array('image') /* Lets do it main image for product */)

// Updated image file
var_dump($proxy->call($sessionId, 'product_media.list', 'Sku'));

// Remove image file
$proxy->call($sessionId, 'product_media.remove', array('Sku', $imageFilename));

// Images without our file
var_dump($proxy->call($sessionId, 'product_media.list', 'Sku'));
Create the Magento file system owner