State of the API: August 12th 2011

David Underwood

 

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.