Shopify Functions for discounts, shipping and payments
Shopify Scripts stopped executing on 30 June 2026, and did so without throwing an error. Functions are what replaced them, and they are a genuinely different animal: compiled to WebAssembly, run by Shopify inside the checkout rather than alongside it, and subject to constraints Scripts never had. A Script does not port across. It gets rewritten.
Rules that cannot be bypassed
Functions execute on Shopify infrastructure as part of order processing. A customer cannot circumvent one by editing a request, because it never ran in their browser to begin with.
No network hop in the hot path
The logic runs where the checkout runs. There is no call out to your server mid-checkout, which is what made third-party discount logic fragile whenever that server had a bad day.
Deployable and reversible
Functions ship through the Shopify CLI as part of an app, with versions you can roll back. Pricing logic stops being something only one person knows how to change.
What a Function can decide
Discounts are the biggest category: tiered trade pricing, volume breaks, bundles, customer-group rates, "cheapest item free" mechanics, and combinations of those that the discount UI cannot express on its own. Product, order and shipping discounts each have their own API and can be combined.
Delivery customisation reorders, renames or hides shipping methods based on the cart: hiding express for oversized items, surfacing a local option for particular postcodes, renaming a rate to something a customer will actually understand.
Payment customisation does the same for payment methods: hiding cash on delivery above a value threshold, reordering by likelihood of success, restricting a method to a customer group.
Cart transform changes the line items themselves: expanding a bundle into components, merging duplicates, applying per-item pricing that would otherwise need a separate product for every permutation.
Rust, JavaScript, and why it matters
Functions compile to WebAssembly. Rust is Shopify's recommended language; JavaScript is supported through the Javy toolchain. Both work, and for straightforward logic the choice is largely about who maintains it afterwards.
It stops being a free choice as the logic grows. Functions run under an instruction limit, and a JavaScript Function carries the Javy runtime as overhead before your code executes at all, so it reaches that ceiling on less logic than the equivalent Rust. Shopify documents that the limit exists but does not publish a figure, so the honest answer is that complex pricing gets written in Rust and simple rules can go either way.
Where the choice is genuinely marginal I will say so and let you pick on maintenance grounds. Where it is not, I will explain why, and the reasoning goes in the handover rather than staying in my head.
Migrating off Scripts
Two dates matter, and most coverage only mentions the second. Editing and publishing Scripts became impossible on 15 April 2026, freezing every Script in production as it stood. Execution ceased entirely on 30 June 2026.
The April date is the one that catches teams out: for those ten weeks Scripts still ran but could not be fixed, so some were deleted rather than left broken. In order history, a deletion in May and the June shutdown look identical.
A migration therefore starts with an audit rather than a rewrite: what the Scripts did, what has been silently absent since, and what the order data shows across the cutover. Only then is there a specification worth writing Functions against.
Is this the right engagement?
A good fit
- Stores that ran Shopify Scripts and have not fully replaced them
- B2B or wholesale pricing that the native discount UI cannot express
- Shipping or payment method rules that depend on cart contents
- Bundles and per-item pricing currently faked with duplicate products
Not a fit
- Discounts the native discount engine already handles well
- Pricing logic that must call an external system in real time during checkout
- Post-purchase workflows, which are app or Flow territory
Common questions
Are Shopify Functions Plus-only?
No. Functions are available beyond Plus, which is one of the real differences from Scripts. Some specific APIs and higher limits are Plus-gated, so the scoping conversation includes which plan you are on.
Can a Function call my ERP or pricing service?
Not during execution. Functions run in a sandbox without network access, that is why they are fast and cannot fail on someone else's outage. External data has to be synced into Shopify beforehand, usually as metafields, which is a custom app job rather than a Function one.
How do I know my old Scripts are actually replaced?
By comparing order data either side of the cutover, not by reading code. Average discount per order, trade-segment orders, shipping and payment method distribution, a step change on 1 July is a Script that died. The diagnostic is written up in full in the article linked below.
Start with the diagnosis
Send me your store and I will record a 20-minute walkthrough of what I would change and why. No call required, and nothing to unsubscribe from afterwards.