2

How can i get store_id in Magento2 REST API and by passing store_id i want to show different store views in application using REST API.

  • Try the answer and let me know if you have any query. – Aditya Shah Sep 26 '18 at 6:16
  • yes i got, but i want separate stores views is there any api for that – Pratap varma Penmetsa Sep 26 '18 at 6:21
  • Yes it is, but what exactly you want to achieve, can you please elaborate ? – Aditya Shah Sep 26 '18 at 6:24
  • i have select city option in website if i select particular city or place i want that id as store id and whole app must change based on that id – Pratap varma Penmetsa Sep 26 '18 at 6:32
  • 1
    can u elaborate please. which parameters should i pass in api – Pratap varma Penmetsa Sep 26 '18 at 6:44
3

storeStoreRepositoryV1


Group repository interface

http://magento.host/index.php/rest/V1/store/storeGroups
  • method : GET
  • Authorization : Bearer <admin token>

This will return website_id, root_category_id, default_store_id, name, code


Store repository interface

This will return store id, website id and also code, in-short all data of store repository.

http://magento.host/index.php/rest/V1/store/storeViews
  • method : GET
  • Authorization : Bearer <admin token>

As per discussion,

storeStoreConfigManagerV1


http://magento.host/index.php/rest/V1/store/storeConfigs
  • method : GET
  • Authorization : Bearer <token>
  • after getting store code we should pass store code in base.url/rest{store code}/V1/categories then we will get separate store Views – Pratap varma Penmetsa Sep 26 '18 at 7:35
  • I was looking for website ids list and now I have it. Thank you! – Tomasz Kuter Jun 4 at 15:21
  • You're welcome, happy coding 😊 – Aditya Shah Jun 4 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.