Need to Remove All Types of Discounts Using the Shopify Functions API

Hi everyone,
I’m working on a Shopify Function where I need to remove every possible discount from the checkout — automatic discounts, code-based discounts, subscription discounts, everything.

I’m not trying to override or replace the discount; I want zero discounts to apply under any condition.

I’ve already created a discount function, but Shopify Functions only let you define discounts, not directly disable or strip existing ones. I haven’t found a documented way to programmatically block all discounts through a Function.

My questions:

  1. Is there any supported method (via Functions API or another extension type) to prevent all discounts from applying?
  2. Can the Function return a result that essentially produces no discount, effectively wiping out any other discounts?
  3. If not possible through Functions, what’s the correct approach? Checkout validation? Cart transform? Something else?

Any guidance or examples would be appreciated. I just want a definitive answer on whether this is achievable and the correct way to implement it.

Thanks.

Hi @adarsh_anncode

You cannot programmatically block or remove all discounts from checkout using Shopify Functions or any other extension API. I suspect that this limitation may actually be by design, to avoid unintentionally impacting checkout customisations that originate from other apps.

The only way is to ensure no discounts are configured or active in the store admin. If you want to block checkout when discounts are present, use the Checkout Validation API to prevent checkout, but this will not remove discounts—only stop the order from being placed.