Shopify Development Platform
The Shopify API lets you access a Shopify store from your own application. While the examples on this page are focussing on API development using Ruby on Rails you can use any other language as well.
Build and deploy a Shopify app in 8 minutes.
This screencast walks you through the creation and deployment of a Rails app that integrates with the Shopify API. Thanks to the help of the shopify_app plugin and the Heroku deployment platform, the entire process takes about 8 minutes (including explanations along the way).
Getting started with the API
|
Shopify Rails PluginReady to develop for the Shopify platform? There is no easier way than to get started with the Shopify plugin. We will set you up with a nice design, full login system, and access to all of Shopify’s objects. Simply install plugin or visit our Github project |
HerokuGet right to coding without the fuss of setting a server up.
|
|
Latest news
-
Official PHP adapter for Shopify API
posted by edward, June 18, CommentsWe’re happy to announce the open source release of an official PHP adapter for the Shopify API. It’s got all the bells and whistles of its Ruby counterpart to help you create great applications for release in the Shopify App Store.
Forget having to write installation & authentication code yourself. Generating an installation link and redirecting the merchant to a screen asking for permission to access their shop’s data is now just these two lines:
$api = new Session('mystore.myshopify.com', '', 'YOUR_API_KEY', 'YOUR_SECRET'); header("Location: " $api->create_permission_url());After the merchant gives your app permission to access their data, Shopify redirects the user to the return URL you set up for your app, along with their shop name, token and signature.
Finish authentication by passing the shop name, token, and signature into the Session:
$shop = $_GET['url']; $token = $_GET['t']; $api = new Session($shop, $token, 'YOUR_API_KEY', 'YOUR_SECRET');
That’s it! Now that your application’s been installed, you’re ready to make API calls to the merchant’s shop.
Here’s an example that prints the title of each product:
$storeProducts = $api->product->get(); foreach($storeProducts as $product) { echo $product['title'].'<br />'; }You can also request a specific product by passing its product id to the product
get()method:
$aProduct = $api->product->get(1234567);
echo $aProduct[‘title’];
To create a new product (if your application has write permissions), you can use the product
create()method by passing fields you would like your new product to have:$fields = array('title' => 'My New Product'); $api->product->create($fields);To update a product (if your application has write permissions), you can use the product
modify()method by passing the product id and the fields you would like to modify:$fields = array('title' => 'My Updated Title'); $api->product->modify(1234567, $fields);Download and try the new PHP API for yourself by going to its GitHub repository. Forks and feature requests are encouraged.
Give us, the Shopify Developers, a shout in the developer forums if you need a hand or want to pass on a compliment to William Lang, one of our newest developers and the man behind this library.
-
Shopify API Change Notice – Product, Page, Article, Collection Body
posted by john, May 12, CommentsThe following changes will be made to the API, effective Monday, July 5, 2010 12:00am UTC
- Deprecation of <body> from Products, Pages, Articles, Collections
This field has been replaced by the <body_html>. All api requests should now use the <body_html> field, and ensure <body> is removed. - The <body> field will still be accepted up until July 5, but users are encouraged to migrate to the new <body_html> field.
Shopify API documentation:
Products API
Articles API
CustomCollections API
SmartCollections API - Deprecation of <body> from Products, Pages, Articles, Collections
-
Shopify API Change Notice – Orders shipping line
posted by Dennis, April 13, CommentsThe following changes will be made to the API, effective Monday, June 14, 2010 12:00am UTC
- Deprecation of <shipping_line> from Orders
The single field <shipping_line> will be removed. This element is no longer required, as the exact same information is already contained in the <shipping_lines> array.
Shopify API documentation:
Orders API - Deprecation of <shipping_line> from Orders
-
New Feature: Metafields
posted by Caroline, December 14, CommentsWe’re excited to announce that we’ve just rolled out the ability to attach metadata to a shop’s resources using the Shopify API. This means Shopify app developers can now store additional information about products, collections, orders, blogs, pages… and the shop itself. We’re calling this feature metafields.
For the time being, you can only add these metafields and edit them using the Shopify API. Some time from now, we will make it possible for a shop owner to manage them from the admin interface.
The ability to use metafields in a Shopify theme has already been implemented. So you can output and use metafields in your Liquid templates (including email templates), provided you’ve added them using the API.
Our API documentation has been updated to show you how to add, edit and delete metafields. Check out the API Documentation page on MetaFields.
A metafield consists of a namespace, a key, a value, and a description (optional). Use the namespace to group different metafields in a logical way. You can also specify that it is either an integer or a piece of text (a “string”). In this way, you’ll end up with the right type when you use it in your Liquid.
Say you’ve added to a product a metafield with the following attributes:
- description: Author of book
- namespace: book
- key: author
- value: Kurt Vonnegut
- value_type: string
You can output the value of this metafield in product.liquid with this Liquid tag:
<pre> {{ product.metafields.book.author }} </pre>There is currently no limit imposed on how many metafields you can attach to any piece of content.
If you’re a Ruby on Rails developer, our shopify_api gem will get you started with adding metafields. Take a look at the Metafields module defined in shopify_api.rb.
Using the Metafields module, setting a metafield on a product is as easy as this:
<pre> product = ShopifyAPI::Product.find(product_id) product.add_metafield(ShopifyAPI::Metafield.new({ :description => 'Author of book', :namespace => 'book', :key => 'author', :value => 'Kurt Vonnegut', :value_type => 'string' })) </pre>Metafields can be used to further describe products, beyond the product description, type, vendor and tags. You can also use metafields to store a ‘teaser’ or ‘summary’ for a blog post.
App Store developers can also use metafields to share information between multiple applications.
The possibilities are limitless. We’re inviting you to share your ideas on how to use metafields with the rest of the Shopify’s community in our Community forums.
Update: Metafields can now be added to product variants as well.
-
Shopify API Change Notice – Custom Collections
posted by john, December 11, CommentsThe following changes will be made to the API, effective Monday, December 21, 2009 12:00am UTC
- Deprecation of <conditions> from Custom Collections
The read-only field <conditions> will be removed. This information no longer required, as the information is already contained in the <rules> array.
Shopify API documentation:
Custom Collections API - Deprecation of <conditions> from Custom Collections
-
Developer Meetup Today at 2:00PM EST
posted by edward, December 10, CommentsThinking of developing for the Shopify platform?
Got a great idea for a Shopify app and need to know more about the technical specifics?
Already working on something, but wondering “if only the Shopify API could…”?
Join us at the Shopify Developer Meetup today, December 11th, at 2:00PM EST.
These meetups are our way of sitting down with you the developer, hacking away on the Shopify platform and its API. We want to hear your questions, and see what sort of cool stuff you’ve got cooking.
Looking forward to seeing you there,
The Shopify API Team
-
Next Developer Meetup: December 11
posted by edward, November 26, CommentsThe next developer meetup will take place on December 11th, 2009. More details to be announced at http://shopify.com/developer-meetup in the very near future.
These meetups are our way of sitting down with you the developer, hacking away on the Shopify platform and its API. We want to hear your questions, and see what sort of cool stuff you’ve got cooking.
If you came to the last meetup, thanks for all the questions and ideas! We’d like to send a particular shoutout to Marcus, CEO of Little Bird Electronics who showed off an idea for adding icons to Application Links – we loved it so much, it wasn’t long before it was integrated into Shopify. Take a look at it here.
We’re still working and thinking about your other ideas like searching through the API and creating discount codes through the API. We really want to make sure we get it right the first time it goes out, so if you have any ideas about how you’d like to see the API presented or work, now’s the time to let us know.
Looking forward to seeing you there,
The Shopify Team
-
Application Link Icons
posted by edward, November 06, CommentsThanks to a suggestion from one of our fine developers, application links can now have icons.
To set an application link’s icon, click the “Choose an icon” link in the app’s edit screen:

