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
-
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.
-
Shopify App Developer IRC Meetup: September 25th, 2:00PM EST
posted by edward, September 09, CommentsShopify is having an App Developer meetup September 25th.
Come join us in IRC in the #shopify channel on irc.freenode.net at 2:00PM EST and talk with some of the API AppStore developers about how you can turn some ideas you’ve got floating around into a moneymaker sold on the AppStore.
For more about building Apps, see http://www.shopify.com/developers/
Unsure about IRC? Jump over to the web-client, choose a nick for yourself, and join the channel.
(Update: the title was mistakenly set to September 19th. Please disregard the old date.)
-
Admin Resources Now Countable
posted by edward, July 17, CommentsAfter listening to early adopters of the Shopify API in the Developer Forums, we’ve rolled out the ability to issue count requests on resources like
OrderandProduct.The count requests look like and take the same conditions and parameters you’d give to the existing find request you’re used to – they just return a count of how many orders, products or other resource you’re querying for.
Here’s an example of how to ask how many orders have yet to be shipped:
http://snowdevil.myshopify.com/admin/orders/count?fulfillment_status=unshippedWe’ve also added counting to the ShopifyAPI library that comes with the shopify_app plugin, so you can now write
ShopifyAPI::Order.count(:status => "unshipped")
and you’ll get back just what you expect.Check out the updated docs in http://api.shopify.com and the open-source shopify_app plugin at Github.
-
Build and deploy a Shopify app in 8 minutes
posted by James, June 11, CommentsAre you a developer with an idea for a Shopify app that’s been buzzing around in your head for a while but haven’t known what would be involved in implementing it? Here’s a screencast we just uploaded that shows you each step involved in the process of getting a Shopify app online for anyone to use.
After signing up as a Shopify Partner, you’ll need Rails, Git, and a free Heroku account to follow along at home.
<object height=“295” width="480"><param></param><param></param><param></param><embed src=“http://www.youtube.com/v/OvzmAi3VhDQ&hl=en&fs=1&rel=0&hd=1” height=“295” width="480"></embed></object>
Update: The process for using API credentials in production have changed since the screencast was recorded. Instead of running shopify.yml through ERB, the shopify_app plugin now always looks for the environment variables for your credentials before resorting to shopify.yml. So shopify.yml should go in your .gitignore file as soon as you use the plugin’s generator, and then you’ll never have to worry about accidentally including live credentials in your code.


