Mastroke Blogs

Shopify Functions: What They Are and What You Can Build With Them

Shopify Functions: What They Are and What You Can Build

Quick AI Summary AI Generated

This blog post explains Shopify Functions, which are small pieces of code that control the backend logic of Shopify checkout processes like discounts, payments, and shipping options. The post is particularly relevant for merchants currently using Shopify Scripts, as Scripts will stop working entirely on June 30, 2026, making migration to Functions necessary.

If you’ve ever had a Shopify Plus developer mention Functions and you weren’t totally sure what they meant, you’re not alone. Most merchants have heard the word, maybe seen it in an app listing, and moved on — without knowing whether it actually applies to their store, or whether they’re sitting on something that could fix a problem they’ve had for years.

Here’s the short version: Shopify Functions control the logic running behind your checkout. Which discounts apply, which delivery options show up, which payment methods a customer sees — all of it can be shaped by a Function.

And if your store still runs on Shopify Scripts, this isn’t just useful background reading. Scripts stop working entirely on June 30, 2026.

What you’ll learn: This guide breaks down what Shopify Functions are, how they work, what’s available right now, and what you can realistically build — whether you’re a developer or a merchant figuring out what to ask for.

What Are Shopify Functions, Exactly?

Functions are small pieces of code that plug into specific points of Shopify’s checkout logic. Discount calculations, delivery options, payment method visibility, and cart validation — Functions let developers extend or replace how each of these behaves, without standing up any servers of their own.

That last part matters more than it sounds. You get all this customization without hosting anything, managing infrastructure, or worrying about custom logic falling behind future Shopify platform updates.

Functions run directly on Shopify’s infrastructure, so they stay current automatically and continue working reliably during high-traffic events like flash sales, product launches, and peak shopping periods.

Shopify Functions Checkout Extensions
Control backend logic Control customer-facing UI
Discount calculations Checkout banners
Payment rules Custom fields
Shipping logic Messages and content blocks
Cart validation Visual checkout elements

One thing worth getting straight early: Functions are not a UI tool. They don’t change what a customer sees on screen.

If you want a custom field, loyalty message, trust badge, or promotional banner in checkout, that’s a Checkout Extension — a different tool entirely.

Functions handle what gets calculated, validated, or transformed in the background. Extensions handle what appears visually. The two work together, but they’re not interchangeable. Shopify Functions and Checkout Extensions are both part of Shopify’s Checkout Extensibility framework, which replaces older customization methods such as Shopify Scripts and checkout.liquid. Together, they provide Shopify’s long-term approach to secure and scalable checkout customization.

Key takeaway: Shopify Functions power the business logic behind checkout decisions, while Checkout Extensions control the customer-facing experience. Most advanced Shopify Plus customizations combine both tools to create a seamless checkout journey.

How Shopify Functions Actually Work

Shopify Functions are server-side programs that run directly on Shopify’s infrastructure using WebAssembly (Wasm). Developers write the logic in JavaScript or Rust, compile it into WebAssembly, and Shopify executes it precisely when it’s needed during checkout.

At a basic level, a Function receives input such as cart contents, customer information, or order details, processes that data based on predefined rules, and returns an outcome that Shopify immediately applies.

That outcome could be a discount, a hidden shipping option, a reordered payment method list, or any other checkout behavior your store requires.

Why it matters: Functions run on Shopify’s backend rather than your own servers. That means no external API calls, no separate hosting costs, and virtually no latency caused by requests traveling to third-party infrastructure.

Unlike Shopify Scripts, Functions aren’t pasted directly into your store. They’re distributed as applications. You can either install a Function-powered app from the Shopify App Store or have a developer create a custom app built specifically for your business requirements.

Shopify Functions vs. Shopify Scripts — Why June 30, 2026 Matters

If your store has been running on Shopify Plus for several years, there’s a good chance some of your discount, payment, or shipping customizations are powered by Shopify Scripts.

Scripts have been Shopify Plus merchants’ primary customization tool since 2016. However, Shopify has officially announced that Scripts will stop executing entirely on June 30, 2026. 

The situation becomes even more urgent because, as of April 15, 2026, Scripts can no longer be edited or published. Existing Scripts may continue running until the final deadline, but they’re effectively frozen.

