State of the API

State of the API: August 29th 2011

 Shall I compare thee to a summer's day? No. I'm going to write about the changes made to…

 Shall I compare thee to a summer's day? No. I'm going to write about the changes made to the Shopify API over the last two weeks.

Updates

  • Shop Domain Names - To better facilitate our new policy of using a shop's myshopify.com domain as its unique identifier, we've added a new member to the Shop object: myshopify_domain. This will be used as the canonical id of the shop, with the existing 'domain' member displaying the primary domain of the shop (which may be custom). Here's how it looks in JSON:
    "domain": "shop.apple.com",
    "myshopify_domain": "apple.myshopify.com"

API Wrappers

Our brilliant dev community have produced two new API wrappers. Rob Conery has put together a .NET library for all you MS fanatics out there while our very own Dylan Smith crafted a new python offering. Both can be found on GitHub using the links below:

Once again as always I encourage everyone to sign up for the official Shopify Developer Google Group, it's a great place for asking questions, getting answers, or even just discussing the API. I'll have more updates for you in a fortnight.

State of the API: August 12th 2011

  Welcome once again to Ye Olde State of the API update. Have a seat at the bar,…

 

Welcome once again to Ye Olde State of the API update. Have a seat at the bar, sample the complimentary peanuts and we'll see what we have on tap for you this week:

Updates

  • Application Charge Fixes: We put some fixes in to better communicate the state of charges to merchants. They can now see whether an app charge is recurring on their admin, and the confirmation email they receive now mentions any free trial information.
  • Scope: Both Webhooks and ScriptTags got a tweak, as we found that they were not correctly scoped. Now apps can only see webhooks and script tags that they created themselves.

Themes

This change is so big it gets its own header!

With the introduction of our new multiple theme support, several follow-up changes have been put into the API. Themes have a new attribute that specifies their role. Right now there are three roles as follows:

  • Main - The main theme that is loaded for the store in non-mobile environments
  • Mobile - The theme that is loaded when Shopify detects that a mobile device is being used
  • Unpublished - A theme that is not currently visible to the public, but is still installed in the shop

Apps can change which theme has the main/mobile role by updating an unpublished theme. This will cause the previous main/mobile theme to become unpublished as appropriate.

To reflect the multiple theme support, Assets are now accessible as a nested resource under their theme, like so:

/admin/themes/#{id}/assets.json

If you have an existing app that accesses assets, don't worry. The old route still works, but now references the main theme.

API Announcements Group

 About a month ago I announced the deprecation of the X-Shopify-Shop-Id header on our Developer Google Group. This led to a fair amount of discussion on the best way to notify all developers that potentially destructive changes are going to be made to the API.

What we decided to do was have a seperate read-only mailing list where important announcements concerning the API will be made. Specifically, this will be the official channel for all updates regarding changes that may break your app. I emphasized that last sentence because it's very important for all app developers to subscribe to this group. I'll be sending a mailer out to all developers soon so that no-one misses this, but in the meantime here's a link to the group:

Go subscribe!


Ok gents, it's last call for this blog post. Drink up, and see yourselves out. I'll be back in a couple of weeks.

State of the API: July 29th 2011

  Everyone's favourite API update column is back for a second round, and it's coming out swinging! Let's…

 

Everyone's favourite API update column is back for a second round, and it's coming out swinging!

Let's see who our contenders are tonight:

  • Customer Deletion - In order to bring customers in line with other objects in the API, you can now delete them. The only caveat is that all orders associated with that customer must be deleted first otherwise you'll get an error.
  • Protocol Relative Script Tags - Previously you had to specify the protocol when creating script tags: Either http or https for the checkout. Now you can skip that part and Shopify will figure out which protocol it needs to insert the script into a page. If you're using our Rails API client, you can do something like this:
    ShopifyAPI::ScriptTag.new(:event => 'onload', :src => '//djavaskripped.org/fancy.js')
  • JSONP support - This is a biggie: You can now specify a callback function on any json resource and the response will be returned as a parameter to the function you specify. What is this good for? Well, JSONP gets around the 'same origin' policy that prevents regular javascript from communicating with other domains. Couple this with the fact that any public Shopify resource (i.e. products) can be fetched as json by appending '.json' to the url and you have the ability to fetch products from shops from third party sites using javascript. One of our rockstar developers is working on an example, but in the meantime you can read all about JSONP on Wikipedia

And that's the bell! Come back in two weeks and I'll have more knock-out updates for you. Until then, sign up for our Developer Google Group if you have any API related questions, comments, or issues. Thanks!

State of the API: July 15th 2011

Here at Shopify we're constantly working on improving our API to make life easier for the developers working…

Here at Shopify we're constantly working on improving our API to make life easier for the developers working with our platform. This is the first of an ongoing series of bi-weekly blog posts designed to arm developers with info on the latest updates so that they can make the best apps possible.

 In no particular order, here are the updates we've made recently:

  • Product Image Reordering - You can now specify which order product images should appear in on product pages. Use the 'position' field when creating or updating an image to move it to that position in the list. Here's an example from our API docs.
  • Additional Order Statuses - The API now supports filtering orders that are 'refunded' or 'voided' using the existing financial_status field.
  • Filter By Published Status - All publishable objects in the API can now be filtered by their published status and date. The new additions include Articles, Pages, Collections (smart and custom), and Products.
  • Shop Domain Headers - We're replacing the X-Shopify-Shop-Id header on our Webhooks in favor of one containing the shop domain. Look for a new header called X-Shopify-Shop-Domain on your webhooks and be aware that the existing ID header will be deprecated as of October 15th.
  • Search By Product Handle - We recently added a new 'handle' filter to our Product API. A product's handle is the url-encoded conversion of the title that appears in the product URL. Using this filter you can fetch products based solely on the URL.
That's all the updates for today. In addition to these summary posts, we'll be tweeting updates as they go live on @shopifyapi and posting them to our Developer Google Group. If you need more info on the API in general, check out our API docs.

Start your free 30 day trial!

Create an online store in minutesTry Shopify