Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Problem deleting product via API
 
Magentourist
Member
 
Total Posts:  48
Joined:  2008-08-11
Berlin
 

Hello,

from the api docs I took this line of code to delete a product:

$proxy->call($sessionId, ‘product.delete’, ‘sku_of_product’);

and rewrote it for xml-rpc:

xmlrpc(’http://myserver/magento/index.php/api/xmlrpc’,’call’, $sid, ‘product.delete’, ‘prod_id_12345’);

$sid is valid it is successfully used before to output some info.
Product id (sku) is also correct. I checked the value in the DB.

However the product isn’t deleted.

Diddd the API change here or am I missing a point?

 
Magento Community Magento Community
Magento Community
Magento Community
 
LeeSaferite
Guru
 
Avatar
Total Posts:  322
Joined:  2007-08-31
Lake City, FL
 

It seems like (According the the documentation) the xmlrpc method name should be ‘catalog_product.delete’, but the example seems like it is wrong.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Magentourist
Member
 
Total Posts:  48
Joined:  2008-08-11
Berlin
 

It wasn’t the method name but the sku parameter needed to be inside an array:

xmlrpc(’http://myserver/magento/index.php/api/xmlrpc’,’call’, $sid, ‘product.delete’, array(‘prod_id_12345’));

 
Magento Community Magento Community
Magento Community
Magento Community
 
LeeSaferite
Guru
 
Avatar
Total Posts:  322
Joined:  2007-08-31
Lake City, FL
 

Glad to hear you solved the problem. 

Weird that the documentation lists the method name as catalog_product.delete AND product.delete

 
Magento Community Magento Community
Magento Community
Magento Community
 
Magentourist
Member
 
Total Posts:  48
Joined:  2008-08-11
Berlin
 

I guess they refactored it and the latter is left as an alias for the same method.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top