cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 Rest Api to Update Stock?

Magento 2 Rest Api to Update Stock?

What is the correct api method to call to update stock on a product?

 

I have narrowed it down to the following, but I may be wrong.

 

catalogInventoryStockRegistryV1
PUT /V1/products/{productSku}/stockItems/{itemId}

 

catalogProductRepositoryV1
PUT /V1/products/{sku}

 

Can anyone point me in the right direction?

1 REPLY 1

Re: Magento 2 Rest Api 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