Shopify Scripts to Functions Migration: What To Transfer and How

Altin Gjoni

Written by Altin Gjoni

Content Strategist

Shopify Scripts to Functions Migration: What To Transfer and How

June 30, 2026, is the hard cutoff for the Shopify Scripts to Functions migration. After that date, any checkout customization still running on a Script stops working.

Unlike most Shopify platform updates, this one doesn't happen for you. Every Script currently running in your store needs to be found, mapped to a replacement, and tested before the deadline. This guide covers exactly that:

  • How to audit every active Script and understand what it's doing
  • How to map each Script to the right replacement path
  • How to test without breaking your live checkout
  • A downloadable checklist to track sign-off across your team


Shopify Scripts to Functions migration path finder

There are three paths for replacing a Script with a Function: use a native Shopify feature, install an App Store app, or build a custom Function. Which one fits depends on what your Script actually does. Use the tool below to find out.

Shopify Scripts to Functions migration tool


Migration Tool
Find your migration path
Select your Script type or describe what it does — get an instant recommendation.
Native Feature No dev needed
App Store App Install an app
Custom Function Needs a developer
Select a Script type above to see your recommendation.

 

What are Shopify Scripts and Functions?

You might have heard about the transition from Scripts to Functions, but you might not be aware of what they are or what they do.

  • Shopify Scripts is the legacy method that Shopify Plus merchants have used to customize the checkout experience. Written in Ruby inside the Script Editor app, Scripts intercept the checkout process and apply custom logic.
  • Shopify Functions is the replacement framework. Instead of Ruby scripts running inside a Shopify-managed editor, Functions are programs written in JavaScript (or Rust, for performance-critical use cases) that compile to WebAssembly (Wasm) and run on Shopify's infrastructure.

How Shopify Functions works compared to Scripts

In short, Scripts require you to write and manage code directly; Functions wrap that same logic primarily within an app, making it easier to install, update, and hand off without touching code.

For a deeper dive, the table below outlines the main differences between Shopify Scripts and Functions.

Shopify Scripts Shopify Functions
Language Ruby JavaScript or Rust (compiled to Wasm)
Deployment Script Editor App (custom or App Store)
Shopify Plus required? Yes No, available on any plan via apps
Performance Limited, server-side Faster Wasm runtime
API access Minimal Full GraphQL API
Stacks with discounts Poorly Yes, by design
Deadline Deprecated June 30, 2026 The future of Shopify customization

Why migrate from Shopify Scripts to Functions before June 2026?

Beyond being mandatory to keep your store’s customization going, Shopify's Winter '26 Edition introduced several Function-powered capabilities that Scripts could never support.

  • Faster execution and feature parity: Shopify used the deadline extension to close the gap between Scripts and Functions. By June 2026, there should be no meaningful functionality gaps, and Functions will execute faster across the board.
  • Testing from real production data: You can now validate Function logic against actual order data before going live, catching breaking changes before they reach customers.
  • Discount code rejection with custom messages: Functions can reject discount codes at checkout and display a custom error message explaining why, something Scripts could never do.
  • Dynamic payment terms and deposit requirements: Plus merchants can dynamically set payment terms and deposit requirements at checkout — particularly useful for B2B stores on Shopify Plus.
  • Order review rules: Plus merchants define which orders require manual review based on conditions like order value, products, or customer attributes.

These aren't just parity features; merchants who migrated early are already using discount code rejection messages and order review rules in ways Scripts never allowed.

How to migrate from Scripts to Functions


The three Paths you can take to migrate your Shopify Scripts to Functions

Phase 1. Inventory your existing scripts

The first step to migrating from Scripts to Functions is to get a complete picture of what you are replacing. You need to start by understanding how you use scripts now, and the Shopify checkout customizations you are or should apply.

Use the Scripts Customizations report to pull data
Luckily, Shopify launched the AI-powered Scripts Customizations Report in February 2025, which pulls the existing active Scripts, their type, a business logic summary, and a recommended migration path.

At the time of writing, scripts are only available for existing Shopify Plus stores via the Script Editor app and are no longer available for download.

What if the Script editor is not available?

If Script Editor is no longer accessible, you have a few other options

  • Use the Scripts Customizations Report. Head to Admin > Settings > Checkout and scroll down. The report section only appears if your store has active Scripts. If you don't see it, your store either has no Scripts running or they've already been removed.
  • Contact Shopify Plus support - ask them to retrieve your Script metadata if the report is unavailable
  • Audit your checkout manually -test every discount, shipping, and payment condition your store uses and document what fires. Anything that stops working after June 30 was a Script you didn't account for

Tip: Replace 'yourstore' with your store's name and head directly to the link to check if script reports are available: https://admin.shopify.com/store/yourstore/settings/checkout/scripts-report

How Scripts and Functions Interact

Script type Interaction rules
Line Item Scripts
Runs before Functions
- Executes before Shopify Functions, including discounts created by apps.
- Can't access amounts already discounted by Functions or apps.
- Only sees the first discount code applied
- Additional codes are invisible to the Script.
Shipping Scripts
Runs after Functions
- Executes after delivery customizations created by Functions.
- Can't operate on renamed shipping methods, only on methods that are moved or hidden by Functions.
Payment Scripts
Runs after Functions
- Executes after payment customizations created by Functions
- Can't operate on renamed payment methods, only on methods that are moved or hidden by Functions

