Search code examples
magentomagento-soap-api

How do I change Magento store when making API (SOAP) call?


I need to create orders through the API with some special settings. So I have created a second store for API calls. But for whatever reason the API only communicates with the first store.

Ive changed the API-store to be the default with no effect.

How do I change the store when making API calls?


Solution

  • you can set current store by api call by calling using method catalogCategoryCurrentStore($sessionId, '1');

    For more details visit http://www.magentocommerce.com/api/soap/catalog/catalogCategory/catalog_category.currentStore.html and look how they are setting the store.

    $proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 
    $sessionId = $proxy->login('apiUser', 'apiKey'); 
    $result = $proxy->catalogCategoryCurrentStore($sessionId, '1');
    var_dump($result);
    

    change the details as per your host & user.