Glossary term

Shopify Functions

Definition

Shopify's framework for writing custom backend logic that runs within Shopify, extending areas like discounts, cart transformations, and delivery or payment customization. B2B and quoting apps use it to apply custom pricing or discount rules at checkout.

Shopify Functions is a framework that lets developers write custom backend logic that runs directly inside Shopify’s own infrastructure. Instead of calling an external server, the code executes within Shopify at key decision points like applying a discount, transforming a cart, or customizing delivery and payment options. It replaced the older Scripts system and works across the Online Store and checkout, including for Plus and non-Plus merchants where the relevant API allows.

How it works

A developer writes a Function in a language that compiles to WebAssembly (commonly Rust or JavaScript), then deploys it as part of a Shopify app. Shopify runs the Function at the exact moment it is needed, for example when the cart is evaluated or a discount is calculated. Because the logic runs inside Shopify rather than a remote API, it is fast and does not add checkout latency.

Why it matters for B2B quoting

B2B pricing is rarely a flat catalog price. You may need account-specific rates, volume breaks, or negotiated terms that only apply to certain customers. Shopify Functions is one of the mechanisms an app can use to enforce those rules at checkout, so the price a buyer sees and pays matches what was agreed, without manual overrides.

Example

A wholesale buyer accepts a quote and clicks through to checkout. A discount Function checks the buyer’s company or tags, then applies the negotiated per-unit price or a tier discount automatically. The buyer pays the correct amount through native Shopify checkout.

For quote-driven workflows, tools like ShopQuotes sidestep some of this by converting an accepted quote into a real draft order, so the agreed line items and prices carry straight into checkout. See related terms in the B2B quoting glossary.

Frequently asked

Is Shopify Functions the same as Shopify Scripts?

No. Functions is the modern replacement for Scripts. Scripts ran only on Shopify Plus checkout, while Functions works more broadly and runs as WebAssembly inside Shopify.

Do I need to be on Shopify Plus to use Shopify Functions?

Not always. Availability depends on the specific Function API. Some, like discount Functions, are available beyond Plus, while others tied to checkout customization may require Plus.

Do I have to write Functions myself to get custom B2B pricing?

No. Most merchants get this through an app. The app's developer builds and maintains the Function, so you configure pricing rules in the app rather than writing code.

Turn quote requests into paid orders

ShopQuotes is a free-to-start Shopify app for branded, checkout-ready quotes.