Jump to content

Update stock via webservice in multi-store


Recommended Posts


I'm trying to update the stock of the products via API/webservice.

I can update the stock in a single-store Prestashop, and even in a multi-store prestashop I created for testing purposes. However I can update the stocks in a customer's shop. I can update any other product data but the stock.

I will explain this with an specific example:

There are two stores: one with ID=1 and another one with ID=4.

The Webservice returns this product info.:


In the obtained info, I see the stock_svailables node with this info:

id = 12345

id_product_attribute = 0

id_shop_default = 4

So I can now get the stocks_available for that product:


id_shop: 0

quantity: 4


I don't understand why product.id_shop_default is 4 but stocks_available.id_shop is 0. However, I insist...

So, if I want to modify the stock, I send this XML to stocks_available/12345:

<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">

I have tried specifying id_shop, id_group, or leaving them empty. Same result: product stock doesn't update.

No error message in the request. Result is OK - 200

The request is executed correctly, but the stock in Prestashop is not changed.

If I go ask for stocks_available/12345, I get something like 'there's not stocks_available for this product in this shop', and api/products/999 returns now an empty stocks_available node.

I don't know if the problem is in my customer's Prestashop settings, or if he has products created in Shop 1 but stock in Shop 4, etc., but if I replicate this in my testing shop, I can update the stock with no problem.

Dooes anybody know if I have to do something different when updating stock in multi-store?


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More