cancel
Showing results for 
Search instead for 
Did you mean: 

Getting started with SOAP/API Magento 2.0

Getting started with SOAP/API Magento 2.0

I'm looking at using SOAP/API to update product information but can't get started.

 

All I was trying to do to start with is just update one product but all the help and tutorials say the WDSL endpoint is http://[webaddres]/api/soap but this folder does not exist here.

 

What am I missing, are the endpoints somewhere else in Magento 2.0 or do I need to install something else?

 

Basically trying to get something like this working....

 

$client = new SoapClient('http://[website_here]/api/v2_soap/?wsdl');


// If some stuff requires api authentification,
// then get a session token
$session = $client->login('apiUser', 'apiKey');
$result = $client->catalogProductUpdate($session, 'product_sku', array(
    'categories' => array(2),
    'websites' => array(1),
    'name' => 'Product name new',
    'description' => 'Product description',
    'short_description' => 'Product short description',
    'weight' => '10',
    'status' => '1',
    'url_key' => 'product-url-key',
    'url_path' => 'product-url-path',
    'visibility' => '4',
    'price' => '100',
    'tax_class_id' => 1,
    'meta_title' => 'Product meta title',
    'meta_keyword' => 'Product meta keyword',
    'meta_description' => 'Product meta description'
));

var_dump ($result);