Table taken from the Shopify Official Guidelines on the transition to Functions. Which Script type runs first matters; running a Script and a Function against the same checkout logic can produce conflicting results.

Phase 2. Recreate your customizations

As our pathfinder tool covered, there are three routines you can take to switch from Scripts to Functions. They are not exclusive, meaning you can use a blend of all of them.

Use a native Shopify feature: For simple logic like a flat percentage discount or a free shipping threshold, Shopify's built-in discount tools cover it with no code and no app required. How much you can do natively depends on your plan. A plus subscription unlocks significantly more than most top-rated apps can replicate, particularly for B2B stores.


If your line item Script applied a discount based on the quantity bought, you can likely replace it with Shopify’s native discount features. Go to Admin >Discounts > Create Discount > Buy X Get Y, set your quantity conditions and discount value, and your Script logic is covered.

The table below, based on the latest Feb 2026 data, shows which native Shopify feature can replace your current checkout logic with Scripts. 

Script Use Case Native Shopify Feature Available On
Flat percentage off all products Discount → Percentage discount All plans
Fixed amount off order Discount → Fixed amount discount All plans
Free shipping over a cart threshold Discount → Free shipping discount All plans
Discount code for specific customers Discount → Customer segment conditions All plans
Buy X Get Y (simple) Discount → Buy X Get Y All plans
Automatic discount at checkout Automatic discounts All plans
Gift cards Gift cards All plans
Custom shipping rates (live carrier) Third-party calculated shipping rates Advanced and above
Tiered pricing/volume discounts Not available natively Needs an app or a function
BOGO with complex conditions Not available natively Needs an app or a function
Hide payment methods by geography Not available natively Needs Function (Plus only)
Custom payment terms/deposits Not available natively Needs Function (Plus only)

Install an App Store app: For moderate or complex logic, such as BOGO, tiered pricing, or bundle discounts, check the App Store first unless you are running a higher Shopify Tier that can handle most of it for you.

There are many checkout customization apps to choose from

Build a custom Function: For logic specific to your store that no existing app covers, you'll need to build a custom Function using Shopify CLI. This is the most flexible path and the one with the steepest setup cost; use it only when the first two options genuinely don't fit. 

A common example: a Script that applies a tiered discount based on a customer metafield (e.g., wholesale tier stored on the customer record).

Building a Custom Function

When you can’t recreate a function using apps or the built-in Shopify features, creating a custom function is the only option left. 

Step 1. Scaffold the app and extension

Run these three commands in order:

bash
shopify app init my-migration-app
cd my-migration-app
shopify app generate extension

When prompted, pick the extension type that matches your Script:

  • Line item Script → select Discount — line item
  • Order-level Script → select Discount — order
  • Shipping Script → select Delivery customization
  • Payment Script → select Payment customization

This creates the folder structure, the run.js entry point where your logic lives, and shopify.extension.toml, which defines the extension's configuration.

Step 2. Define what data your Function can see

Functions only have access to the data you explicitly request. You define that in input.graphql.

First, generate the available schema so you know what you can ask for:


bash

shopify app function typegen

Then open input.graphql and add the fields your logic needs. If your Script read a customer metafield to apply wholesale pricing, your query looks like this:


graphql

query Input {

  cart {

    lines {

      quantity

      merchandise {

        ... on ProductVariant {

          id

          price

        }

      }

    }

    buyerIdentity {

      customer {

        metafield(namespace: "wholesale", key: "tier") {

          value

        }

      }

    }

  }

}

If a field isn't in this query, it won't be available in run.js, it'll return null and your condition won't fire. This is the most common reason a Function deploys successfully but silently does nothing.

Step 3. Write the logic in run.js

This is where you translate your Ruby Script into JavaScript. The structure is the same: read an input, apply a condition, return a result.

Here's a wholesale tier discount, the Function equivalent of a line item Script that read a customer tag and applies a percentage of


bash

shopify app function typegen

javascript
// run.js
export function run(input) {
  const tier = input.cart.buyerIdentity?.customer?.metafield?.value;
  const discountMap = {
    silver: 10,
    gold: 15,
    platinum: 20,
  };
  const percentage = discountMap[tier];
  // No matching tier - return no discount
  if (!percentage) return { discounts: [], discountApplicationStrategy: "FIRST" };
  return {
    discounts: [
      {
        targets: [{ orderSubtotal: { excludedVariantIds: [] } }],
        value: { percentage: { value: percentage } },
        message: `${tier} wholesale discount`,
      },
    ],
    discountApplicationStrategy: "FIRST",
  };
}

The logic is identical to that of the Script. The practical difference: this stacks cleanly with other discounts, runs faster, and doesn't live inside Script Editor, where only Plus merchants can access it.

Step 4. Test locally before deploying

Run your Function against a real order payload before it touches your live store:

