2

I'm using below url to access products which are specific to store

http://<magento_host>/rest/<store_code>/V1/products/product_name

but in output, i can see all other products as well. What may be the error or did I missed anything in a parameter.

Vishwas Soni
1,56714 silver badges34 bronze badges
asked May 16, 2017 at 8:33
2
  • did u get the solution for this ? please let me know i am looking for the the solution thanks Commented Dec 13, 2017 at 5:30
  • For anyone looking at this in 2024 (almost 2025), the issue is still there: github.com/magento/magento2/issues/15461 Commented Nov 26, 2024 at 17:54

3 Answers 3

3

I had same problem with magento rest api, looks they have problem in core (And they didn't fix this problem yet).. But I found solution with filters, you can filter by website_id (Please set website_id in filter no website_ids) and rest api will filter result by website_id).

Example code is here In this case I set website_id = 2

 https://your-site/rest/all/V1/products/?
 searchCriteria[filter_groups][0][filters][0][field]=website_id&
 searchCriteria[filter_groups][0][filters][0][value]=2&
 searchCriteria[filter_groups][0][filters][0][condition_type]=eq
answered May 4, 2020 at 11:46
1

Had the same problem, looks like it can also be resolved by adding store_id to the search criteria. e.g:

https://<DOMAIN>/rest/<STORE_CODE>/V1/products?searchCriteria=&searchCriteria[filterGroups][0][filters][0][field]=store_id&searchCriteria[filterGroups][0][filters][0][value]=<STORE_ID>

Or if website is enough use Dario's answer

answered Sep 30, 2020 at 9:05
0

Did you customized anything because by default magento never return any product when filtered by product name. You can refer http://devdocs.magento.com/guides/v2.0/rest/list.html

It filters by sku. Please review your question once more or provide more details.

answered May 19, 2017 at 10:53

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.