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. Sep 26, 2018 at 6:16
  • yes i got, but i want separate stores views is there any api for that Sep 26, 2018 at 6:21
  • Yes it is, but what exactly you want to achieve, can you please elaborate ? Sep 26, 2018 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 Sep 26, 2018 at 6:32
  • 1
    can u elaborate please. which parameters should i pass in api Sep 26, 2018 at 6:44

1 Answer 1



Group repository interface

  • 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.

  • method : GET
  • Authorization : Bearer <admin token>

As per discussion,


  • 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 Sep 26, 2018 at 7:35
  • I was looking for website ids list and now I have it. Thank you! Jun 4, 2019 at 15:21
  • You're welcome, happy coding 😊 Jun 4, 2019 at 16:04
  • 1
    Very useful answer! Sep 11, 2020 at 10:18

Your Answer

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

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