cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to use 2.0 API catalogInventoryStockRegistryV1 to update stock

Unable to use 2.0 API catalogInventoryStockRegistryV1 to update stock

I'm in need of a method of updating the inventory of a particular stock item via the SOAP API, I can perform a "Get" using the catalogInventoryStockRegistryV1GetStockStatusBySku but there doesn't appear to be a "Post" or a set.

When I look at the REST equivelant here http://devdocs.magento.com/swagger/index.html#/ there is this a PUT as UpdateStockItemBySkuPut - but this doesn't appear to be in the WSDL for SOAP.

Am I missing something or referencing the wrong service somehow?

Thanks in advance.

7 REPLIES 7

Re: Unable to use 2.0 API catalogInventoryStockRegistryV1 to update stock

Use PUT on http://yourmagento.com/rest/V1/products/{productSku}/stockItems/{itemId}.

For example: 

http://yourmagento.com/rest/V1/products/24-MB01/stockItems/1

stockItems will be always 1 if you're not having multiple stocks.

 

As parameter, provide qty in JSON, for example:

{"stockItem":{"qty":100}}

 

 

If this response was helpful to you, consider giving kudos to this post.
If this response solved your problem, click accept as solution to help others solve this issue

Re: Unable to use 2.0 API catalogInventoryStockRegistryV1 to update stock

Thanks - but that's REST - we're using SOAP in this project - the WSDL doesn't appear to contain the Update method - or am I going mad?

Re: Unable to use 2.0 API catalogInventoryStockRegistryV1 to update stock

Well, there is actually. catalogInventoryStockRegistryV1UpdateStockItemBySku.

Where is the issue? Well, you've probably used something like:

http://magento.local/index.php/soap/default?services=catalogInventoryStockRegistryV1&wsdl

 

And that's why you haven't seen all methods available. You have to authenticate and call it again, and then you will see the additional set of methods.

 

This is how it looks when I make a call from SoapUI software:

https://www.dropbox.com/s/rzcl26n4dfplg3p/Screenshot%202017-03-03%2019.30.39.png?dl=0

If this response was helpful to you, consider giving kudos to this post.
If this response solved your problem, click accept as solution to help others solve this issue

Re: Unable to use 2.0 API catalogInventoryStockRegistryV1 to update stock

Ah - now that makes sense, but the next question is - how do I authenticate to get the WSDL into Visual Studio in order for Visual Studio to build up the classes etc. for the calls?

Re: Unable to use 2.0 API catalogInventoryStockRegistryV1 to update stock

I think the answer is here:

 

https://github.com/magento/magento2/issues/6854

 

Use SOAPUI etc to authenicate and download WSDL, then use downloaded WSDL as service reference in Visual Studio, will confirm as solution once tested.

Re: Unable to use 2.0 API catalogInventoryStockRegistryV1 to update stock

Well, Visual Studio is out of my knowledge.

 

I hope I've helped you with the issue.

If this response was helpful to you, consider giving kudos to this post.
If this response solved your problem, click accept as solution to help others solve this issue

Re: Unable to use 2.0 API catalogInventoryStockRegistryV1 to update stock

I think you have, it's certainly the first SOAP interface I've come across that requires you to "login" before you can download the description of the service, missguided security?