Shopify App Development
From Shopify Wiki
Get started learning how to build, promote, and sell Shopify apps.
Shopify apps increase sales, automate chores, and make customers happier by integrating Shopify stores with services like Twitter, Freshbooks, recommendation engines, or other kinds of new functionality.
By developing your app and publishing it in the Shopify App Store you make it easy for all 15 000+ of Shopify merchants to install and pay for your services on a monthly recurring basis.
Want to stay on top of new developments? Follow @shopifyapi on Twitter.
What should I make?
Curious what to make? Merchants ask for all sorts of stuff that they're more than willing to pay for. Check out this thread in the forums for ideas.
What is an app?
A Shopify app uses the Shopify API to access a shop’s data and automate almost any action you can take from their admin panel. For example, you could build an app that looks at all of a shop's orders and visualizes them on a map of the world using the Order API and Google Maps. Or you could make an instant sale app that changes a product's price for 3 hours, sends SMS messages to a lucky group of customers about the reduced prices, and automatically bump the prices back up after the 3 hours are over by using the Product and Product Variant APIs.
When a shop installs your app, all they’re really doing is giving your app permission to access their shop’s data via the API.
After the shop merchant agrees to giving your app permission to access their data, Shopify redirects the merchant to a URL you specify. After that, the rest is up to you.
In its most basic form, an app is just an API key that has permission to access certain shops' data. That's it – there’s no binary package being uploaded anywhere or special certification programs you need to jump through.
Both web and desktop apps can be easily made.
Development Lifecycle
It's easy to get up and running within a few minutes. Here's a high-level explanation of how to get from 0 to in the App Store.
- Create a partner account
- Create a dev shop
- Play around with the API
- Create an app & install it
- Use a supported API adapter or roll your own authentication
- Read up on our tutorials, examples and documentation
- Set up billing
- Beta test with merchants & friends in the Shopify Forums
- Submit your app for publishing in the App Store
- Gear up your marketing/promo engines
- Launch & start taking money
Getting started
To start development, you need a Shopify Partner account. Sign up here and create a free account.
Once you’ve got an account set up, hit the Dev Shops tab and create a dev shop for yourself. Poke around your shop and familiarize yourself with your new store and what it can and can't do. Use this test shop later to test out your app.
Note that you don’t need a paid Shopify account to do any of this.
Play around with the API
After you've got the hang of the Shopify admin, start playing with the Shopify API is to create a private app for your test shop. Visit this URL and create a private app:
https://YOUR-TEST-SHOP.myshopify.com/admin/api
Once you've created a private app, test out a few API calls. Try fetching your test shop's orders by visiting a URL like
http://API-KEY:PASSWORD@YOUR-TEST-SHOP.myshopify.com/admin/orders.xml
An example of what that URL could look like is http://7ea7a2ff231f9f7d4ee696837482e55f:95c5e8091839609c864128d2a8197b9a@iliketurtles.myshopify.com/admin/orders.xml
This private app is locked to your particular test shop and won't work for any other by skipping a few authentication steps.
Console tools
To start interacting with the API without setting up a web app or using curl, check out our guide on using the Shopify console to make API calls via the terminal.
API troubleshooting
If you run into difficulty understanding the API, read through this API troubleshooting guide. If you still have difficulty after troubleshooting, head over to our APIs and Tech forum to get help.
Create an app
Now that you've played around with the API, visit your Partner dashboard's App tab and create an app. Choose OAuth as the Auth Type and set the Application URL to be http://localhost:3000 or whereever you have a web server running that lets you watch its access logs.
Once you've got an API key and your app's shared secret, you're ready to install your app in your test shop.
Installation
Shopify uses OAuth 2.0 as its primary authentication method. Details on how to set this up can be found on in our Authentication Technical Docs.
Use a supported API adapter or roll your own authentication
Shopify has client libraries for several languages that will help you out with API interaction. Take a look at the list below to see what's available.
“I’m a Rails developer”
The easiest and fastest way to get up and running is by using the open source shopify_app generator gem and deploying to Heroku. Check out our tutorial covering how to do it all from scratch. You’ll be ready to sell your application on the App Store in minutes.
Rails Shopify App Examples
We’ve open-sourced PixelPrinter, one of our own apps in the App Store. Check it out in our GitHub account.
Debugging
Running into trouble debugging your app? See our tutorial on using the console in development.
“I’m a Ruby developer”
ShopifyAPI is a official lightweight gem for accessing the Shopify admin REST web services.
See also 3rd parties contributions:
- omniauth-shopify is a strategy for authenticating to Shopify API using OmniAuth.
“I’m a PHP developer”
Grab a copy of Sandeep’s awesome PHP adapter for the Shopify API: https://github.com/sandeepshetty/shopify.php (requires PHP 5.3 and above)
Colin's PHP adapter for the Shopify API: https://github.com/cmcdonaldca/ohShopify.php It's based on Sandeep's version but is object-oriented and works with PHP 4 and above.
It’ll let you skip having to write all the authentication scheme stuff and jump in to playing with the API right away.
Prefer an adapter built on ZendFramework 2? Matt Peterson has put together his own PHP adapter that you can find on GitHub as well: http://github.com/mathewpeterson/PHP-Shopify-API
Or, if you are a CakePHP Developer, you can use the Shopify CakePHP Plugin. Get up and running quickly with this plugin and it uses the same adapter style as Colin's ohShopify PHP Adapter.
“I’m a Python developer”
A Python adapter also exists. Check out Using the shopify python api to understand how everything documented in the API Reference can be done using the Python adaptor.
To use it with the Django web framework, you can start with the Shopify Django App Example, or use it as a reference implementation. The instructions for the project include steps for deploying the application on Google App Engine, in fact you can see the example online. It can still be run as a regular Django application, so feel free to use other hosting options.
“I’m a Node developer”
Check out this Node.js adapter written by Shopfrogs, makers of the Abandon App cart recovery system in the Shopify App Store.
Make sure to also check out the demo app written with this Node.js adapter.
"I'm a Java/Android developer"
A Java adapter also exists. The library handles all the authentication and provides tools to make performing API calls in Java rather simple.
Check out the Products List Demo to get an idea of how to use this library.
"I'm a .NET developer"
Use Colin McDonald's .NET Shopify API. It’s awesome.
“I don't see my language above!”
Don't panic! OAuth 2.0 has supporting client libraries for many more languages. They're not Shopify specific but they'll get you up and running with the authentication side of things so that you can focus on actual API calls.
Do a google search for "OAuth 2.0 [LANGUAGE]" and see what comes up. If you still can't find anything, ask in our forums.
Set up billing
In order to be paid for your service, you need to set up a billing mechanism - just being in the app store does not guarantee payment.
We highly recommend using the Shopify Billing API as it lets merchants skip having to fork over a credit card number and simply adds your charges to their next Shopify invoice. When Shopify is paid, we pay you. Pretty straightforward. Take a look at the Application Billing page for more information.
The Billing API lets you set up recurring charges and/or one-time charges on a per-shop basis, so it's easy to create multiple price plans or tiers, or implement whatever billing model you have in mind.
Read up on a detailed explanation of the billing system here: http://api.shopify.com/billing.html
The two APIs you'll be particularly interested in are:
Your app is free to use other payment systems, but apps that use ours are preferred when it comes to promoting apps in newsletters, blogs, our Twitter account, and other promotions.
Beta test with merchants & friends
When you feel like your app is ready and well tested, it's time to start beta testing.
To make your app available to be tested, create an App Store listing from your partners dashboard. When you're happy with it, click 'Publish Beta App' at the top of the app listing to make it public.
Beta apps only appear in a special category on the app store. You can see it here: Beta Category
We publicize apps in this category through our sales and support channels to merchants who are actively asking for the functionality, but of course merchants are free to visit the app store and discover the apps organically. You can also give out the link to your listing directly.
A couple of words of advice for beta testing:
- Be kind to your beta program participants and set your billing charges to be test=true so that they're not actually charged. If you absolutely can't afford to offer the app for free during beta, try to offer a discount.
- Solicit feedback from testers. Merchants can leave reviews on your app's listing, but you can be pro-active by contacting them directly and asking for comments and suggestions.
- Make sure your app is feature complete. Beta testing should be about finding bugs and taking suggestions for minor changes, not defining the core functionality of your app.
Once you've worked out all the showstopper bugs and your beta users are happy with the user experience, get ready to submit your app to the App Store.
Submit your app for publishing in the App Store
All right! You've come a long way and your app is looking hot to trot.
Prepare for publishing your app in the App Store by running through our list of Do's and Don'ts of publishing your app
Double checking this list will expedite your app's approval through the publishing process. It really boils down to:
- No bugs
- Each screen tells an obvious story that relates to how the shop is going to increase sales or reduce costs: “this is what’s happening”; “you need to do this”
- Any onboarding/account creation process is as automatic as possible. Use the shop.xml call to grab the information you need
- Your app store listing says what the app is and accurately states how much it costs
Again: make sure your app works before submitting it. As soon as the app approval team hits a bug, we have to stop and tell you about it before continuing.
Gear up your marketing/promo engines
Make sure to give apps+promo@shopify.com a shout to let us know that your app is arriving so we can give a shout out to the right channels. We'll help announce your app over @Shopify's Twitter stream, and if it's a good fit, we'll set up a blog post.
Launch & start taking money
Go big with your launch! Make sure you're advertising and posting where merchants are going to notice you. Email each of your installers and ask them what they think - especially those folks who uninstalled the app.
No matter what, make sure you register an app/uninstall webhook to be pinged when this happens. Build a list of those merchants who uninstalled over a week, and reach out to them to find out where your app fell short.
You should also be getting the merchants who have your app installed after 25 days (or whatever makes sense for you) to give your app a review on the app store. Reviews are killer for increasing your install rate. Read more about how to do this in How to get 4 to 5 Stars on the Apple App Store
