I'm trying to retrieve

  • virtual products,
  • which have been modified before a certain date
  • and which still are in stock

I'm using this

/rest/V1/products?searchCriteria[filter_groups][0][filters][0][field]=updated_at&searchCriteria[filter_groups][0][filters][0][value]=2019-05-25 00:00:00 &searchCriteria[filter_groups][0][filters][0][condition_type]=lt




While this returns some results, I have picked one returned sku, marked it as out of stock, and tried the above search again.

My problem is, my test sku which I marked out of stock, is again appearing in that search.

Is my search query correct?

--- edit ---

I'm setting the test sku as out-of-stock like this:

PUT /rest/V1/products/test_sku/stockItems/1

DATA {"stockItem":{"qty":0}}

I'm hoping this is the right way to mark an item as out of stock

---- edit 2 -----

FYI: the "Display Out of Stock Products" in my Stores>Configuration>Catalog>Inventory is set to default "No"


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.