Shopify Functions: The New Way to Extend and Customize Shopify

Shopify Functions - hero image

At Shopify, we’ve been powering commerce for over 16 years by building the features and functionality that the majority of merchants need. To truly make commerce better for everyone, we realized we needed to put the power of Shopify in the hands of our community. With that in mind, we’ve spent a great deal of time and effort thinking about how we could open up more of the backend logic behind our platform to make it more flexible for merchants.

That’s why we built Shopify Functions, a powerful new way to extend and customize Shopify features to meet the unique business needs of all Shopify brands. With Functions, developers can build powerful customizations that execute in under 5ms, and can scale up for the biggest sales events on the planet.

Since Functions are installed with an app, merchants can configure them directly in the admin, without having to touch a line of code. Although Functions are starting off with familiar backend customizations for discounts, shipping, and payment methods, our goal is to add support for shipping rates, checkout and cart validations, return validations, and order routing in the near future.

How do Shopify Functions work?

So exactly how do Shopify Functions work? Essentially, we’re unlocking the backend of Shopify to allow developers to extend or replace key parts of Shopify’s backend logic with custom code. This unique Functions architecture provides the flexibility of open source, without the hassle of hosting, security, and management of forked code. Also, since Functions run on Shopify infrastructure, they’ll stay on the upgrade path with everything else on Shopify, and be able to perform any critical tasks—even during internet-breaking flash sales. 

For developers, you can write a Function in any language that compiles to WebAssembly, and then build a UI with AppBridge and React. Developers can write a Function in their own local environment and leverage the Shopify CLI to deploy it. When the Function is complete, it’s distributed in an app, so there’s no need to copy and paste code from store-to-store. 

For merchants, you simply need to install an app and the Function will be configurable in-context in the Shopify Admin. This means that discounts, shipping, and payment method Functions will show up alongside the out-of-the-box Shopify settings. 

Why did we create Shopify Functions? 

We know how important it is to build powerful promotions and to offer unique buying experiences that help your brand stand out from the crowd. That’s why we introduced Shopify Scripts back in 2016—to help brands build the micro-customizations that they needed to boost conversions in the checkout. To this day, brands that leverage Shopify Scripts see their average order value increase by 20%. 

Functions are easier to use

With Functions, you don’t need to worry about modifying code to adjust your promotions anymore. Instead, Functions are installed like any other app and they’re configured directly in the Admin, alongside built-in Shopify features. 

Take discounts for example. With Discount Combinations, you’ll be able to create powerful promotions by combining custom discounts—built with Functions—with Shopify’s out-of-the-box product, order, and shipping discounts. For example, you could combine a custom spend $X get $Y volume discount—installed from an app—with the built-in free shipping discount in the discount settings. 

But that’s not all, any discount built with Functions will show up in Shopify Analytics sales reporting, including the Sales by Discount report. Meaning, you’ll have a single source of truth that you can use to review all your discounts. 

Shopify Functions are more accessible

Another great thing about Functions is that they’re distributed in apps, making them available for purchase in the Shopify App Store. So even if you don’t work with a development team or agency, you can still gain access to the unique Shopify customization that your business needs. 

Shopify Plus-exclusive features

Saving the best for last, Shopify Plus brands get the exclusive ability to write their own Functions and distribute them to their store in a custom app. So, if a specific discount, shipping, or payment use case isn’t yet available in the Shopify App Store, or if the use case is too niche or advanced for the general public, Shopify Plus brands can simply build the functionality that they need themselves. 

For example, if a Shopify Plus appliance store wanted to run a spend $500 get $100 off promotion on a specific appliance brand and also run a spend $500 get $50 off promotion on a different appliance brand, they could build their own custom Function. By building their own Function, the furniture store can control the information that’s accessible for product discounts—in this case, the brand name data stored in a metafield.

Stay tuned for more customization options! 

Shopify Functions will give you the power and flexibility to build things that we haven’t even anticipated—and this is just the beginning. In the future, more of Shopify’s built-in logic will be extensible through Functions. 

If you’re ready to start building your own Shopify Function customization, be sure to check out our developer documentation today. Otherwise, you can start keeping an eye on the Shopify App Store for discount, shipping, and payment apps, and download the unique functionality that your business needs.

About the author

Warren Pamukoff

Warren is a product marketing lead at Shopify. He’s passionate about helping brands manage complexity and integrate their systems to sell more, everywhere.