Built for Shopify merchants Shopify App Store Contact us
Banify
Newsroom
engineering

Referral Program & Rewards rebuilt on Shopify Functions

Discounts now apply at checkout without a script tag, which cuts the round trip and removes a class of theme conflicts.

25 Aug 20265 min readBanify
A laptop screen showing lines of code in an editor

Referral discounts used to work the way most Shopify apps have always applied them: a script tag on the storefront, a request out to our servers when the cart changed, and a discount code written back into the session. It worked, and it was the wrong shape.

As of this release, Referral & Loyalty Rewards applies discounts through Shopify Functions, which run inside Shopify’s own checkout rather than calling out to us.

What the old approach cost

Every discount involved a network round trip that happened while a customer was mid-checkout. Most of the time that was fast. Occasionally it was not, and when it was slow it was slow at the worst possible moment.

The script tag brought a second problem. It ran alongside whatever else a merchant’s theme had loaded, and themes vary enormously. A theme that rewrote the cart drawer, or an app that intercepted the same events, could leave a referral discount applied visually but missing at checkout — the single worst failure mode for a loyalty program.

A discount that appears in the cart and vanishes at checkout does more damage than no discount at all.

How it works now

  • Discount logic runs inside Shopify checkout, with no request to our servers
  • No script tag on the storefront, so nothing to conflict with the theme
  • Referral, points and tier discounts are all evaluated in the same pass
  • Behaviour is identical across themes, because the theme is no longer involved

For merchants the visible change is that discounts appear immediately and stay applied. For us the change is that an entire category of support ticket — "the discount disappeared at checkout" — no longer has a mechanism to occur.

What we had to give up

Functions run in a sandbox with a strict time budget and no network access. That is exactly why they are reliable, and it meant some logic had to move. Anything that needed to look something up remotely now happens when a campaign is configured rather than when a cart is priced, and the Function reads a prepared result.

That trade is worth making. Deciding a discount is a question with a correct answer that can be computed in advance; doing it live was a habit inherited from how apps used to have to work.

Rollout

The migration is complete for all stores on the app. Existing campaigns, point balances and tier thresholds carried across unchanged, and no reconfiguration is required. If you had previously worked around a theme conflict with custom code, that workaround is now unnecessary and can be removed.

See Referral & Loyalty Rewards

More from the newsroom

productrelease

Banify AI Visibility now indexes 500 products per store, up from 100

31 Aug 2026
peoplecompany

Banify joins the Shopify Partner Directory as a verified developer

19 Aug 2026
productroadmap

Email Popups adds server-side A/B testing and per-collection targeting

12 Aug 2026
All articles