Shopify - A shop in minutes, a business for life.

18
Jun

edward

comments 6

We’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.

12
May

john

comments 0

The 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

13
Apr

Dennis

comments 1

The 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

14
Dec

Caroline

comments 10

We’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:

{{ product.metafields.book.author }}

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:

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'
}))

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.

11
Dec

john

comments 0

The following changes will be made to the API, effective Monday, December 21, 2009 12:00am UTC

  • Deprecation of from Custom Collections
    The read-only field will be removed. This information no longer required, as the information is already contained in the array.

Shopify API documentation:
Custom Collections API

10
Dec

edward

comments 0

Thinking 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

26
Nov

edward

comments 0

The 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

06
Nov

edward

comments 1

Thanks 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:

Screenshot of the Choose an icon link

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:

Link icon set to be a thunderbolt

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

Link icon in use

25
Sep

edward

comments 0

We’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.

21
Sep

john

comments 0

The 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

09
Sep

edward

comments 3

Shopify 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.)
17
Jul

edward

comments 1

After 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 Order and Product.

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=unshipped
We’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.

11
Jun

James

comments 0

Are 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.

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.

02
Jun

Dimitri

comments 12

Shopify is proud to announce the release of the Shopify Platform!

For the occasion of Shopify’s third birthday, we are officially announcing two major releases that will make Shopify better than ever – the Shopify App Store and the Shopify API!

Shopify App Store

The Shopify App Store is another very exciting project that is also released today. It benefits two different groups of people: Shopify storeowners, and Shopify developers.

Shopify storeowners now have the opportunity to add applications to their Shopify store that will allow them to do all sorts of things they have been unable to do before. From custom invoices and sales reports, to pretty much anything else you can imagine! Here’s a sampling of the first few applications that are available:

  • Pixel Printer – an application that makes printing invoices simple
  • PowerReviews App – a full-featured customer reviews application
  • Fetch – easy-to-use application for selling digital goods
  • Mapify – live geolocation of your customers’ purchases
  • BaseSync – tool for syncing a store’s products to Google Base

In order to browse and purchase new apps, you go directly to the App Store, browse for the application that you want, and then simply click Install and presto!

In the near future, application developers will even be able charge for their apps using Shopify’s billing system. This is a big win for users, as any app charges will be included in their regular Shopify bill; and it’s a big win for developers, who won’t have to write custom billing code for their apps.

Check out the App Store right now to see all the great things that are on there, and keep your eyes peeled for the new apps that will be released in the future!

Shopify API

The Shopify API has been in the works for a long time and is finally ready. We’ve worked closely with many pre-launch partners that have made the API very robust and we are proud of the final result. The Shopify API will allow developers to create tools that integrate directly with Shopify, and to create applications which will then be sold or offered for free in the App Store.

The API is documented to make it easy for developers to create new applications to be integrated into the Shopify App Store. Interested in becoming a developer and earning recurring revenues from your apps? Check out our Partners page to sign up!

You can also check out our press release about this here

21
Feb

Tobi

comments 5

Shopify’s latest feature allows you, in addition to receiving email notifications for new orders, also receive WebHooks. WebHooks are a way to tell Shopify to call a script on one of your own web servers and react to the event in any way you want.

Some possible uses for this feature include:
  • Notify your IM client or your pager when you are offline
  • Collect data for data-warehousing
  • Integrate your accounting software
  • Filter the order items and inform various drop shippers about the order
  • Create license keys for software sales

Once you register a webhook url with Shopify we will issue a HTTP Post to the url specified and pass on the Order as an XML document. Don’t worry, if your server is down we will simply try again until your server confirms to us that it has successfully received the notification.

To learn more about Web hooks please visit the WebHook wiki page

browse archives »
Made in Canada

Shopify is being developed in the very heart of Canada's capital Ottawa