Take the 2-minute tour ×
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
yep that was obvious! thx.. –  huzefam Jun 28 at 8:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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