Blog

Shopify API overview0

Most of inventory applications have the same models and functionalities. Most of them should have shops, products, orders and line items. They need also to handle order payment status and fulfillment status. The products stock status is also a common requirement in most of them.

Shopify handles all of that overhead and can do all of that for you. You won't need to handle this work every time. You can build your complete shop in just 2 minutes. Shop owners can create their shops, add products and product variants. Then shopify partners can create applications to integrate with the shop.

Shopify API is an XML API that allows applications to integrate with Shopify via RESTful actions using verbs (GET/POST/PUT/DELETE).

The Shopify API lets you access a Shopify store from your own application. You can have many applications integrated with your shop store. It will be easy to integrate with the store through the XML REST convention. Shopify supports Rails applications to integrate with it. You will need to install Shopify_app plugin and ShopifyAPI gem for integration.

Shopify app is a rails plugin that generates basic login controller for authentication. ShopifyAPI is a lightweight gem for accessing the Shopify admin REST web services. ShopifyAPI can easily fetch orders and products using  ActiveResource as the following:

products = ShopifyAPI::Product.find(:all)
orders   = ShopifyAPI::Order.find(:all)

You can also create, update or delete shopify resources using ActiveResource.

#create product
product = ShopifyAPI::Product.create(:body => "iphone",
                                     :title => "iphone by Apple",
                                     :vendor => "Burton")

#update product title
product.title = "Apple iphone"
product.save

#delete product
product.destroy

This post just provides a fast introduction about shopify, shopify API, their shopify_app plugin and shopifyAPI gem. For more detailed information, check their official documentations.

  • 0 Comments

  • No comments have been made on this post.

Leave a Comment...