Pairing ยท 2026-12-04
Can you combine Shopify Functions with gift cards as a product line? Rules, timing and conflicts
Short answer: yes, Shopify Functions and gift cards as a product line can run on the same store, and most stores in this niche run both. The work is in the overlap: gift cards are a payment method, not a discount, and functions mostly leave them alone.
How Shopify Functions works
Functions are Shopify's server-side logic layer: code an app ships that Shopify runs when a cart or checkout is evaluated, covering discounts, bundle building through cart transforms, payment and delivery customisation, and validation rules that can block a checkout outright.
How gift cards as a product line works
A gift card programme merchandises stored value: denominations on a product page, delivery by email, redemption at checkout against a code. Run as a product line it gets the full treatment, seasonal creative, corporate bulk sales, a recipient experience designed to convert a gift into a first order.
What the evidence says about Shopify Functions
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.
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.
And about gift cards as a product line
Unredeemed balances sit on the books as a liability, deferred revenue, until redemption. The cash arrives at purchase; the obligation leaves when the recipient spends, and some of it never gets spent.
US federal law, the Credit CARD Act of 2009, sets a five-year minimum before a gift card can expire, and several states restrict expiry and fees further. The terms on the product page have to match the law where the buyer lives, not where the store sits.
Gift card codes are a standing fraud target because they resell easily. Balance-check pages get scraped, and drained cards surface as the angriest support tickets a store handles.
Where they collide
Gift cards are a payment method, not a discount, and functions mostly leave them alone. The meeting point is discount logic that calculates against the order total: a threshold promotion should count the basket, not the portion paid by card, and getting that wrong penalises exactly the buyers a gift programme worked to bring in.
Where Shopify Functions goes wrong on its own
The failure mode is porting a Script line by line. Scripts were one file holding every rule a store had; functions are scoped per purpose, so the port is really a re-think of which rules still earn their place. Stores that skip the re-think ship their historical discount mess on newer rails.
Where gift cards as a product line goes wrong on its own
The failure mode is discounting gift cards themselves, ten percent off a hundred-dollar card. That pays arbitrageurs to stock up, books a liability at a loss, and trains real gift buyers to wait for the sale.
The order practitioners run them in
State the rule explicitly in the discount design: thresholds count merchandise value regardless of payment mix. Then test with a part-card, part-gift-card order.
A check you can run this week
List the discount and shipping behaviours the store actually relies on this quarter, from order data rather than from the Scripts file, and make the function list match that list. Anything in the file that is not in the data is a candidate for deletion.
Related reading: Does Shopify Functions help with reverse logistics cost? What the evidence and practitioners say and Does gift cards as a product line help with reverse logistics cost? What the evidence and practitioners say.
Frequently asked questions
Can you combine Shopify Functions with gift cards as a product line?
Yes, with the overlap managed. Gift cards are a payment method, not a discount, and functions mostly leave them alone. The meeting point is discount logic that calculates against the order total: a threshold promotion should count the basket, not the portion paid by card, and getting that wrong penalises exactly the buyers a gift programme worked to bring in.
What breaks first when Shopify Functions and gift cards as a product line run together?
Gift cards are a payment method, not a discount, and functions mostly leave them alone. State the rule explicitly in the discount design: thresholds count merchandise value regardless of payment mix. Then test with a part-card, part-gift-card order.
Which do you set up first, Shopify Functions or gift cards as a product line?
State the rule explicitly in the discount design: thresholds count merchandise value regardless of payment mix. Then test with a part-card, part-gift-card order.
What is the most common mistake with Shopify Functions in this pairing?
The failure mode is porting a Script line by line. Scripts were one file holding every rule a store had; functions are scoped per purpose, so the port is really a re-think of which rules still earn their place. Stores that skip the re-think ship their historical discount mess on newer rails.