If an existing Script contains a bug, outdated business logic, or undocumented behavior, you can no longer modify it through the Script Editor. Once June 30 arrives, that logic simply stops running.

Feature Shopify Scripts Shopify Functions
Language Ruby JavaScript / Rust (WebAssembly)
Hosted By Shopify Ruby Sandbox Shopify Infrastructure
Plan Availability Shopify Plus Only Apps on all plans, custom apps typically on Plus
Execution Speed Slower, can timeout Sub-5ms performance
Deployment Script Editor Apps via Shopify CLI
Editable After April 15, 2026 No Yes

Key takeaway: If your Shopify Plus store still relies on Scripts, migration is no longer optional. Functions are Shopify’s long-term replacement and the only supported path for checkout logic customization moving forward.

If you want the bigger picture on how checkout customization fits into a Shopify Plus setup overall, Mastroke’s guide on customizing Shopify Plus checkout covers the strategy, limitations, and implementation options in greater depth.

Shopify Functions vs. Shopify Scripts

Who Can Actually Use Shopify Functions?

This is the part that trips up almost everyone, so let’s be precise about it.

Any merchant on any Shopify plan can install a public app from the Shopify App Store that’s powered by Shopify Functions. If an app handles tiered discounts, hides payment methods, or reorders shipping options behind the scenes, it’ll work on your store regardless of whether you’re on Basic, Shopify, Advanced, or Plus.

In those cases, you don’t need Shopify Plus and you don’t need a developer. You simply install the app and configure it.

Shopify Plus becomes important when your business logic is unique. If the functionality you need doesn’t exist in the App Store, a developer can build a custom Function, package it as a custom app, and deploy it specifically for your store.

Before investing in custom development: Check whether a Function-powered app already exists. Many use cases merchants assume require custom coding are already available in the Shopify App Store.

The Five Function APIs Doing Most of the Work Right Now

Shopify offers Function APIs across discounts, payments, delivery, cart validation, and cart transformation. While there are multiple APIs available, these five account for most real-world Shopify Functions implementations today.

1. Discount Function API — One Discount, Multiple Effects

This is currently the most widely used Function API. In API version 2025-04, Shopify combined its previously separate Product, Order, and Shipping Discount APIs into a single unified Discount Function API.

The practical benefit is simple: a single Function can now apply multiple effects. For example, one promotion can reduce the order total and unlock free shipping at the same time.

Shopify currently supports up to 25 discount Functions running simultaneously, with Shopify’s discount combination rules determining how they interact.

Common use cases:

  • Tiered discounts based on cart value
  • BOGO and volume pricing promotions
  • Region-specific discount strategies
  • B2B pricing tied to customer tags
  • Stackable promotional campaigns

2. Delivery Customization API — Controlling Shipping Options

The Delivery Customization API gives merchants control over which shipping methods appear during checkout and how they’re presented to customers.

Businesses frequently use it to hide unavailable delivery methods, reorder shipping options, rename carrier services, or display more relevant delivery choices based on customer and product data.

Common use cases:

  • Hide overnight delivery for PO Box addresses
  • Rename shipping methods to match brand language
  • Prioritize preferred delivery options
  • Restrict shipping methods for hazardous or oversized products

3. Payment Customization API — Showing the Right Payment Methods

The Payment Customization API allows stores to control which payment methods appear based on customer type, order value, location, or other business rules.

This is especially valuable for B2B stores, wholesale operations, and merchants managing higher-risk payment options.

Common use cases:

  • Hide Cash on Delivery above a certain order value
  • Display Net 30 terms only for approved B2B accounts
  • Prioritize preferred payment methods by region
  • Limit specific payment methods based on customer eligibility

For a detailed look at how payment customization works in a Plus environment, read: Shopify Custom Payment Methods on Shopify Plus.

4. Cart and Checkout Validation API — Preventing Invalid Orders

Some orders shouldn’t be allowed to proceed, and catching those issues before checkout completion saves both customers and operations teams significant headaches.

The Cart and Checkout Validation API allows merchants to block checkout when predefined business rules aren’t met.

Common use cases:

  • Enforce wholesale minimum order quantities
  • Prevent incompatible products from being purchased together
  • Require compliance-related products before checkout
  • Validate shipping address formats

5. Cart Transform API — Reshaping the Cart Before Checkout

