I’m a completely new to both Rails and Shopify, but trying to learn and need some help making a simple start querying some Orders from a basic Rails app.
Where I am at:
So far, I’ve got myself setup as a Shopify Partner, have a Test Store, and can make queries via cURL just fine.
What I want to achieve:
I’m not wanting to make an embedded app for Shopify (at this stage).
Instead, I simply want to be able to authenticate (Oauth), and query some Orders (from my Test store) from within my simple, standalone Rails app.
What I’m confused about:
The ShopifyAPI gem seemed like the natural place to start, at least for my basic requirements, but documentation highly recommends using the shopify_app gem instead.
But, when I read the documentation for the shopify_app gem it seems largely oriented around making an embedded app, which is not what I want right now. Nor, is it clear how to use it for my simplistic purposes.
As such, I’m unsure which it is the best gem for the job, and how to proceed with it.
I understand your idea. Shopify provides an official authentication guide and sample code: https://shopify.dev/docs/apps/build/authentication-authorization. If you encounter any issues during a specific step, feel free to continue the discussion here. Additionally, Shopify offers a variety of app templates:Shopify API, libraries, and tools, you can start with these to help you familiarize yourself with the process.
Hi @remy727 , that’s the kind of thing I was looking for, thanks!
I’m going to keep this issue open for a little longer, as I’m still hoping to utilise the shopify_app gem for its classes, and other stuff, directly in a Rails app (I’d rather not reinvent the wheel).
But, that script of yours is a good start, cheers.
I was just trying to follow the advice from the ShopifyAPI which says if you’re using it in a Rails app then shopify_app gem is preferred.
So, I’m guessing then that shopify_app gem primarily exists to make embeddable apps with Rails (as opposed to Node)?
If shopify_api provides functional Oauth and queries then that’s all I need at this stage. Plus, I can use that easily enough in any existing Rails apps I might be working on.