Shopify Checkout Functions Explained: How Apps Work

Shopify Checkout Functions are the server-side engine behind modern checkout apps. See what they can change, their real limits, and how to use them free.

Kedra Team
Shopify Checkout Functions Explained: How Apps Work

Shopify Functions are small server-side programs that run inside Shopify’s own checkout and change how it behaves — hiding a payment method, blocking an invalid address, reordering shipping options. They compile to WebAssembly, execute on Shopify’s infrastructure in milliseconds, and are the mechanism every modern checkout app uses instead of editing checkout.liquid.

That shift is not optional anymore. Shopify sunset checkout.liquid and additional scripts for the Thank you and Order status pages on August 28, 2025, and script tags on those pages are sunset for non-Plus stores on August 26, 2026 (Shopify.dev). If a checkout customization still depends on the old model, it stops working — Functions are what replaced it.

Developer reviewing server-side checkout code on a laptop screen

On this page

What are Shopify Checkout Functions?

A Shopify Function is merchant-configurable backend code that Shopify runs at a defined point in the cart and checkout flow, replacing Shopify’s default logic with yours. Shopify’s developer documentation describes them as a way to “customize the backend logic of Shopify” by injecting code into backend processes through configurable targets.

Three properties matter to a merchant:

  • They run server-side. A Function executes inside Shopify’s infrastructure, not in the shopper’s browser. A customer cannot bypass it with developer tools, an ad blocker, or a slow connection.
  • They are configurable, not hard-coded. A developer publishes the Function once; the merchant supplies the conditions through the app’s settings. That separation is why a no-code app can offer genuinely custom checkout logic.
  • They compile to WebAssembly. Functions are written in Rust or JavaScript and compiled to a WASM module that Shopify executes with strict resource budgets — which is how Shopify keeps checkout fast while running third-party code in it.

The practical result: rules like “hide cash on delivery for orders over $500” or “block PO box addresses on fragile items” are enforced by Shopify itself, at the moment of checkout, with no theme edit and no JavaScript in your storefront. Kedra Checkout Rules is one of the apps built on exactly this framework.

Why Shopify replaced checkout.liquid and Scripts

The old way of customizing checkout was to edit checkout.liquid (a Plus-only theme file) or write Ruby in Shopify Scripts. Both approaches let arbitrary code run inside the most revenue-critical page on the internet, and both broke on every checkout update.

Checkout extensibility replaced them with three sanctioned surfaces: Checkout UI extensions (visual components), Shopify Functions (backend logic), and the Branding API (styling). Each is versioned, sandboxed, and upgrade-safe, so a checkout release does not silently break your customization.

The migration deadlines are concrete, and they are the reason this topic is urgent rather than academic:

ChangePlus storesNon-Plus stores
checkout.liquid + additional scripts on Thank you / Order status pagesSunset August 28, 2025Sunset August 28, 2025
Script tags on Thank you / Order status pagesSunset August 28, 2025Sunset August 26, 2026
Shopify Scripts (Ruby)Retired June 30, 2026Not available

Sources: Shopify.dev checkout.liquid reference and Shopify.dev: migrating from Shopify Scripts to Shopify Functions. Scripts became uneditable on April 15, 2026 and were sunset entirely on June 30, 2026 — any still-published Script has been deactivated.

If you are still running Ruby Scripts, our walkthrough on migrating Shopify Scripts to a checkout rules app maps each old script pattern to its Function equivalent.

Not sure what your checkout currently depends on? Open Shopify admin → Settings → Checkout and look for any legacy customization warning banner. Anything flagged there needs a Functions-based replacement.

Which Function APIs exist, and what does each one control?

Shopify does not expose one generic “checkout function.” It exposes a set of narrowly scoped Function APIs, each attached to a specific decision point. As of API version 2026-07, the checkout-relevant ones execute in this order (Shopify.dev Function APIs):

  1. Cart Transform — merges, expands, or updates cart line items (bundles, component pricing).
  2. Discount — applies custom cart-line and order-level discounts.
  3. Fulfillment Constraints & Order Routing — groups line items and picks fulfillment locations.
  4. Delivery Options — hides, renames, and reorders shipping methods; also covers local pickup and pickup points.
  5. Delivery Discounts — applies shipping discounts.
  6. Payment Customization — hides, renames, and reorders payment methods; sets payment terms; adds review requirements.
  7. Cart and Checkout Validation — blocks checkout completion when the cart or entered data fails your conditions.

