Skip to main content
← Resources
Shopify Plus10 min read

Most Shopify stores get this wrong — and it costs them revenue.

Shopify Functions: Unlock Customization for Your Store

Shopify Functions let you customize discounts, checkout, shipping, and payments with serverless code that runs inside Shopify. Here is when, why, and how to use them.

We typically work with Shopify and Shopify Plus stores doing $500k+ in annual revenue.

BySamuel Noriega
Shopify Functions: Unlock Customization for Your Store

For years, customizing Shopify checkout meant either accepting Shopify's defaults or upgrading to Shopify Plus and editing checkout.liquid. That model is gone. Today the right way to customize Shopify — at any tier, but especially on Plus — is Shopify Functions.

If you run a serious Shopify or Shopify Plus store, this is one of the most important platform shifts of the last five years.

What are Shopify Functions?

Shopify Functions are small, serverless pieces of code you (or your developers) write that Shopify executes at key points in the storefront and checkout flow. They run on Shopify's infrastructure — not yours — which means they are fast, scalable, and don't add a single millisecond of latency to your checkout.

You write a Function in Rust, JavaScript, or TypeScript, compile it to WebAssembly, and deploy it inside a Shopify app. From that point on, Shopify runs your code every time the relevant event happens.

Where Functions can run

Shopify currently exposes Functions in these areas:

Function areaWhat you can customize
DiscountsCustom discount logic (BOGO, tiered, exclusive bundles, hidden codes)
Cart & Checkout ValidationBlock checkout if the cart violates business rules
Cart TransformBundle, expand, or hide line items in the cart
Delivery CustomizationRename, reorder, hide, or sort shipping methods
Payment CustomizationRename, reorder, or hide payment methods
Order RoutingChoose which location fulfills which item
Fulfillment ConstraintsForce items to ship together / separately

Each Function replaces what used to require either a custom checkout build (Plus only) or a third-party app that slowed down the storefront.

Why this matters for Shopify Plus brands

Three concrete wins:

  1. Performance. Functions run inside Shopify's edge — faster than any external app or webhook-based solution.
  2. Maintainability. Logic lives as versioned code in your repo, not in app dashboards or checkout.liquid overrides.
  3. Cost. Replace 4–6 paid apps with a handful of Functions. We've reduced the app stack of clients by 30–50% by migrating to Functions.

A real example: a hidden VIP discount

Suppose you want logged-in VIP customers to automatically get 15% off, with no discount code and without exposing the rule to other shoppers.

Pre-Functions, you'd need a third-party discount app (slow + monthly fee) or custom Plus checkout code (high cost + Plus-only).

With a Discount Function the entire logic is ~40 lines of Rust:

// Pseudocode-ish: real Function uses Shopify's GraphQL input schema
fn run(input: Input) -> Output {
    let is_vip = input.cart
        .buyer_identity
        .customer
        .as_ref()
        .map(|c| c.has_tag("vip"))
        .unwrap_or(false);

    if !is_vip {
        return Output::no_discount();
    }

    Output::percentage_discount(15.0, "VIP 15%")
}

Deploy it once. Every VIP customer automatically gets the discount applied at the cart line level — no code, no app, no checkout.liquid.

Another example: hide express payment for high-AOV carts

Express payment buttons are great for low-AOV carts but a checkout-conversion liability when the cart is $500+ and the customer needs to review shipping carefully.

A Payment Customization Function can hide Apple Pay / Shop Pay when cart.total > $500. ~20 lines of code, no app required.

When to use a Function vs. an app

Use a Function when:

  • The logic depends on cart, customer, or order state.
  • You want to keep checkout fast.
  • You want the logic versioned in code.
  • You'd otherwise need a paid app for a single rule.

Use an app when:

  • You need a UI for non-technical staff to configure rules.
  • The functionality lives outside the cart/checkout flow (e.g. reviews, loyalty UI, post-purchase upsells).

How to build and deploy a Function

The high-level workflow:

  1. Install Shopify CLI (npm install -g @shopify/cli @shopify/app).
  2. Generate an app: shopify app init.
  3. Generate a Function: shopify app generate extension → pick the Function type.
  4. Write your logic in Rust or TypeScript using the auto-generated GraphQL input/output types.
  5. Test locally with shopify app function run.
  6. Deploy: shopify app deploy — Shopify compiles to WASM and ships it.
  7. Activate the Function in your store admin (Discounts → Create discount → choose your Function).

Limits and trade-offs

  • 5 ms execution budget per Function call. Keep logic tight — no external HTTP calls.
  • Maximum 256 KB compiled WASM.
  • No mutable storage inside a Function — they are pure functions of input.

These constraints are what make Functions fast. Heavier logic should run in a normal backend (or a Shopify Flow workflow) and write the result into customer or product metafields, which the Function reads.

Migrating from checkout.liquid and Script Editor

Shopify has officially deprecated checkout.liquid and Script Editor in favor of Functions and the new Checkout Extensibility. If you're on Plus and still relying on either:

  • Audit every customization currently in checkout.liquid or Scripts.
  • Map each one to a Function or Checkout UI Extension.
  • Plan a migration sprint — Shopify is enforcing the deadline.

We've migrated several Plus brands. Done well, the new architecture is faster, cheaper to maintain, and unlocks features Scripts never could.

Final thoughts

Shopify Functions are the new foundation of Shopify customization. Every Plus brand should have a small library of Functions that codify their unique business rules — VIP pricing, B2B logic, fulfillment constraints, regional rules, fraud blocks.

If you'd like our team to audit your current customizations and migrate them to Functions, request a quote — we ship Functions for Shopify Plus brands every week.

Keep reading

Related resources