Getting a Shopize Store?

I feel like I'm missing something extremely simple here. So, I have an authentication session, and I really want to download the current Shop object in order to get access to some things, for example, email address, shop_owner, etc. How can I get this to get this answer?

http://api.shopify.com/shop.html#show 

I tried to look at /admin/shop.json and use

 ShopifyAPI::Shop.find(someidnumber) 

but not to go?

+7
source share
2 answers

Endpoint /admin/shop.json . If you use the ShopifyAPI gem, in resources/shop.rb you will see that there is a current function.

Calling ShopifyAPI::Shop.current will return a Shop object with the information you are looking for.

If you do not receive the correct object / response, then you should not be authenticated properly.

+11
source

You can access it using

 ShopifyAPI::Shop.current 

However, for it to work, you need your controller to inherit from ShopifyApp::AuthenticatedController

Something like:

 class MyController < ShopifyApp::AuthenticatedController 
0
source

All Articles