Shopify PlusMarginCheckoutProfit Governance

Checkout Margin Enforcement vs Pre-Fulfillment Holds on Shopify Plus

Your analytics know exactly which orders lost money. They find out three weeks too late. Here is how checkout-time rules and post-order, pre-fulfillment margin checks each stop the bleed, and where they differ.

By Herzel Mishel, CEO & Co-Founder, Hycos.ai
··Updated

Most margin problems on Shopify Plus are not pricing problems. They are timing problems.

Your analytics know exactly which orders lost money. They just find out three weeks too late, after the package shipped, after there is anything you can do about it. By the time the margin report flags a stacked-discount order to a far freight zone, you have already eaten the loss on it and a few hundred others like it.

There are two places to move that decision earlier. One is checkout, before the order is placed. The other is the window after the order is placed and before it ships. They solve different problems, use different tools, and fail in different ways.

Here is how each one works, why month-end reporting cannot fix either, and where Agentis fits.

What "enforcement" actually means

Reporting tells you what happened. Enforcement decides what is allowed to happen next.

A margin check compares an order against your real cost data, not the list price: current COGS, the freight cost for that customer's zone, any FX swing if you source or sell cross-border, and the full stack of discounts the customer managed to apply. It runs the math, compares it to your margin rule, and acts on the result. The two questions that matter are when the check runs and what it is allowed to do.

That is the whole idea. Profit governance is that check applied to every order instead of reviewed after the fact.

Why the dashboard cannot save you

Here is the uncomfortable part. Better reporting makes this problem more visible, not less expensive.

A dashboard is a rear-view mirror. It shows you checkout margin erosion after the orders are gone. You can stare at a chart that says "blended margin down 6 points this month" and there is nothing you can do about the orders inside it. They shipped. The cost is sunk.

The orders that hurt you most also look fine in the moment. A customer stacks WELCOME10 on top of a sitewide 15 percent sale, ships to a zone-8 zip, and the order total drops below what the goods cost you to land. Shopify does not know your landed cost. The customer definitely does not. And you will not either, until the discount stacking surfaces in a reconciliation weeks later.

You cannot report your way out of a problem that already happened. You have to catch it before the box leaves the building.

Option 1: enforcement at checkout

Checkout-time enforcement runs inside Shopify's checkout, before the order exists. On Shopify Plus that means Shopify Functions: discount functions that decide which discounts apply and how they combine, and cart and checkout validation functions that can stop a checkout from completing. Shopify Scripts used to fill this role with custom Ruby, but Scripts were shut down on June 30, 2026, so Functions is now the native path.

What checkout rules do well is promotion logic. Which codes can combine, a cap on stacked discounts, a minimum cart for free shipping, a price floor per product. These are decisions about the cart, and the cart is all a checkout rule needs to see.

Where they struggle is true margin. A function runs in Shopify's sandbox with tight execution limits and, for most function types, no external network calls, so it only knows what you put in front of it ahead of time, usually product metafields. Live NetSuite COGS, the freight you will actually be billed, payment fees, and FX either have to be synced into Shopify in advance or left out. And a checkout rule has two tools, change the discount or stop the checkout, so every false positive is a lost sale.

Option 2: enforcement after the order, before it ships

The second window opens once the order is placed. The customer has paid, the order is in Shopify, and nothing has been picked, packed, or shipped yet. A check here can use everything: the real order with its final discount stack and payment method, live COGS from your ERP, the freight for the destination zone, fees, and FX.

This is where Agentis works. Within 60 seconds of each order, it computes true net margin on that specific order. If the order clears your floor, nothing happens. If it does not, Agentis flags it with the leak and a recommended fix, or, under rules you approve, automatically holds it before fulfillment. Your team then decides: ship it anyway, contact the customer, cancel and refund, or fix the promotion that let it through. Every decision is logged in an Evidence Ledger.

The trade-off is worth stating plainly. A post-order check does not change what the customer saw at checkout. It does not edit the cart or show the customer a message. What it does is stop a losing order from shipping and tell you exactly which code, rule, or cost change produced it, so you fix the leak upstream instead of eating it at month-end.

Walk through one order

An order comes in: two premium jackets, a 25 percent promo code, shipping to a remote zone. Within 60 seconds of the order being placed, the check pulls the live inputs:

  • COGS per SKU, synced from your ERP so it is the real landed cost, not a number someone typed into a Shopify field two years ago
  • Freight for that destination zone
  • FX, if it matters to how you source or sell
  • The applied discount stack

It calculates net margin on that specific order. If the result clears your floor, the order flows to fulfillment untouched. If it does not, the order is flagged, or held before it is picked, with the margin math attached. Someone on your team makes the call while the box is still on the shelf.