Unlike validation APIs that block actions, the Cart Transform API actively changes what’s inside the cart before checkout begins.

It can combine multiple products into a single bundle, split bundles into individual items for fulfillment, or restructure cart contents based on business requirements.

Common use cases:

  • Subscription box configuration
  • Product bundle creation
  • Bundle decomposition for fulfillment workflows
  • Complex B2B ordering scenarios

Key takeaway: Most Shopify Functions implementations fall into one of five categories: discounts, shipping, payments, validation, or cart transformation. Understanding which API matches your business requirement is usually the first step toward deciding whether an existing app can solve the problem or whether you need custom development.

5 Things You Can Build With Shopify Functions

Real Use Cases by Store Type

Shopify Functions aren’t just technical features — they’re solutions to real operational problems. The same Function API can be used very differently depending on the type of business, customer journey, and checkout requirements involved.

Store Type Function API Used Business Problem Solved
DTC Brand Discount Function Tiered promotions during peak sales events
B2B Merchant Payment Customization Show Net 30 payment terms only to approved buyers
Subscription Brand Cart Transform Expand bundles into individual SKUs for fulfillment
High-AOV Store Payment Customization Remove high-risk payment gateways above $5,000
Multi-region Store Delivery Customization Display region-specific shipping carriers
Wholesale Store Cart Validation Enforce minimum order values by collection

The Technical Limits Worth Knowing Before You Start

Shopify Functions are extremely fast because Shopify intentionally keeps them tightly constrained. Those limits ensure Functions remain predictable, secure, and capable of running in milliseconds during checkout.

Most merchants will never run into these limits directly, but developers building custom Functions should understand the boundaries before designing complex checkout logic.

Limit Value
Maximum WebAssembly Binary Size 256 KB
Maximum Instruction Count 11 Million
Maximum Input Data Size 128 KB
Maximum Execution Time 5 Milliseconds
Maximum Concurrent Discount Functions 25
External API Calls Not Supported
Function Chaining Not Supported

Need Help Migrating Legacy Checkout Logic?


Whether you’re replacing Shopify Scripts or planning more advanced checkout workflows, our Shopify Plus specialists can audit your setup, identify risks, and build a migration roadmap tailored to your store.
Talk to Shopify Plus Experts

That final limitation catches a lot of developers off guard. Functions operate independently and have no awareness of one another. You can’t pass the output of one Function into another Function as an input.

Instead, each Function runs separately and Shopify’s internal combination rules determine how those outputs interact — particularly when multiple discounts are applied to the same order.

The sandboxed environment creates another important limitation. Functions cannot make real-time calls to external APIs during checkout. Everything they need — customer data, cart contents, metafields, and order information — must already exist inside Shopify.

Key takeaway: Shopify Functions are designed for speed and reliability, not unlimited flexibility. If your checkout logic depends on live external systems or complex multi-step workflows, you’ll likely need middleware or custom development alongside Shopify Functions.

Shopify Functions Technical Limits at a Glance

Should You Install an App, or Build a Custom Function?

Start with the Shopify App Store. If you’re trying to solve a common checkout problem — tiered discounts, payment method sorting, shipping restrictions, or delivery customizations — there’s a strong chance an existing app already does exactly what you need.

For example, a DTC brand might want to hide a specific payment gateway for orders above $5,000 because transaction fees become too expensive. Before investing in custom development, it’s worth spending a few minutes checking whether a Payment Customization app already solves the problem.

If an existing app meets your requirements, installation is almost always faster, less expensive, and easier to maintain than building custom functionality from scratch.

A Custom Function Makes Sense When:

  • Your discount or checkout logic is unique to your business
  • No existing Shopify app replicates the required functionality
  • Your B2B workflows depend on customer tags, company profiles, or order thresholds
  • Your payment or delivery rules rely on internal business data
  • You’re migrating heavily customized Shopify Scripts logic built over several years

If you’re not sure which side of that line your store falls on, it’s worth evaluating existing apps first. Many merchants discover the functionality they need already exists, saving both development time and budget.

What This Means for Your Store Right Now

Shopify Functions are the foundation of checkout customization moving forward. They’re faster, more stable, and available to every merchant through public apps, while still giving Shopify Plus brands the flexibility to build custom checkout logic when their business requires it.

