2

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?

1

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.

  • yep that was obvious! thx.. – huzefam Jun 28 '14 at 8:38
  • Hi, what about product resources like "media files" - Are they also deleted from DB and/or filesystem ? Do you have any experiences about this topic ? Regards – domi27 Oct 12 '16 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.