bash

shopify app function run

The CLI will prompt you to paste a JSON input. Get this from the Scripts Customizations Report or export a real order from Admin. Confirm the output, the discount amount, the message, the strategy — matches exactly what your Script was producing.

Don't skip this step. A Function that returns the wrong total locally will return the wrong total in production.

Step 5. Deploy and activate


bash
shopify app deploy

Deploying makes the Function available; it doesn't activate it. To activate, go to Admin > Discounts > Create Discount, select your Function from the custom discount dropdown, configure any conditions, and set it live.

If your Function doesn't appear in the dropdown, the app isn't installed on the store. Go to your Partner dashboard, find the app, and install it on the target store first.

Phase 3. Test your migration

As we tested the custom functions above, we need to apply the same logic to all migrations.

Download The Shopify Scripts to Functions Migration Checklist

This checklist will help you make sure you tick off all the boxes. In other words, there is no checkout customization you missed, the testing has been done accordingly, and there are no new features or paths you haven’t considered.

What breaks and how to fix it?

What breaks Most likely cause Where to check
Discount total is wrong Stacking order changed discountApplicationStrategy in run.js
Customer discount doesn't apply Missing field in input query input.graphql, buyerIdentity fields
Shipping methods missing or wrong Script/Function sequencing conflict Script Editor — confirm Scripts disabled
Payment method hidden incorrectly Partial migration, Script still active Script Editor + payment customizations
Function deploys but doesn't fire Not activated in Admin Admin > Discounts > confirm active

Scripts to Functions Rollback Plan

Make sure the old Scripts are initially disabled but not deleted.  Disabled Scripts can be reactivated easily from Admin > Apps > Script Editor


If you are using Shopify Native functions, you can roll back by deactivating them, as the example above shows with discounts.

How to tell when it's time to roll back?

Threshold Action
Checkout error rate Increase of > 0.5% Immediate rollback
Discount not applying Any confirmed case Investigate; rollback if unresolved within 30 minutes
Revenue per session drop > 5% within 2 hours of cutover Escalate; rollback if the cause is not identified
Customer complaints about checkout 3 or more in one hour Investigate; rollback if cause confirmed

Have you started your Shopify scripts migration?

Migrating from Scripts to Functions is a sequence, not a single task, and the order matters. Miss a Script in the inventory, skip an edge case in testing, or go live during an active promotion, and the deadline becomes a problem you didn't have to have.

June 30, 2026, leaves enough time to do this right. A migration started in May doesn't.

If you'd rather have Shero map your Scripts to the right replacement path before you commit to an approach, talk to our team. We've handled this for Plus stores running one Script and stores running a dozen.

F.A.Q.s about Shopify Scripts to Functions Migration

How long does a Shopify Scripts to Functions migration take?

A Shopify Scripts-to-Function Migration depends on how many Scripts you're running and how complex the logic is.

A store with one or two simple discount Scripts can typically complete the migration in a few days. Stores running five or more Scripts with custom conditions. Tiered pricing, B2B payment rules, region-based shipping logic should budget two to four weeks to cover inventory, rebuild, testing, and rollback planning.

Can I migrate from Shopify Scripts to Functions without a developer?

For simple logic, yes you can migrate from Shopify Scripts to Functions without a developer.

If your Scripts handle flat discounts, free shipping thresholds, or basic Buy X Get Y offers, Shopify's native discount tools cover the replacement without touching code.

Where you'll need a developer is for custom Functions, particularly if your Script reads customer metafields, applies conditional B2B pricing, or enforces rules no App Store app replicates.

What happens if I just leave my Scripts running past June 30?

Skipping the Shopify Scripts to Functions migration means your checkout logic stops working entirely with no error or warning to you.

Discounts won't apply, blocked payment methods become available again, and shipping rules stop firing. Depending on what your Scripts handle, the impact on revenue and customer experience can be immediate. There's no grace period, no fallback, and no way to recover those lost orders after the fact.

Can Shopify Scripts and Functions run at the same time?

Yes, but the behavior can change depending on how you rebuild the logic. Discount codes created in Shopify Admin work the same way after migration.

If you're rebuilding a Script that applied discounts conditionally based on customer tags, metafields, or cart contents, you need to validate that the new Function returns the correct discount for every condition your Script handled.

The most common post-migration issue is a Function that deploys successfully but returns no discount because a required field was left out of the input.graphql query.

Will my discount codes in Shopify still work after migrating to Functions?

Yes, Shopify supports running Scripts and Functions in parallel until June 30, 2026, to gives you room to build and test the replacement before cutting over.

The interaction order matters though: Line Item Scripts run before Functions, while Shipping and Payment Scripts run after Functions. This means a Script and a Function targeting the same checkout logic can conflict. The safest approach is to disable each Script as soon as the migration is complete.

Altin Gjoni

Content Strategist

Altin Gjoni is a Content Strategist who creates in-depth, actionable content for Shopify and eCommerce merchants. With a background in digital strategy and hands-on experience across multiple industries, he turns complex eCommerce challenges into clear, practical guides that help brands grow, convert, and compete.