Magento 1.8 SOAP API – How to Delete Product Using SKU

apimagento-1.8soap

I have a bridge built between two applications, where products are getting dumped into magento. I am using Magento SOAP API to add/update/delete products, but i need to do delete product using SKU and not product id..Any Suggestions?

Best Answer

Hear the Code to remove the Product Based on SKU

Request Example SOAP V1

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

 // If somestuff requires api authentification,
 // then get a session token
 $session = $client->login('apiUser', 'apiKey');
 $result = $client->call($session, 'catalog_product.delete', '1');
 var_dump($result);

 // If you don't need the session anymore
 //$client->endSession($session);

Request Example SOAP V2

 $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->catalogProductDelete($sessionId, '6');
 var_dump($result);

Please see the Image for Request and Response Data

enter image description here

For More Reference Please Check This Link.