Skip to content

Shopify platform

Shopify Functions for ecommerce stores

Shopify Functions let custom logic run inside Shopify's own checkout: how a discount is calculated, which shipping options appear, what a cart is allowed to contain, and how bundled items are expanded for fulfilment. They are the supported route to that kind of customisation on Shopify today. Most stores meet them the long way round, after three pricing apps have been installed to approximate one promotion the merchandising team described in a sentence.

Shopify Functions

Shopify platform · by Shopify. A text wordmark, not a logo: we are not affiliated with the vendor and make no claim to its trademarks.

What we do with it

The work inside Shopify Functions

Discount logic the admin cannot express

Quantity breaks that differ by collection, member pricing tied to a customer tag, spend thresholds calculated on eligible items only, and bundle pricing that survives a partial cart are all straightforward as code and awkward as stacked apps. The rule lives in one place and applies the same way to every order.

Bundles and kits that fulfil correctly

Cart transform logic lets a shopper add one item while the order carries the components, so inventory decrements against real stock and the warehouse picks what exists. That is the difference between a bundle that merchandises well and a bundle that produces a monthly reconciliation problem.

Delivery and payment options presented sensibly

Shipping methods can be renamed, reordered or hidden according to what is in the cart, and payment methods can be presented differently for a wholesale customer than a retail one. These customisation APIs are part of the Plus feature set, so plan availability is confirmed before the work is scoped.

Validation before an order exists

Minimum order quantities, restricted regions, hazardous item combinations and account-level purchasing rules can be enforced at the cart and checkout rather than caught afterwards by a person. The customer sees a clear message at the point of the problem instead of a cancellation email the next day.

Deployment, testing and versioning

Functions ship inside an app, which means they get a version history, a staging path and a rollback. We test against realistic carts, including the edge cases that only appear at scale such as mixed currencies, partially discounted lines and subscriptions, then deploy on a schedule rather than during a sale.

When it fits

Shopify Functions is the right tool when

  • Stores approximating one promotion with several apps

    When the pricing behaviour a brand wants is spread across three tools that each partially agree, replacing it with a single rule removes both the monthly cost and the conflicts.

  • Brands selling wholesale and retail from one store

    Different pricing, minimums and payment presentation for tagged accounts is a common requirement, and it is the kind of rule that belongs in checkout logic rather than in a theme.

  • Catalogs with bundles, kits or configurable products

    Any product sold as one thing and shipped as several needs the order to reflect the components. Getting that right at the cart stage prevents inventory drift downstream.

What to watch

Where accounts drift

Facts about defaults and costs, not criticism. These are the settings we check on every account.

  • Plan availability differs by function type

    Discount logic is broadly available, while some customisation and validation capabilities are tied to the Plus feature set. Confirm what the store's plan includes before designing a solution around a specific behaviour.

  • Execution runs inside strict limits

    A function receives a defined input and returns a result quickly, without calling out to external services. Logic that needs live data from another system has to get it there another way, which shapes the design from the start.

  • Discount combination rules still apply

    Platform rules govern how discounts combine and how many can apply to an order. A promotion designed without checking those rules can behave correctly in isolation and produce a surprise when a code is added on top.

  • Code needs an owner after launch

    This is software in the checkout path, so it needs someone who can update it when the promotion changes and redeploy it when the platform revises an API. Handing over documentation and repository access is part of the work, not an afterthought.

Questions

Shopify Functions questions

By CartKernel · Last reviewed

What can custom checkout logic do that a discount app cannot?

Express the exact rule, once, without a second tool interpreting it. Apps cover common patterns well. The case for code is a promotion with conditions that no app models, or a store carrying several apps whose interactions have become impossible to predict.

Do we need Shopify Plus for this?

For some of it. Discount functions are available broadly, while certain payment, delivery and validation capabilities belong to the Plus tier. We check the store's current entitlements at scoping, since it changes both the design and whether a plan upgrade is part of the conversation.

Will custom logic slow the checkout down?

It runs on Shopify's infrastructure within tight execution limits, so a well-written function is not where checkout speed goes. The bigger risk to checkout performance is usually the number of third-party scripts and apps the store has accumulated around it.

Do these replace the older Shopify Scripts?

Functions are the current supported approach to customising this part of the platform, and stores that relied on the previous model are expected to move. The rewrite is rarely line for line, because the newer APIs are structured differently and often express the intent more directly.

Who maintains it once the project ends?

The store owns the app and the repository. We document what each function does, the carts it was tested against, and how to deploy a change. If we stay on retainer we make the updates; if not, any competent Shopify developer can pick it up from that documentation.

Works alongside

All technology
Shopify automationShopify FlowShopify Flow for ecommerce stores: tagging that drives segmentation, order and inventory routines automated, and workflows documented instead of improvised.OpenHeadless ShopifyHydrogenHydrogen for ecommerce stores: a headless Shopify storefront on the Storefront API, with editable content, tracking rebuilt and an honest case for going custom.OpenSubscriptionsRechargeRecharge agency for subscription brands: offers set from how the product is used, a portal built for retention, dunning and save flows that recover revenue.OpenCustomer supportGorgiasGorgias for ecommerce: order data in every ticket, macros with actions, rules that resolve the predictable questions, support signals fed into marketing.OpenComparisonDiscount codes vs automatic discountsDiscount codes vs automatic discounts: which one tracks a campaign, which one removes friction at checkout, and how to combine both without leaking margin.OpenComparisonShopify vs Shopify PlusShopify vs Shopify Plus: what Plus adds in checkout, B2B, automation and multi-store operations, and which stores need it versus a strong standard plan.OpenAnswerHow many apps are too many on a Shopify store?There is no app limit on Shopify. The real cost is scripts, cost and conflicts. How to audit what you have and decide what earns its place.OpenAnswerShould B2B and DTC share one Shopify store?One Shopify store can serve wholesale and direct customers with company accounts and price lists. When that works and when two stores are cleaner.OpenAnswerDo you need a developer for a Shopify store?You do not need a developer to launch a Shopify store. What you can do with theme settings and apps, and the work that genuinely requires code.Open

Find the leak.

A free Growth Analysis ranks what your store should fix first, by revenue at stake.