For many merchants, Functions aren’t about adding new capabilities. They’re about preserving the customizations already running inside their stores today.

If your store still relies on Shopify Scripts for discounts, payment rules, shipping logic, or checkout behavior, the date that matters is June 30, 2026.

After that, Scripts stop executing completely. There is no fallback, no automatic migration, and no warning period. Whatever custom logic those Scripts are handling today simply disappears.

The challenge for many Shopify Plus merchants is that Scripts often evolve over years. Discounts get added, shipping rules get adjusted, payment restrictions get layered in, and eventually nobody remembers exactly how everything works together.

That’s why the first step isn’t usually migration. It’s understanding what your current checkout logic is doing today, what depends on it, and what needs to be rebuilt using Shopify Functions before the deadline arrives.

Need Help Migrating from Shopify Scripts?

Mastroke’s Shopify Plus development team can audit your existing Scripts, identify what needs to be migrated, and build the equivalent Shopify Functions before the June 2026 deadline — helping you avoid broken checkout experiences and last-minute migration risks.

Improve Checkout Performance and Conversions


Custom checkout logic only works when it supports conversion goals. We help brands optimize checkout experiences, reduce friction, and turn more shoppers into customers through data-backed improvements.
Explore Shopify Plus CRO

FAQs

1. What’s the difference between Shopify Functions and Checkout Extensions?

Shopify Functions handle backend checkout logic such as discount calculations, shipping rules, payment method visibility, and cart validation. Checkout Extensions control the customer-facing experience, including custom fields, banners, messages, and other visual elements displayed during checkout. Most advanced Shopify Plus checkout customizations use both tools together.

2. Do I need Shopify Plus to use Shopify Functions?

Not necessarily. Any merchant on any Shopify plan can install public Shopify App Store apps powered by Functions. Shopify Plus becomes necessary when you need a custom Function built specifically for your business requirements that cannot be achieved through an existing app.

3. What languages can I use to build Shopify Functions?

Shopify Functions support languages that compile to WebAssembly. In practice, most developers use JavaScript, TypeScript, or Rust. Rust is often preferred for more complex implementations because it produces smaller binaries and performs efficiently within Shopify’s execution limits.

4. Can a Shopify Function call an external API or database during checkout?

No. Shopify Functions operate within a sandboxed environment and cannot access external APIs, databases, or third-party services in real time. Any data required by the Function must already exist within Shopify, such as cart information, customer data, product data, or metafields.

5. Can multiple Shopify Functions share data with each other?

No. Shopify Functions run independently and cannot pass information between one another. Each Function executes separately, and Shopify determines how their outputs interact through built-in combination and stacking rules.

6. What happens to Shopify Scripts on June 30, 2026?

Shopify Scripts will stop executing entirely on June 30,2026. Any discount logic, payment rules, or shipping customizations powered by Scripts will stop working unless they have been migrated to Shopify Functions. Scripts also became uneditable on April 15, 2026.

7. How many Discount Functions can run on a Shopify store at the same time?

Shopify currently allows up to 25 active Discount Functions per store. These Functions run concurrently, and Shopify’s discount combination rules determine how multiple promotions interact on the same order.

Don’t forget to share this post!

Enjoyed reading our blogs?

If you find our content informative & valuable and want to know more about our services.
Connect today!

    EXPLORE OUR BLOGS

    Our Top Blogs

    Shopify Checkout Optimization: 10 Changes That Move the Needle

    — Jun 17, 2026
    Read blog →

    How to Set Up A/B Testing on Shopify: What to Test and How to Read Results?

    — Jun 16, 2026
    Read blog →

    What Is a Shopify Growth Retainer — And What Should It Actually Include?

    — Jun 15, 2026
    Read blog →

    Shopify Checkout Not Working: 9 Causes and How to Fix Each One

    — Jun 12, 2026
    Read blog →

    Shopify Functions: What They Are and What You Can Build

    — Jun 12, 2026
    Read blog →

    How to Read Your Shopify Speed Report (And What to Do with the Data)

    — Jun 11, 2026
    Read blog →

    This will close in 0 seconds

    This will close in 0 seconds

    Shopify Tips

    Your Shopify Store Might Be
    Underperforming

    Get your Store Score and uncover hidden issues affecting conversions, performance, and growth.

      This will close in 0 seconds