Pairing ยท 2026-12-04
Can you combine Shopify Functions with loyalty programs? Rules, timing and conflicts
Short answer: yes, Shopify Functions and loyalty programs can run on the same store, and most stores in this niche run both. The work is in the overlap: this is where loyalty redemption actually happens now.
How Shopify Functions works
Where Scripts let a Plus store keep its pricing logic in one Ruby file, Functions split that logic into scoped units, one per job, each reading the cart through a GraphQL query and answering with instructions Shopify applies. Discounts, bundles, gateway ordering and delivery rules each get their own function.
How loyalty programs works
Points, tiers and referrals are the visible parts. Underneath, a programme is a promise the store makes to its best buyers: come back and the second order costs less than the first did. The promise is kept at checkout, in the discount mechanics, which is where programmes succeed or quietly leak.
Where Shopify Functions goes wrong on its own
Carrying every Script-era rule into functions unchanged is the standard mistake. A decade of accumulated discount rules includes promotions nobody remembers approving, and the migration is the one natural moment to delete them. Stores that skip the audit rebuild the mess on better infrastructure.
Where loyalty programs goes wrong on its own
Launching a programme to fix a repeat-purchase problem the product caused is the expensive version of the mistake. Points cannot argue a buyer into a second order of something that disappointed them; they can only discount the orders of buyers who were returning regardless.
What the evidence says about Shopify Functions
Discount functions follow the combination rules set in the admin: whether two discounts can combine is a store setting, not something the function decides on its own.
A function takes a GraphQL input query describing the cart and returns JSON instructions. It never touches the page, which is why it is upgrade-safe where script tags were not.
Shopify Scripts stopped running on June 30, 2026, so discount and shipping logic that lived in a store's Ruby scripts had to be re-expressed as functions, usually one function per app rather than one file per store.
And about loyalty programs
Self-referral is the standard abuse: a buyer refers a second email address they own, and both sides collect. Every programme needs the boring fraud rules written before launch, not after the first abuse report.
Unredeemed points sit on the books as a liability until they are redeemed or expire, which is why finance teams, not just marketers, get a say in the earn rate.
Redemption usually reaches checkout as a discount code or a Functions-based discount, so the programme's generosity is ultimately expressed inside the same discount rules as every promotion the store runs.
Where they collide
This is where loyalty redemption actually happens now. Points become money through a discount function or a code the function era made less flexible, and the stacking rules between points redemption and promotional discounts are decided in the combination settings both systems share.
The order practitioners run them in
Write the stacking matrix before building either side: points with codes, points with automatic discounts, points with sale pricing. The matrix is three lines long and prevents the loudest support tickets.
A check you can run this week
Test functions the way they will fail: on the largest cart, the stacked-discount cart and the B2B cart, not the tidy three-item test cart every demo uses.
Related reading: Does Shopify Functions help with reverse logistics cost? What the evidence and practitioners say and Does loyalty programs help with reverse logistics cost? What the evidence and practitioners say.
Frequently asked questions
Can you combine Shopify Functions with loyalty programs?
Yes, with the overlap managed. This is where loyalty redemption actually happens now. Points become money through a discount function or a code the function era made less flexible, and the stacking rules between points redemption and promotional discounts are decided in the combination settings both systems share.
What breaks first when Shopify Functions and loyalty programs run together?
This is where loyalty redemption actually happens now. Write the stacking matrix before building either side: points with codes, points with automatic discounts, points with sale pricing. The matrix is three lines long and prevents the loudest support tickets.
Which do you set up first, Shopify Functions or loyalty programs?
Write the stacking matrix before building either side: points with codes, points with automatic discounts, points with sale pricing. The matrix is three lines long and prevents the loudest support tickets.
What is the most common mistake with Shopify Functions in this pairing?
Carrying every Script-era rule into functions unchanged is the standard mistake. A decade of accumulated discount rules includes promotions nobody remembers approving, and the migration is the one natural moment to delete them. Stores that skip the audit rebuild the mess on better infrastructure.