neo_kit
December 17, 2020, 1:54am
1
I would like to update the physical_stock_level of products to 0.
The endpoint that I’m using is /sellables/{sellable_id}/warehouses/{warehouse_id}/stock_entry.
The API works if the physical stock level is a positive number. However, it seems to ignore the update when the physical stock level is 0.
Ade
December 17, 2020, 6:46am
2
HI Neo_kit,
If the stock level is already the required amount, then technically there is nothing to update
Cheers
Ade
neoneo
January 8, 2021, 7:55pm
3
Hi Ade,
Thanks for the reply.
What neo_kit means is that when sending physical_stock_level 0 to a product that has a positive physical_stock_level already, does not change it to 0.
But sending a physical_stock_level > 0 to a product, will correctly change it to that number.
Eg if the product has a current physical_stock_level of 5.
And we send an API request with physical_stock_level 3. It will change it to 3.
But if we send an API request with physical_stock_level of 0, the end result is a stock level of 5 still.
Hi neoneo,
Is this the case also if you attempt to update the same product in the app?
Is this the case for all sellables?
Thanks,
Sam
neoneo
February 11, 2021, 7:21pm
5
I wanted to update this in case anybody else has this problem (unlikely).
We found out that the /sellables/{sellable_id}/warehouses/{warehouse_id}/stock_entry PUT calls were not working because the payload was no longer working.
Previously we were able to send a payload like this:
{
"physical_stock_level": 200
}
Following the current API documentation, we changed that to this:
{
"stock_entry": {
"physical_stock_level": 200,
}
}
Our usage originated some years ago so its possible that the non-conforming payload was working when we first made it.