I feel like I'm missing something extremely simple here. So i have the authentication session, and I essentially want to load the current Shop object to access somethings, like the email address, shop_owner, etc. How can I retrieve that to essentially get this response?
http://api.shopify.com/shop.html#show
I tried looking at /admin/shop.json and using
ShopifyAPI::Shop.find(someidnumber)
but no go?
In your Shopify admin, go to the Orders page and click Export. If you want to export data about specific orders, select those. Then you need to select which orders you want to export, the CSV file format and whether you want to include transaction histories.
Log in to a Shopify store that shares the same email address as your other stores. After you log in, you're presented with a list of stores and services that are associated with that email address. Review the stores to make sure that you want to set up a Shopify ID for all the stores. Click Set up Shopify ID.
The Storefront API is a GraphQL API that powers customer facing experiences. It is device-agnostic and enables developers to build custom storefronts. You use the Storefront API to build API-powered commerce such as mobile apps, headless commerce web experiences, Internet of Things (IoT), voice commerce, and more.
The endpoint is /admin/shop.json
. If you're using the ShopifyAPI gem, in resources/shop.rb
you'll see there is a current
function.
Calling ShopifyAPI::Shop.current
will return a Shop object with the details you're looking for.
If you're not getting the correct object/response back then you must not be authenticated properly.
You can access it with
ShopifyAPI::Shop.current
However, in order for it to work - you need your controller to inherit from ShopifyApp::AuthenticatedController
Something like:
class MyController < ShopifyApp::AuthenticatedController
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With