Running Functions/Discount App for all Discount Codes (even ones created by the likes of Klaviyo...)

Topic summary

A merchant is migrating from Shopify Scripts (deprecating August 2025) to Functions but faces a critical limitation: discount codes created by third-party apps like Klaviyo or Yotpo don’t trigger their custom Function/Discount App logic.

Current Problem:

  • Functions only run when attached to discount codes created within the Function/Discount App itself
  • External marketing platforms create standalone codes that bypass custom discount logic
  • No default discount app setting exists in Shopify to apply Functions universally

Proposed Solutions:

  • One suggestion is for marketing apps to reference existing Shopify discounts instead of creating new codes, but no API currently supports this
  • For Shopify Plus merchants, the Discount Allocator API may handle third-party discount control with custom logic

Status: The discussion remains open, seeking workarounds that don’t require waiting for Shopify or marketing apps to build new functionality.

Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

We are working on getting Functions to do what is already possible in scripts that is going away Aug 2025.

One limitation we have found is that if we create discount codes in Klaviyo or Yotpo (or any outside marketing app) it is not “attached” to the Functions/Discount App and so the logic doesn’t run when you use the Discount Code.

Is there not a way to have the Functions/Discount App to be the default for the store so it’s always seen when using a Discount Code?

It sounds more like something Kaviyo / Yotpo would have to do? Something like letting users pick an existing discount (native or function based) instead of always just creating a new discount?

That’s a great idea and we did feel that was needed except there is no api for this. There should be a default discount app option in Shopify so it follows the logic automatically as it does now with Shopify Scripts.

Any other solutions that don’t involve waiting for Shopify to have marketing apps build functionality that doesn’t exist today.

Assuming this is a Plus shop you might want to look at https://shopify.dev/docs/api/functions/reference/discounts-allocator to handle controlling “3rd party” discounts with custom logic.