For merchants doing checkout customization rather than merchandising, the last three are the ones that matter. The Payment Customization Function API lets you “rename, reorder, hide the payment methods available to customers during checkout” including credit cards, gift cards, and wallets such as Shop Pay, Apple Pay, and Google Pay (Shopify.dev Payment Customization API).

Order of execution is not trivia. A Delivery Options Function runs before a Payment Customization Function, so a payment rule can react to which shipping method survived — but not the other way around. Rule conflicts almost always trace back to this sequence.

How does a Checkout Function actually run?

Each Function follows the same four-step contract every time a shopper touches checkout.

Step 1 — Input query. The Function declares a GraphQL query for exactly the data it needs: cart total, line items, product and customer tags, delivery address, buyer identity, and app metafields holding your configured rules. The query itself is capped at 3,000 bytes and a cost of 30.

Step 2 — Execution. Shopify runs the compiled WebAssembly module with the query result as input. There is no network access — a Function cannot call an external API mid-checkout. Everything it needs must be in the input.

Step 3 — Output operations. The Function returns a list of operations, not a rendered page: hide, rename, move, or a validation error tied to a specific field. Shopify applies them to the checkout it is about to render.

Step 4 — Checkout renders. The shopper sees the filtered payment list, the renamed shipping method, or the inline error blocking the “Pay now” button.

Two consequences follow directly from this design. First, Functions are stateless and fast — they run in the low-millisecond range during cart and checkout because Shopify’s budget forces them to be. Second, they can only do what the API exposes. A Function cannot add a custom field to checkout (that is a Checkout UI extension), cannot look up an external fraud score in real time, and cannot change an order after it is placed.

Shopper completing a mobile checkout with filtered payment options

What are the real limits of Shopify Functions?

Shopify publishes hard resource budgets, and knowing them explains most of the odd behaviour merchants report with very large carts.

ResourceLimit
Execution instruction count (carts up to 200 line items)11 million instructions
Compiled binary size256 kB
Runtime linear memory10,000 kB
Runtime stack memory512 kB
Function input128 kB
Function output20 kB
Input query size / cost3,000 bytes / cost 30
Active payment customizations per store25

Source: Shopify.dev Function APIs reference and the Payment Customization API.

The instruction budget is the one that bites. Shopify’s own documentation “strongly recommends Rust as the most performant language choice to avoid your function failing with large carts” — because a JavaScript Function burns through the 11-million-instruction budget far sooner than a Rust one on the same logic. If a checkout app misbehaves only on 40-line wholesale carts, an instruction-limit failure in a JavaScript Function is the first thing to suspect.

Other limits worth knowing before you plan a customization:

  • No external calls. Real-time third-party lookups during checkout are impossible inside a Function.
  • Surface gaps. Payment customizations do not apply on the cart page, the Create Order API, POS, or the Storefront API.
  • Payment terms and B2B review requirements are Plus-only, even though hide, rename, and reorder are not.
  • 25 active payment customizations per store is generous but finite — consolidate conditions into fewer, smarter rules rather than one Function per edge case.

Do I need Shopify Plus to use Checkout Functions?

No. This is the single most common misconception, and it costs merchants thousands of dollars a year in unnecessary upgrades.

Shopify’s plan rule is about who authors the Function, not who benefits from it. Any store on any plan can install a public app from the Shopify App Store that contains Functions and use its logic at checkout. Shopify Plus is required only to install a custom app containing Function APIs — that is, code you commissioned yourself (Shopify.dev Functions overview).

So the decision is straightforward:

  • You want conditional payment, shipping, and validation rules → install a public checkout app. Any plan. No developer.
  • You need bespoke logic no public app offers (proprietary pricing engine, unusual bundling) → you need Plus plus a developer.

For the vast majority of stores, the first path covers the requirement completely. We broke the economics down in detail in Shopify Plus checkout customization vs third-party apps.

How Kedra Checkout Rules turns Functions into settings

The value a checkout app adds is not the Function itself — it is the configuration layer on top of it. Writing a Payment Customization Function means a Rust or JavaScript project, a GraphQL input query, metafield storage for your rules, an admin UI, deployment through the Shopify CLI, and re-deployment every time a threshold changes. Kedra Checkout Rules ships that whole stack so a rule change is a form field, not a release.

