cancel
Showing results for 
Search instead for 
Did you mean: 

Magento API URL, which store_id should be used?

SOLVED

Magento API URL, which store_id should be used?

Hi All,

 

I´m new on Magento, I was reading this document https://devdocs.magento.com/guides/v2.0/rest/generate-local.html and I see that I need to specify the store_id.

 

Currently, I have only one store and any value works (default, store_id or all). I have omitted the store_id value and it works too. 

 

So, I would like to understand the impacts of each store_id value on my store, based on my current knowledge about Magento(which is not big =] ). I would say that In my case I should use the default. What are your thoughts?

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Magento API URL, which store_id should be used?

if you have only one store You can use default as store_code.

By Default store code would be a default. If you have multiple stores you need to find exact store code for a specified store from admin panel.

Go  To Stores -> Settings -> All Stores,

Click on Specific Store view from grid

Select code from store view and use that code as your store code.

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

View solution in original post

Re: Magento API URL, which store_id should be used?

Hi @bruno_soares

 

If you have only one store and you are not using store code in the URL - then you don't need to pass that in API.

 

As you have only one store so on the API url - you can directly pass your storeurl (http://yoururl.com/index.php/rest/v1) 

 

And later on whatever API you wanted to use - you can pass that method name after V1 - thats works for you !

 

Hope it helps 

if issue solved,Click Kudos & Accept as Solution

View solution in original post

2 REPLIES 2

Re: Magento API URL, which store_id should be used?

if you have only one store You can use default as store_code.

By Default store code would be a default. If you have multiple stores you need to find exact store code for a specified store from admin panel.

Go  To Stores -> Settings -> All Stores,

Click on Specific Store view from grid

Select code from store view and use that code as your store code.

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: Magento API URL, which store_id should be used?

Hi @bruno_soares

 

If you have only one store and you are not using store code in the URL - then you don't need to pass that in API.

 

As you have only one store so on the API url - you can directly pass your storeurl (http://yoururl.com/index.php/rest/v1) 

 

And later on whatever API you wanted to use - you can pass that method name after V1 - thats works for you !

 

Hope it helps 

if issue solved,Click Kudos & Accept as Solution