The version that works is the version that rarely stops anything. Holding too many orders slows fulfillment and trains your team to ignore the rule. That is why floors belong where they matter, and why the sensible first step is flag-only: see which orders would have been held, check the math, and only then turn on automatic holds.

Set the floor once, per SKU if you need to

The rule you are enforcing is a profit floor: the minimum margin an order has to clear before it ships without a second look.

One global floor works for plenty of stores. But a flat 20 percent across the catalog is a blunt instrument when your accessories run 70 points and your electronics run 8. So you set floors where they matter: per SKU, per category, per freight zone, per promo type. A clearance SKU can carry a thin floor on purpose. Your hero product does not have to.

You are not writing logic for every promo. You are stating the one thing that is always true: do not ship this below X.

Three jobs, two windows

Margin floor is the headline, but it shows up as three concrete guardrails, and each one maps to a window:

  • Coupon stacking. Stopping two codes from combining is a checkout job, handled by Shopify's discount combination settings or a discount function. Catching the stacked order that still lands below your floor is a post-order job: flag or hold it before it ships.
  • Margin floor. Any order whose discounts, freight, and fees drop net margin below your threshold gets flagged or held before fulfillment.
  • MAP protection. If you sell brands with minimum advertised price agreements, the advertised price is a catalog and checkout setting. An order whose effective post-discount price fell below the MAP floor can be flagged before it ships, so you see the breach and fix the promo that caused it.

If you want the step-by-step on any of these, I wrote a separate piece on how to stop unprofitable orders in Shopify Plus.

What about Shopify's own tools

Native Shopify discount rules cannot see your cost, so on their own they cannot enforce a margin floor. Shopify Scripts got close with custom Ruby, but Scripts were shut down on June 30, 2026, and even before that they could not enforce true margin floors without a developer maintaining them. Functions is the replacement, and it is real, but it is a WebAssembly runtime you build and maintain, and it still only sees the cost data you sync into Shopify ahead of time. I broke down that trade-off in the Shopify Scripts replacement guide.

The two approaches are complementary. Use checkout rules for promotion logic. Use a post-order margin check for the orders that still come in below the floor.

How fast you can have it on

You do not rebuild checkout for this, because nothing runs in checkout. Agentis reads your store's orders and your ERP cost data, and the natural first step is observe-only: flag every order that would have been held, without holding any. You see the leak in real numbers before you enforce anything, then turn on automatic holds for the rules you trust.

FAQ

Does this slow down checkout? No. Agentis does not run in checkout. It checks each order after it is placed, within 60 seconds, so the customer's checkout is untouched.

Will it block sales? No. The customer places the order normally. A below-floor order is flagged, or held before fulfillment under rules you approve, and your team decides whether it ships.

Do I need to change my checkout code? No. There are no storefront or checkout edits.

Can it stop a stacked discount at checkout? No. That is a checkout rule's job, through Shopify's discount combinations or a discount function. Agentis catches the orders that still land below your floor and stops them before they ship.

Where does the cost data come from? You can set COGS manually, but the accurate version pulls live landed cost from your ERP. If you run NetSuite, see the NetSuite COGS integration.


If your blended margin is drifting down and you cannot point to why, it is almost always happening one stacked-discount order at a time. You can keep finding out at month-end, or catch each one before it ships.

See it run on your own catalog: start a free trial. Or read how the Shopify Plus profit analytics side fits together.

Frequently Asked Questions

What is the difference between margin reporting and margin enforcement?
Margin reporting tells you what already happened, usually surfacing unprofitable orders in a month-end report after it's too late to act. Margin enforcement acts on each order in the window between order placed and order shipped: it computes the order's real costs and flags or holds it before fulfillment if it falls below the floor, so unprofitable orders are caught before they ship rather than discovered weeks later.
Does enforcing a margin floor hurt my conversion rate?
Not when the check runs after checkout. Agentis evaluates each order after it is placed, so the shopper's checkout is unchanged and nothing is added to it. Below-floor orders are flagged or held before fulfillment for your team to review. Any conversion effect only comes later, if you decide to change a promotion based on what the flagged orders show.
How fast does margin enforcement run, and does it need custom checkout code?
Agentis computes each order's true net margin (COGS, freight, fees, FX, and the full discount stack) within 60 seconds of the order being placed. It works from order data after checkout completes, so it needs no checkout code changes and does not deploy anything into Shopify checkout.
How long does it take to set up margin enforcement on a Shopify store?
It depends on your data setup. The Agentis team connects your store's order data and your cost sources (for example Oracle NetSuite, often via Celigo), then you run in flag-only mode, observing which orders would be held, before turning on automatic holds. Agentis is not yet listed on the Shopify App Store; contact the team for onboarding.
Share

Get margin insights weekly

One email per week on per-order profitability, ecommerce margin strategy, and Shopify Plus optimization. No spam.