Definition
Shopify Functions are small programs, compiled to WebAssembly, that Shopify runs inside its own backend to change checkout logic. They power custom discounts, bundles, delivery and payment rules and cart validation. Functions ship inside apps: public apps with functions work on any plan, while custom apps with functions need Shopify Plus.
How Shopify Functions work
Shopify Functions let developers change the backend logic of Shopify: how discounts are calculated, which delivery and payment options a customer sees, whether a cart may proceed to checkout. A function is never called by URL. Shopify runs it at a fixed point in the customer journey, for example when a product is added to the cart, and uses the result.[1]
Every function has three parts:[1]
- Input: a GraphQL input query you write. It selects the data the function needs, such as cart lines, product data or metafields, and Shopify passes the result in as JSON.
- Logic: code compiled to WebAssembly. Any language that compiles to a valid module works, and Shopify provides templates for Rust and JavaScript. Shopify strongly recommends Rust, because it is the fastest choice and avoids failures on large carts.
- Output: a JSON document listing the operations Shopify should carry out, such as "hide this payment method" or "take 10% off this line".
Functions ship inside an app. A developer builds and deploys the app, the merchant installs it and configures the function in the admin, and Shopify executes it.[1] Because the code runs on Shopify's infrastructure, not on your server, it is fast and has hard limits. The compiled binary may be at most 256 KiB, the function may use 10 MiB of memory, and on carts of up to 200 lines it gets 11 million instructions, 128 kB of input and 40 kB of output. The input query itself may be at most 3,000 bytes.[2] Network calls are not part of the normal model: the fetch target that allows them is limited to custom apps on Shopify's enterprise stores.[2]
Function APIs: discounts, cart transform, delivery and payment customization, validation
Each Function API covers one step of the checkout. Shopify lists nine: Cart Transform, Discount, Fulfillment Constraints, Order Routing, Pickup Point Delivery Option Generator, Local Pickup Delivery Option Generator, Delivery Customization, Payment Customization and Cart and Checkout Validation.[2] These are the five that most stores meet:
| Function API | What it does | Limit per store |
|---|---|---|
| Discount | Applies savings in three classes: product, order and shipping. One function can, for example, cut both the order total and the delivery cost.[3] | 25 active discount functions[3] |
| Cart Transform | Expands one cart line into its bundle components, merges several lines into one bundle, or updates a line's price, title or image.[4] | One cart transform function per app[4] |
| Delivery Customization | Renames, sorts and hides the delivery options shown at checkout.[5] | 25 active functions[5] |
| Payment Customization | Renames, reorders and hides payment methods at checkout.[6] | 25 active functions[6] |
| Cart and Checkout Validation | Blocks the order with your own error message when it does not meet your rules. Errors show in the cart and in checkout.[7] | 25 active functions[7] |
Discount functions are how you build discount types Shopify does not offer out of the box, such as tiered pricing for a customer tag or "buy two from this collection, get free shipping". Cart Transform is the API behind most bundle apps: the shopper sees one bundle line, while inventory is tracked on the individual products. Delivery and payment customization hide or rename options based on the cart, the address or the customer, for example hiding express shipping for heavy items. Validation has its own walkthrough in our post on custom checkout validation with Shopify Functions.
Which plans can use Shopify Functions
The rule depends on the kind of app, not only on the plan:[1]
| App type | Basic, Grow, Advanced | Shopify Plus |
|---|---|---|
| Public app from the Shopify App Store that contains functions | Yes | Yes |
| Custom app built only for your store that contains functions | No | Yes |
Some operations are Plus only even inside a public app. In Payment Customization, setting payment terms and hiding specific placements require Plus.[6] In Cart Transform, the update operation that overrides a line's price, title or image works only on Plus and development stores.[4] So a store on Grow can install a bundle app or a payment-rules app, but it cannot commission its own function. That is one of the clearest reasons stores move to Plus.
Example: hiding cash on delivery above 30,000 dinars
Take a hypothetical Serbian store on the Grow plan that offers card payments through CorvusPay, bank transfer and cash on delivery. Couriers cap cash collections, and refused parcels on large orders are expensive, so the owner wants cash on delivery to disappear when the cart passes 30,000 RSD.
- Input query: the cart total and the list of payment methods.
- Logic: if the total is above 30,000 RSD, find the method named "Pouzeće".
- Output: one hide operation for that method.
On Grow the store cannot run its own custom app with this function, so it installs a public payment-rules app that contains a payment customization function and sets the 30,000 RSD rule in that app's settings.[1] The function counts as 1 of the 25 payment customizations the store may activate.[6] On Plus, the same logic could live in a custom app the store owns, together with other rules such as hiding bank transfer for first-time customers.
Shopify Functions vs Shopify Scripts
Scripts were the older, Plus-only way to customise checkout logic, written in Ruby in the Script Editor app. Shopify retired Scripts and the Script Editor on June 30, 2026, and scripts no longer run on any store. For discounts, delivery options and payment methods, Shopify now points merchants to apps that provide functions.[8]
| Shopify Scripts | Shopify Functions | |
|---|---|---|
| Status | Retired June 30, 2026[8] | Current |
| Language | Ruby in the Script Editor | Any language that compiles to WebAssembly, Rust recommended[1] |
| Who can use it | Plus stores | Any plan through public apps; custom apps on Plus[1] |
| Delivered as | Code pasted into one app | An extension inside an app, configured in the admin |
FAQ
Are Shopify Functions only for Shopify Plus?
No. Stores on any plan can use public App Store apps that contain functions. Only custom apps with functions, built for a single store, require Shopify Plus, and a few operations, such as payment terms, are Plus only.[1]
What language are Shopify Functions written in?
Any language that compiles to WebAssembly. Shopify provides templates for Rust and JavaScript and strongly recommends Rust for performance, especially on large carts.[1]
Can a Shopify Function call an external API?
Normally no. The fetch target that allows network access is limited to custom apps on Shopify's enterprise stores. Everyone else passes data in through the input query, usually from metafields.[2]
What replaced Shopify Scripts?
Shopify Functions. Scripts and the Script Editor app were retired on June 30, 2026, and Shopify recommends apps that provide functions for discounts, delivery options and payment methods.[8]
How many functions can a store run?
It depends on the API. A store can activate up to 25 discount, 25 delivery customization, 25 payment customization and 25 validation functions, and one cart transform function per app.[3][5][6][7][4]
The bottom line
Shopify Functions are small WebAssembly programs that Shopify runs inside its own checkout to change discounts, bundles, delivery and payment options and validation rules. Any store can use them through public apps, while your own custom functions need Shopify Plus. They replaced Shopify Scripts, which stopped running on June 30, 2026. If you need logic no app offers, our checkout customization team builds and tests custom functions.
Article sources
We use primary sources only: official documentation, product pages and laws. Each link was checked on the date shown.
- Shopify Dev. Shopify Functions. Accessed 17th Nov 2026.
- Shopify Dev. Function APIs. Accessed 17th Nov 2026.
- Shopify Dev. Discount Function API. Accessed 17th Nov 2026.
- Shopify Dev. Cart Transform Function API. Accessed 17th Nov 2026.
- Shopify Dev. Delivery Customization Function API. Accessed 17th Nov 2026.
- Shopify Dev. Payment Customization Function API. Accessed 17th Nov 2026.
- Shopify Dev. Cart and Checkout Validation Function API. Accessed 17th Nov 2026.
- Shopify Help Center. Shopify Scripts and the Script Editor app. Accessed 17th Nov 2026.
Need this on your store?
See the serviceThe checklist we run before touching a client's code
Get it by email, plus a few short notes over the next two weeks: what we see most often on Shopify stores and what actually fixes it.