Shopify glossary

Shopify Functions

Updated By

Short answer

Shopify Functions are small pieces of custom backend logic that run on Shopify's own infrastructure. They let a store customize discounts, delivery and payment options, cart validation and bundles, and they replace Shopify Scripts. Functions ship inside apps: public apps work on any plan, while custom apps with Functions need Shopify Plus.

What Functions can customize

Each Function plugs into a specific Shopify API:

  • Discounts: tiered, bundle, buy-X-get-Y or customer-specific discount rules.
  • Delivery customization: hide, rename or reorder shipping options.
  • Payment customization: hide or reorder payment methods, for example removing cash on delivery above an order value.
  • Cart and checkout validation: block checkout when rules aren’t met, such as minimum quantities for wholesale buyers.
  • Cart transform: build bundles and expand or merge cart lines.

How they differ from apps that call the API

A normal app talks to Shopify from its own server. A Function runs inside Shopify at the moment a cart or checkout is calculated, so it’s fast and can’t go down with an outside server. The trade-off is strict limits on instruction count, memory and what data a Function can read.

TruLabs product page
TruLabs: we built a custom discount Function for influencer codes, with an admin to manage it. See the project

When to use one

If an app in the App Store already does what you need, use it. When your rules are specific to your business, such as wholesale pricing, regional shipping rules or custom bundles, a custom Function in a private app is usually the cleanest answer.

Questions we get

Are Shopify Functions the replacement for Shopify Scripts?

Yes. Scripts were a Plus-only Ruby feature that Shopify retired in 2026. Functions cover the same jobs (discount logic, shipping and payment rules) with better performance and support on more plans.

What languages are Functions written in?

Functions compile to WebAssembly. Shopify supports writing them in JavaScript or Rust, and they must run within Shopify's strict performance limits.

Keep reading

Work with us

Need help with custom shopify apps & integrations?