Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

How to retrieve products for particular store through API call #141

Open
vinodrathod9-5 opened this issue Sep 7, 2015 · 2 comments
Open

Comments

@vinodrathod9-5
Copy link

Hi, I have an application with multi domain extension support. Here different store has different products assigned to it. e.g. For Store 1 - store1.example.com and for Store 2 - store2.example.com
Okay, when I call default-store-example.com/api/products.json?token=MY_TOKEN_ID, I get complete products in JSON format. But.
Here, I have a issue while retrieving products for Store 1 and Store 2 through api call. When I call products for the Store 1 i.e., store1.example.com/api/products.json?token=MY_TOKEN_ID and store2.example.com/api/products.json?token=MY_TOKEN_ID then also I get the complete list of products as shown in default store.

What I'm expecting is when i GET products for a particular store then I should get the products of that store which was assigned in the admin panel. What should I do, couldn't understand.

Please help??

@krtschmr
Copy link

2 solutions.
either you add a store_id param to the request
or the API needs to scope to current_store

both ways, you have to patch yourself.

@ghost
Copy link

ghost commented May 2, 2017

I'm new to spree so I'm not sure if this is the correct answer, but you should be able to use the product search api api to search for all the products belonging to a particular store.

Search depends upon the rancsack module. The documentation contains a list of the type of queries that you can use.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants