Shopify Functions

Shopify Functions Explained: Custom Discounts, Shipping and Checkout Rules After Scripts

Shopify Scripts stopped running on June 30, 2026. Here is what Shopify Functions can do instead, which plan you need, and how to decide between an app and a custom build.

If your store relied on Shopify Scripts for tiered discounts, hidden shipping methods or payment rules, those Scripts stopped working on June 30, 2026. Shopify Functions are the replacement, and they also do things Scripts never could. This guide is for founders and ecommerce managers who need to know what Functions can do, what it costs to use them, and how to plan the work.

Key takeaways

  • Shopify Scripts were deprecated on June 30, 2026, and any Scripts still published were deactivated.
  • Functions are small pieces of backend logic that Shopify runs inside its own infrastructure during cart and checkout. They cover discounts, delivery and payment customization, cart validation, bundles, fulfillment and order routing.
  • Any plan can use public App Store apps that contain Functions. Only Plus stores can use custom apps that contain Function APIs.
  • Discount logic now runs through a single Discount Function API. The older Product, Order and Shipping Discount Function APIs were deprecated as of API version 2025-04.
  • Most stores should start with a well-reviewed public app and only build custom Functions for logic no app covers.

What Shopify Functions are

A Function is a small program compiled to WebAssembly. Shopify calls it at a specific point in the buying flow, passes it the cart data it asked for, and applies whatever the Function returns: a discount, a hidden payment method, a validation error.

Because Shopify runs the code on its own infrastructure, Functions are fast and consistent across the online store, Shop Pay and other checkouts. They also have strict limits. According to the Function API reference, for carts up to 200 line items a Function gets 11 million instructions, a 128 kB input and a 20 kB output, with limits scaling for larger carts. Shopify supports any language that compiles to WebAssembly, provides Rust and JavaScript tooling, and strongly recommends Rust to avoid failures on large carts.

As a merchant, you don't need to know any of that. What you need to know is that Functions are configured through an app, and someone has to build or maintain that app.

The Function APIs available today

Shopify's Function API reference lists these APIs:

Function APIWhat it doesTypical use
DiscountCreates product, order and shipping discounts in one FunctionTiered pricing, BOGO, VIP discounts, free shipping rules
Delivery CustomizationRenames, reorders or hides delivery optionsHide express shipping for heavy items or PO boxes
Payment CustomizationRenames, reorders or hides payment methodsHide cash on delivery above a cart value; B2B-only methods
Cart and Checkout ValidationBlocks checkout with an error messageQuantity limits, restricted shipping regions, required fields
Cart TransformExpands or merges cart linesBundles and kits
Fulfillment ConstraintsControls how items are grouped for fulfillmentShip certain products only from certain locations
Order RoutingChooses which location fulfills an orderLocation rules for multi-warehouse brands
Pickup Point and Local Pickup Delivery Option GeneratorsGenerates pickup optionsLockers, pickup points, local pickup

Some pickup-related APIs are linked to unstable docs, which means they may still change.

How Scripts map to Functions

Scripts came in three types. Here is how they translate:

  • Line item scripts (discounts, price changes) → the Discount Function API, or Cart Transform for bundles.
  • Shipping scripts (rename, hide, reorder rates; shipping discounts) → Delivery Customization plus shipping discounts in the Discount API.
  • Payment scripts (hide or reorder gateways) → Payment Customization.

Functions also add capabilities Scripts didn't have, such as cart validation and order routing.

One difference catches teams out: Scripts could rewrite line item prices directly. Functions work through discounts and cart transforms instead, so some old pricing tricks need to be redesigned rather than ported line by line.

Watch out: If you ran Scripts and haven't rebuilt them, your customers have been seeing full prices or unfiltered shipping and payment options since July. Open Script Editor; Shopify's "Replace your Shopify Scripts" banner leads to a customizations report you can export as a CSV.

What's new in 2026

Shopify's Spring '26 Edition added a few useful capabilities:

  • Prerequisites in product discount functions. A field to define which items must be bought before a buy-X-get-Y discount applies.
  • Metaobject data in checkout functions. Rules can read metaobject entries, so merchandisers can change discount or product rules in the admin without a code deploy.
  • Billing address and PO number in Functions. Cart and checkout validation can enforce compliance and B2B rules based on these fields.
  • Order value limits for all plans. A native setting to block checkout below or above set subtotals, which removes the need for a custom validation Function for that simple case.

App or custom build? A decision checklist

Work through these questions in order:

  1. Is it native now? Check Shopify's built-in discounts, order value limits and shipping settings first. Native features have no app fee and no maintenance.
  2. Is there a public app that does it? Many App Store apps package Functions for discounts, shipping rules, payment rules and validation. They work on every plan.
  3. Does the app handle your edge cases? Test with your real catalog: bundles, subscriptions, B2B, multiple markets and stacked discounts.
  4. Is the logic unique to your business? Pricing tied to your ERP data, complex eligibility rules or B2B contract terms usually need a custom build.
  5. Are you on Plus? Custom apps with Functions require Plus. If you're not on Plus and no public app fits, either simplify the rule or factor this into the Plus upgrade decision.

How a custom Function project runs

When a custom build is the right answer, the work usually looks like this:

  1. Write the rules in plain English first. Every condition, every exception, and what the customer should see. Most project delays come from undefined edge cases, not code.
  2. Decide what merchandisers control. Thresholds, product lists and messages should live in metafields, metaobjects or the app's settings, not hardcoded.
  3. Build and test against real carts. Large carts, mixed currencies, B2B buyers, Shop Pay and draft orders.
  4. Plan for API versions. Functions target a specific API version. Shopify releases versions quarterly, and deprecated APIs eventually need migrating. Budget for annual maintenance.
  5. Document the logic. Write down what each Function does and who owns it, alongside your checkout extensions. The checkout extensibility guide covers how those pieces fit together.

FAQ

Do Shopify Scripts still work?

No. Shopify deprecated Scripts on June 30, 2026, and any Scripts still published were deactivated. Their logic must be recreated with Functions or apps.

Can I use Shopify Functions without Shopify Plus?

Yes, through public apps from the Shopify App Store, which work on any plan. Custom apps containing Function APIs require Plus.

Do I need to know Rust to build a Function?

A developer can use any language that compiles to WebAssembly. Shopify provides Rust and JavaScript tooling and recommends Rust for performance on large carts.

Can Functions change product prices directly?

Not the way Scripts did. Functions apply price changes through discounts or cart transforms, so some pricing logic needs a different design.

What happens to apps built on the old discount APIs?

The Product, Order and Shipping Discount Function APIs are deprecated in favor of the unified Discount Function API. Shopify's changelog said apps needed to move to the new API before API version 2026-04, so if you depend on a custom app built on the old APIs, check with your developer that it has been migrated.

Next steps

List every rule your checkout needs to enforce, mark which ones are already native, and test public apps for the rest before commissioning custom work. If you're on Plus with logic no app covers, write the rules in plain English and scope a custom Function from there. If you want help deciding or planning the build, book a Shopify consultation.

Sources

Keep reading