Shopify Functions tutorial for 2027, episode 1 of the Shopify Functions 2027 series (API version 2027-01). What Shopify Functions are, where each of the 9 Function APIs runs in the checkout, the real limits (shown from a real Function run on our development store), which Shopify plans can use them, and the tools we use in this series.
Chapters
- 0:00 Intro: a real Function in the cart
- 0:43 The real result
- 1:35 What a Function is
- 2:42 Why Functions now
- 3:07 All 9 Function APIs
- 5:38 Real limits
- 6:47 Plans and stores
- 7:21 Tools
- 8:05 The series
- 8:37 Recap
Step by step (full walkthrough)
Intro: a real Function in the cart
This shirt costs $48, and the cart just took 20% off. Then another 10% off the whole order, and nobody typed a discount code. That logic is my own code, running inside Shopify's checkout.
It is called a Shopify Function. In this first episode of the Shopify Functions 2027 series, you will see exactly what a Function is. First, what a Function really is: input, code, output.
Then all nine Function APIs, in the order Shopify runs them in checkout. The real limits, with numbers measured on our own store. And the plans, the tools, and everything we build in this series.
The real result
Let's start with the real result on our development store, a linen summer shirt for $48. I add it to the cart. And open the cart.
The line shows 20% off the product, so $48 becomes $38 and forty cents. On top of that, 10% off the order, minus $3 eighty-four. The estimated total is thirty-four fifty-six.
Both discounts come from one small Function that we deployed to this store with API version 2027, oh one. The same discounts follow the buyer into checkout. Shopify runs the Function again whenever the cart changes, so the numbers always match the cart.
Total savings: $13 and forty-four cents. We stop here, nothing is paid in this video.
What a Function is
So what is a Shopify Function, exactly? It is a small piece of your own code that Shopify runs inside its own servers, at one exact moment of checkout. First, you write a GraphQL input query.
It asks only for the cart data your logic needs. Shopify runs that query and passes the result to your Function as JSON. Your Function is compiled to WebAssembly.
It reads the input and returns operations, also as JSON. Shopify then applies those operations. You do not host a server, and by default the Function cannot call the internet.
This is the real run from our store log, the same cart you just saw. The input is tiny: one cart line with a subtotal of $48, and the discount classes this discount is allowed to use, product and order. The output is two operations: an order discount of 10%, and a product discount of 20% on that exact cart line.
The Function never changes the cart itself. It only describes what should happen, and Shopify does the rest.
Why Functions now
If you used Shopify Scripts before, this part matters. Shopify Scripts and the Script Editor app were retired on June thirtieth, 2026. Scripts no longer run on any store.
Discounts, shipping rules and payment rules that used to be Scripts are now built as Functions. And unlike Scripts, which were Plus only, a public app with Functions works for merchants on every plan.
All 9 Function APIs
There are nine Function APIs in 2027, oh one. Here they are in the order Shopify runs them. First, Cart Transform.
It can expand one line into a bundle, or merge several lines into one. Second, Discount. Product, order and shipping discounts, exactly like the one you saw in the cart.
Third, Fulfillment Constraints, which decide which location has to ship which items. Fourth, Order Routing, which ranks your locations. Today that one is a beta for Shopify Plus stores, by request.
Fifth, the Pickup Point generator, which adds pickup points from a carrier or a network. Sixth, the Local Pickup generator, which builds local pickup options for your own locations. These two pickup APIs are still on the unstable API version.
Seventh, Delivery Customization. It hides, renames or reorders shipping options. Eighth, Payment Customization, which does the same for payment methods.
And ninth, Cart and Checkout Validation. It can stop the buyer with an error message, for example a maximum quantity. A quick way to remember them: start from the merchant's problem.
Buy three, get 15% off? That is a Discount Function. A bundle that is sold as one product but ships as separate items?
Cart Transform. Hide express shipping when the cart is too heavy? Delivery Customization.
No cash on delivery above $500? Payment Customization. A maximum of five per customer?
Cart and Checkout Validation. And fragile items that must all ship from one warehouse? Fulfillment Constraints.
Every one of these is an episode in this series. In the admin, our Function shows up as an app discount, next to the normal discounts. Merchants turn it on, schedule it and combine it like any other discount.
The method says automatic, and the type is our Function. Delivery customization Functions are switched on from shipping and delivery. They hide, rename or reorder the shipping options a buyer sees.
And checkout rules, in the checkout settings, are where validation Functions are switched on. We build every one of these in this series. But first, the limits.
Real limits
Functions run inside checkout, so they must be small and fast. Shopify enforces hard limits. Each run can use up to eleven million instructions.
Our discount Function, written in JavaScript, used 336,000 when I ran it locally, about 3% of the limit. The compiled WebAssembly module can be at most 256 kilobytes. Ours is three kilobytes, because the CLI links the JavaScript engine for us.
And the input query has a maximum cost of thirty. Metafields and tag checks cost three each, so that budget goes quickly. And this is the same Function running on the live store, logged while I recorded the cart you saw.
The target is cart lines discounts generate run, and the status is success. It read 118 bytes and wrote 320 one, and it used 335,000 instructions. Almost exactly the local number.
Other limits: ten megabytes of memory, input up to 128 kilobytes, and no randomness or clock. The same cart always gives the same answer.
Plans and stores
Which stores can use Functions? Any plan can use public apps from the Shopify App Store that contain Functions. But a custom app with Functions only works on Shopify Plus.
That is the most common surprise: the Function deploys, and nothing happens on a normal store. For building and testing, a development store works for everything. Ours is a free development store on the Developer Preview plan.
Some APIs have extra rules: order routing is Plus only, and the local pickup generator needs a Plus store for custom apps.
Tools
You need the Shopify CLI. I am on version five point one. Generate extension creates a Function from a template, in JavaScript or Rust.
Function run runs it on your own machine with a test input and counts the instructions. App dev and app deploy put it on a store. One trap I hit: the CLI template still writes API version 2026, oh seven.
For this series we change it to 2027, oh one in the extension TOML file. JavaScript is the easiest start, and we use it first. Rust is faster and smaller, and we switch to it when an API needs it, for example the pickup point generator.
The series
Here is the plan for the series. In episode two, we build our first Function in JavaScript, step by step, and test it. Then real discounts, with a settings screen for the merchant.
Bundles with Cart Transform, shipping and payment customizations, and checkout validation. Fulfillment constraints, order routing and pickup points. Then Rust, performance and debugging with real logs.
And at the end, everything comes together in one complete checkout app.
Recap
Let's recap. A Shopify Function reads an input query, runs your WebAssembly code, and returns operations that Shopify applies. There are nine Function APIs, from Cart Transform to checkout validation, always in the same order.
Our real discount used 336,000 of eleven million instructions, in a three kilobyte module. Custom apps need Shopify Plus, and a development store is where we build. All the code for this series is in the GitHub repository shopify functions 2027, linked below.
In the next episode, we write our first Function. See you there.
The Shorts from this video
Shopify Scripts Are Gone: Use Shopify Functions (2027)
Shopify Functions replace Shopify Scripts: Scripts were retired on June 30, 2026 and no longer run on any store (Shopify Help Center).
Shopify Functions Limits: 11M Instructions, 256 KB (Real Run)
Shopify Functions limitations for API 2027-01, shown with a real function run: 11 million instructions, 256 KiB module, 10 MiB memory, input query cost 30.
Shopify Functions API List 2027: All 9 in Checkout Order
Shopify Functions API list for 2027-01, in the order Shopify runs them at checkout: Cart Transform, Discount, Fulfillment Constraints, Order Routing, Pickup Point and Local Pickup generators, Delivery Customization, Payment Customization, Cart and Checkout Validation.
🔔 New episodes every week on the YouTube channel. Need a custom Shopify app or API integration? Wixob Technologies builds them: info@wixob.com.