Here is what maps to which Function API in practice:

What you want at checkoutFunction API behind itIn Kedra Checkout Rules
Hide COD for international ordersPayment CustomizationPayment rule: IF shipping country ≠ home country THEN hide COD
Show credit card first on high-value cartsPayment Customization (reorder)Payment rule with cart-total condition
Rename “Standard Shipping (5-7 days)” to something humanDelivery OptionsShipping rule: rename method
Hide express shipping for oversized itemsDelivery OptionsShipping rule with product-tag condition
Block PO box addressesCart and Checkout ValidationValidation rule on the shipping address
Enforce a per-customer quantity capCart and Checkout ValidationValidation rule on line quantity

A concrete setup, end to end:

  1. Install the app and open Rules → Create rule.
  2. Pick the rule type — Validate, Hide, Rename, or Reorder — for payment or delivery.
  3. Build the condition with AND/OR logic: cart total > 500 AND shipping country = US AND customer tag ≠ wholesale.
  4. Choose the action: hide Cash on Delivery, or return the error message the shopper sees.
  5. Save. Shopify picks the change up on the next checkout — no theme deploy, no CLI, no version bump.

Then test it properly. Because Functions run server-side, a rule either fires or it doesn’t — there is no partial state to debug from the browser. Place real test orders across your edge cases using our checkout rules QA checklist before trusting a rule in production, and keep the payment-method-by-location patterns handy if you sell internationally.

Install Kedra Checkout Rules free — it runs on Shopify Functions, works on every Shopify plan including Basic, and costs nothing.

Frequently asked questions

Are Shopify Functions available on all Shopify plans?

Yes, through public apps. Any store on any plan can install a Shopify App Store app that contains Functions and use its checkout logic. Shopify Plus is required only for installing custom apps that contain Function APIs — code built specifically for your store rather than distributed publicly.

Do Shopify Functions slow down checkout?

No meaningfully. Functions compile to WebAssembly and execute server-side within a strict budget of 11 million instructions for carts up to 200 line items, running in the low-millisecond range. They replace browser-side scripts, so they actually remove JavaScript weight from the shopper’s device rather than adding it.

What is the difference between Shopify Functions and Checkout UI extensions?

Functions change checkout logic — which payment methods appear, whether an order may complete, how shipping options are ordered. Checkout UI extensions change what the shopper sees and interacts with — custom fields, banners, upsell blocks. Most checkout apps use both; rules apps like Kedra Checkout Rules rely primarily on Functions.

Can a Shopify Function call an external API during checkout?

No. Functions run with no network access. Everything a Function evaluates must arrive through its GraphQL input query — cart contents, customer and product tags, address, and the merchant’s saved configuration stored in metafields. Real-time third-party lookups mid-checkout are not possible inside a Function.

What happened to Shopify Scripts?

Shopify Scripts, the Plus-only Ruby system for discount, shipping, and payment logic, ran alongside checkout extensibility until June 30, 2026. Its capabilities moved to the Discount, Delivery Options, and Payment Customization Function APIs, which are available to every plan through public apps rather than Plus alone.

Why did my checkout rule not apply to an order?

Check three things in order: whether the surface is supported (payment customizations do not apply on the cart page, POS, draft orders, or the Storefront API), whether an earlier Function in the sequence changed the input your rule depends on, and whether a very large cart pushed the Function past its instruction limit.

The bottom line

Shopify Checkout Functions are the sanctioned, server-side replacement for checkout.liquid and Shopify Scripts — versioned, sandboxed WebAssembly modules that Shopify runs at defined points in cart and checkout. They control payment methods, delivery options, and checkout validation, within published limits of 11 million instructions and a 256 kB binary.

The merchant takeaway is simple: you do not need Shopify Plus, and you do not need a developer. Installing a public app built on Functions gives you the same server-side enforcement Plus merchants get from custom code, configured through a form instead of a deploy pipeline.

Install Kedra Checkout Rules free and build your first Functions-powered rule — hide, rename, reorder, or validate — in the next ten minutes.

K

Kedra Team

Expert insights on Shopify development and e-commerce growth strategies.