A screen then appears, showing the entire Silk icon set from famfamfam. Select one of these by clicking on it.
After selecting an icon, it’ll appear right away:

Save the changes made to the app, and the icon will appear next to the link in your users’ admins:

-
Shopify Billing API Opens
posted by edward, September 25, CommentsWe’re happy to announce the full release of the Shopify Billing API.
Shopify Apps are now able to issue one-time and monthly recurring charges (i.e. subscription plans) through the API, which means that features like tiered plans, coupon codes, trial periods, and much more are easily doable.
Invoicing and collection of application charges and plan upgrading/downgrading are all handled by Shopify – there’s no complex billing code for you as a developer to deal with or have to write yourself.
If you’d like to know more, documentation and a tutorial on how to use the new billing API features are available with the Shopify API docs.
-
Shopify API Change Notice
posted by john, September 21, CommentsThe following changes will be made to the API, effective Monday, Octobert 3, 2009 12:00am EST
- Deprecation of POST/PUT for variant title.
Clients will no longer be able to modify Variant Title through POST/PUT methods. As Variant Title is a concatenation of Option1 Value, Option2 Value (if applicable), and Option3 Value (if applicable), clients should modify these values instead.
GET methods for Products and Variants are unaffected, and will still return Variant Title as the concatenation of Option Values for a given Variant.
Shopify API documentation:
Products API
Product Variants API - Deprecation of POST/PUT for variant title.


