1

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

&searchCriteria[filter_groups][1][filters][0][field]=quantity_and_stock_status&searchCriteria[filter_groups][1][filters][0][value]=1&searchCriteria[filter_groups][1][filters][0][condition_type]=eq

&searchCriteria[filter_groups][2][filters][0][field]=type_id&searchCriteria[filter_groups][2][filters][0][value]=virtual&searchCriteria[filter_groups][2][filters][0][condition_type]=eq

&fields=items[sku]&searchCriteria[pageSize]=100

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, privacy policy and cookie policy

Browse other questions tagged or ask your own question.