Shopify API

Few weeks ago, one of my friends asked me about adding new features to his based online shop.

So, I started from their API of course - it’s well documented and very clear Documentation.

First of all I created my own shop for test purposes, and added some test products.

Test Products

In next step, you should go to the private apps admin panel section and generate your credentials.


Install gem:

gem install 'shopify_api'

Super simple API:

require 'shopify_api'


# get orders
orders = ShopifyAPI::Order.find(:all, params: { created_at_min: ( - 30.days), limit: 250 })

# get shop instance
shop = ShopifyAPI::Shop.current

# get products
products = ShopifyAPI::Product.find(:all, params: { limit: 250 })

# just print product titles
puts { |x| x.title }


marat at Marats-MacBook-Pro-2 in ~/Sandbox 
$ ruby shop.rb
["AS Roma T-Shirt", "Totti T-Shirt"]

Stay tuned, I’ll write some new posts about shop customization.