# Can you combine post-purchase upsells with Shopify Functions? Rules, timing and conflicts

Source: https://returnsift.com/blog/2026-12-04-can-you-combine-post-purchase-upsells-with-shopify-functions-rules-timing-and-conflicts.html

Pairing · 2026-12-04


Short answer: yes, post-purchase upsells and Shopify Functions can run on the same store, and most stores in this niche run both. The work is in the overlap: functions decide what the cart costs; the post-purchase offer changes what the cart contains after it has already been paid for.

## How post-purchase upsells works

The offer page appears once, in the seconds between payment and the thank-you screen, and it works because the buyer's payment method is already on the table. One click adds the product to the order they just placed. No second checkout, no form, no new decision about whether to buy from this store at all.

## 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.

## What the evidence says about post-purchase upsells

Because the original order is already paid, an accepted offer edits that existing order instead of creating a second one, which is why fulfilment splits and confirmation emails deserve a second look after launch.

Shopify only shows the offer to buyers whose payment method can be charged a second time. Some wallets and local payment methods cannot, so a slice of buyers never sees the offer at all.

The offer is built as a checkout extension under checkout extensibility, and the merchant picks which products trigger it and which product gets pitched.

## And 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.

## Where they collide

Functions decide what the cart costs; the post-purchase offer changes what the cart contains after it has already been paid for. The conflict shows up in discount logic: a Functions discount evaluated at checkout does not re-run when the offer edits the order, so a threshold promotion can end up applied to an order that no longer matches the threshold the buyer crossed.

## Where post-purchase upsells goes wrong on its own

The offers that sour are the ones that treat the post-purchase screen as a second storefront. Buyers read a full-price hero pitch there as the store squeezing, and the upsold line's refund rate tells the story within a fortnight.

## Where Shopify Functions goes wrong on its own

The other failure is subtler: writing a function that is technically correct and commercially wrong, because it applies a discount the marketing calendar retired, at a scale the old Script never reached. Functions run on every cart. Errors do too.

## The order practitioners run them in

Settle the discount functions first and write down how they treat edited orders. Then design offers that do not lean on thresholds the function already consumed.

## A check you can run this week

Before scaling an offer, read its accept rate by traffic source and by payment method for two weeks. The pattern in that split tells you who the offer is actually for, which is rarely who it was designed for.

Related reading: [Does post-purchase upsells help with reverse logistics cost? What the evidence and practitioners say](https://returnsift.com/blog/2026-12-02-does-post-purchase-upsells-help-with-reverse-logistics-cost-what-the-evidence-and.md) and [Does Shopify Functions help with reverse logistics cost? What the evidence and practitioners say](https://returnsift.com/blog/2026-12-02-does-shopify-functions-help-with-reverse-logistics-cost-what-the-evidence-and.md).

## Frequently asked questions

### Can you combine post-purchase upsells with Shopify Functions?

Yes, with the overlap managed. Functions decide what the cart costs; the post-purchase offer changes what the cart contains after it has already been paid for. The conflict shows up in discount logic: a Functions discount evaluated at checkout does not re-run when the offer edits the order, so a threshold promotion can end up applied to an order that no longer matches the threshold the buyer crossed.

### What breaks first when post-purchase upsells and Shopify Functions run together?

Functions decide what the cart costs; the post-purchase offer changes what the cart contains after it has already been paid for. Settle the discount functions first and write down how they treat edited orders. Then design offers that do not lean on thresholds the function already consumed.

### Which do you set up first, post-purchase upsells or Shopify Functions?

Settle the discount functions first and write down how they treat edited orders. Then design offers that do not lean on thresholds the function already consumed.

### What is the most common mistake with post-purchase upsells in this pairing?

The offers that sour are the ones that treat the post-purchase screen as a second storefront. Buyers read a full-price hero pitch there as the store squeezing, and the upsold line's refund rate tells the story within a fortnight.
