New: a free Agentic Commerce Readiness Scorecard for peak season. Get the free tools
Back to insights

Promotions Architecture

Promotion Engines and Offer Agents: What Engineering Leaders Need to Govern

Share on LinkedIn
Promotion Engines and Offer Agents: What Engineering Leaders Need to Govern, with a promotion control map from rule ownership to rollback

A promotion engine used to be a feature. Now it is a distributed system, with discounts calculated by the platform, apps, loyalty tools and, increasingly, AI agents that propose offers on their own. That needs engineering governance, not just merchandising approval.

Executive Summary

Promotions Architecture | Published October 20, 2026

Promotions are one of the most direct ways a retail technology stack can lose money. A single untested stack of codes, automatic discounts and loyalty rewards can give away margin across thousands of orders before anyone notices. The problem is growing because discount logic is now spread across the commerce platform, apps, loyalty and subscription tools and, increasingly, AI offer agents that can propose or apply personalized offers. This article sets out what engineering leaders need to govern: who owns each discount rule, the order in which rules are evaluated, hard limits that no rule can break, scenario-based testing, an audit trail for every price change and a rollback path that works in minutes. It also covers the additional controls needed before an AI agent is allowed to create or apply offers.

Business decision Treat promotion logic as a governed system with owners and limits, not a merchandising setting.
Architecture focus One owner per rule, explicit evaluation order, hard margin and price floors, and full audit trails.
Value test Fewer margin incidents, faster safe launches and offer agents that can be trusted with real customers.

Key takeaways

  • Discount logic now lives in several places. Engineering must know every place a price can be reduced.
  • Write the evaluation order down. Stacking surprises usually come from rules that run in an order nobody chose.
  • Hard limits such as margin floors and maximum discount per order protect the business when other rules fail.
  • Test promotions with scenarios and combinations, not one code at a time.
  • Every price change needs an audit trail that explains which rule applied and why.
  • AI offer agents should propose within limits first, and apply offers only after evidence shows they stay inside them.

Promotions Are Now a Distributed System

In many retail organizations, promotions are seen as a merchandising activity. Merchandisers plan them, ecommerce teams configure them and engineering gets involved only when something breaks. That model worked when discounts lived in one place.

Today the logic that reduces a price is often spread across several systems. The commerce platform applies codes and automatic discounts. A loyalty tool applies rewards. A subscription app applies recurring discounts. A bundle or gift-with-purchase app applies its own logic. Customer service tools issue goodwill codes. Personalization tools target offers. And a growing number of retailers are piloting AI offer agents that recommend or apply incentives based on a customer's behaviour.

Each of these may be configured correctly on its own. Together they form a distributed system with shared state, the price of an order, and no single component that sees the whole picture. That is an engineering problem. It needs the same discipline engineering leaders apply to payments or inventory: clear ownership, defined behaviour, limits, testing, observability and recovery.

This article is the twenty-sixth in the JM Digital platform series. It builds on increasing AOV without margin damage, which covered the commercial side of offers, and on modular platforms and integration debt, where conflicting discount modules are a common cause of trouble.

Where Promotions Go Wrong

Promotion incidents follow a small number of patterns. Recognizing them helps engineering leaders design controls that prevent them rather than react to them.

  • Unintended stacking. A code, an automatic discount and a loyalty reward combine in a way no one approved, often because each was tested alone.
  • Scope leakage. A discount meant for one category or customer group applies more broadly because of an exclusion that was missed or a product tag that changed.
  • Evaluation order surprises. Percentage and fixed discounts applied in a different order produce different totals, and the order changes after an update.
  • Code leakage. A single-use or targeted code is shared publicly and used thousands of times.
  • Timing errors. A promotion starts early or ends late because of time zones or scheduling across systems.
  • Downstream mismatch. The discount shown at checkout differs from what the OMS, ERP or returns system records, causing refund errors and reconciliation problems.
  • Rounding and currency issues. Small differences multiplied across markets and currencies create real money.

Know Every Place a Price Can Change

The first governance step is simply knowing every component that can reduce a price or change what a customer pays. Many engineering leaders are surprised by the length of the list.

For each component, record what it can change (item price, order total, shipping, tax base), what triggers it, who configures it, how it integrates with the platform's price calculation and whether its changes flow correctly to the OMS, ERP and returns systems. This inventory is a subset of the stack inventory described in the modular platforms article, focused on money.

Where possible, consolidate. Platforms increasingly provide supported ways to extend discount logic in one place. Shopify, for example, provides Function APIs that let developers customize discounts within the platform's own calculation, which is generally safer than separate apps each applying their own adjustments. Salesforce Commerce Cloud has its own promotion engine and rules. Whatever the platform, the goal is fewer places where a price can change, each with a clear owner.

A discount source inventory, with typical examples
SourceWhat it can changeUsually configured by
Native platform promotions and codesItem price, order total, shippingMerchandising or ecommerce
Discount apps and custom functionsItem price, order totalEcommerce, with engineering
Loyalty rewards redeemed at checkoutOrder total, and the points earnedLoyalty or CRM team
Service goodwill codes and creditsOrder total or a refundCustomer service
Gift-with-purchase offersThe cost of the order, not the priceMerchandising
Price overrides in POS or the OMSItem price after the orderStores and operations

The Promotion Control Map

The map below summarizes the controls engineering leaders should have in place for any promotion system, whether rules are written by people or proposed by an AI offer agent.

Write the Evaluation Order Down

When several discounts apply to one order, the order in which they are calculated changes the result. Twenty percent off followed by ten dollars off gives a different total from ten dollars off followed by twenty percent. Whether a loyalty reward applies before or after a code changes both the customer's price and the points they earn. Whether shipping discounts apply before or after order-level discounts changes thresholds.

Most platforms have a defined evaluation order for their native promotions, documented in their help or developer resources. Problems arise when additional components apply discounts outside that order, or when the order is not understood by the people configuring promotions.

Write the evaluation order down in plain language, including which types of discount can combine and which cannot. Make it the reference for merchandisers, engineers and testers. Then enforce it in one place. If a component cannot respect the order, it should not be allowed to change prices directly.

How Platforms Decide Which Discounts Combine

Every commerce platform has its own model for deciding which promotions apply together, and the evaluation order you write down has to match it. Teams get into trouble when they design promotions in one mental model and configure them in another.

Shopify groups discounts into product, order and shipping classes. Each discount carries its own combination settings that say which other classes it may combine with, and custom logic built with Shopify Functions follows the same class rules. Salesforce Commerce Cloud uses promotion classes too, adds an exclusivity setting on each promotion (no exclusivity, exclusive within its class, or globally exclusive) and uses rank to settle conflicts between promotions that cannot apply together. Both platforms will apply a combination nobody intended if the settings allow it, because the platform cannot know the margin rule behind the campaign.

The practical rule is to document the intended behaviour in business language first, then translate it into the platform's settings, then test the translation. Keep the two documents side by side so a merchandiser can read the first and an engineer can verify the second.

Translating promotion intent into platform settings
Business intentWhat to configureWhat to test
Clearance items take no further discountExclude clearance collections or categories from product and order discountsA clearance item with a sitewide code applied
Free shipping can stack with any product discountAllow the shipping discount to combine with product discountsFree shipping threshold met only after a product discount
Only one order-level discount per basketOrder discounts set not to combine with each other, or exclusive within their classTwo order-level codes entered in sequence
Loyalty reward applies after all promotionsLoyalty discount evaluated last, capped at a margin floorReward redeemed on a basket that is already heavily discounted
Employee discount never combinesGlobally exclusive, or excluded from every combinationEmployee discount with an automatic promotion running

Hard Limits Are the Last Line of Defence

No amount of testing will catch every combination. Hard limits are controls that apply regardless of which rules fired, and they protect the business when something unexpected happens.

  • Margin floor by category or product: the price after all discounts may not fall below a defined margin.
  • Maximum discount per order, as a percentage and an absolute amount.
  • Maximum discount per customer over a period, which limits abuse of codes and goodwill credits.
  • Price floor for specific items, such as new launches or limited products, that no promotion may breach.
  • Velocity alerts when a code or promotion is used far faster than forecast.

Limits should be owned by finance and merchandising together and implemented by engineering in the place where the final price is calculated. When a limit is hit, the system should cap the discount and record the event, not fail the order.

Test Combinations, Not Codes

Promotions are often tested one at a time: does this code give twenty percent off eligible items? That test passes, and the incident happens when the code combines with an automatic discount and a loyalty reward on a basket with an excluded item.

Build a combination test matrix for every significant promotion. Cross the promotion with the other discount sources that could be active at the same time, with representative baskets that include excluded items, sale items, gift cards, multiple currencies and different customer types. Include returns and partial refunds, because the way a discount is allocated across lines determines what a customer gets back.

Automate the matrix where you can. Many retailers maintain a set of test baskets and expected totals that run before every promotion launch and every platform or module update. It is one of the highest-return automated test suites in retail engineering.

Building a Promotion Test Matrix

Testing each promotion on its own proves almost nothing. Failures come from combinations: a code meeting an automatic discount, a bundle meeting a threshold, a return reversing only half of a stacked discount. A test matrix makes those combinations explicit and repeatable.

Build the matrix from dimensions rather than from promotions. Each dimension below has a handful of values, and the riskiest combinations come from crossing them. You do not need every cell; you need the combinations that touch margin, tax and refunds.

  • Write the expected total for each combination before running the test, so a pass means something.
  • Automate the twenty or thirty combinations that carry the most revenue and rerun them after every promotion or app change.
  • Include partial returns in the matrix. Proportional refund of a stacked discount is the most common error that reaches finance.
Dimensions for a promotion test matrix
DimensionValues to includeWhy it matters
Discount typesAutomatic, code, loyalty reward, gift card, employeeDifferent types are evaluated at different points
Basket shapeSingle item, mixed full price and sale, bundle, threshold just metThresholds and exclusions behave differently at the edges
CustomerGuest, logged in, loyalty tier, B2B or wholesale accountEligibility and price lists change by customer
FulfilmentShip, pickup, split shipmentShipping discounts and tax apply per shipment
Market and currencyEach live market, rounding rulesRounding and tax inclusive prices change the totals
After purchaseFull return, partial return, exchangeRefunds must reverse the discount proportionally

Audit and Observability

When a customer, a store or finance asks why an order was priced the way it was, the answer should be available in minutes. That requires an audit trail that records, for each order line, which discounts applied, in what order, from which source and under which rule version.

Observability should also work in real time. Monitor discount rate by promotion and overall, average discount per order, margin per order and code usage velocity. Alert when they move outside expected ranges. Many promotion incidents could have been stopped within an hour if someone had been alerted when the discount rate doubled.

Audit data matters downstream too. The OMS, ERP and returns system need the line-level discount allocation to calculate refunds and report margin correctly. If they only receive an order total, mismatches are inevitable.

Rollback in Minutes

When a promotion is misbehaving, the most important capability is to stop it quickly. Every promotion should be disableable in minutes by an authorized person without a code deployment. Document who can do it, how and how customers with the offer in their cart will be treated.

Rehearse it before peak. A rollback that has never been used tends to fail when it matters, because a permission is missing or a cache holds the old rules. The peak-week checklist includes promotion stacking and rollback for this reason.

Governing AI Offer Agents

AI offer agents are systems that recommend, create or apply incentives, often personalized to an individual customer. They can be valuable: an agent that offers free shipping only to customers who would otherwise abandon, rather than to everyone, can protect margin. They also introduce new risks, because the agent may combine offers or target customers in ways no person reviewed.

The controls above all apply. On top of them, use a permission ladder. At the first level, the agent proposes offers that a person approves. At the second, the agent applies offers from a pre-approved menu, within hard limits. At the third, the agent can create new offers within tightly defined parameters. Move up only when evidence from the previous level shows that offers stay within limits, perform better than a simple rule and do not create unfair or confusing outcomes for customers.

Pay attention to fairness and transparency. Personalized offers can raise questions if similar customers receive very different prices without a clear reason. Your legal and compliance teams should review how offers are targeted, and the NIST AI Risk Management Framework is a useful voluntary reference for documenting the risks. In Canada, price comparisons and regular price claims are also subject to Competition Bureau guidance on ordinary price claims, which applies whether a person or an agent writes the offer.

Shopping agents on the customer side add another dimension. As platforms extend checkout into AI agents, as Shopify's Fall 2026 Edition did, those agents can test codes and combinations quickly. That makes hard limits and velocity alerts more important, not less.

An Illustrative Incident and What Would Have Prevented It

Imagine an illustrative retailer running a weekend promotion: twenty-five percent off outerwear with a code. On the same weekend, an automatic free-gift-with-purchase offer is active, and the loyalty program is running double points that can be redeemed as a discount. A customer service goodwill code has also been posted on a deal-sharing site.

By Saturday afternoon, some orders are combining all four, with total discounts above sixty percent on full-price items. The issue is noticed on Monday when the finance team reviews weekend margin.

Each control in this article would have caught or limited it. A discount source inventory would have shown four active sources. A written evaluation order and combination matrix would have revealed the stack before launch. A margin floor would have capped the discount on every affected order. A velocity alert on the goodwill code would have fired within an hour. A kill switch would have stopped the combination as soon as it was spotted. None of these require a new platform. They require engineering ownership of promotions as a system.

Waterfall showing a full-price order reduced by an outerwear code, redeemed double points, a leaked goodwill code and a free gift, leaving the business with under 40% of full price
The incident in this section, on one order. Illustrative.

Refunds, Returns and Reporting

Many promotion problems appear after the order. A customer returns one item from a buy two get one free offer: what should they be refunded? A loyalty reward was applied to an order that is partly cancelled: does the reward come back? A free gift was included: does it have to be returned? Each answer depends on how the discount was allocated across order lines when the order was placed.

Engineering should make sure that every discount is allocated to lines in a consistent, documented way, and that the allocation travels with the order to the OMS, ERP and returns systems. Without it, refunds are calculated differently by each system, customers receive inconsistent amounts and finance cannot reconcile margin by product or promotion.

Write the return and refund rules for each promotion type alongside the promotion itself, test them in the combination matrix and include them in customer service guidance. Reporting benefits too: when line-level allocation is consistent, the business can see the true margin impact of each promotion, which feeds directly into the offer reviews described in the AOV article.

Peak Season Promotion Readiness

Black Friday, Cyber Monday and holiday weeks combine the most promotions, the highest traffic and the least tolerance for error. Treat them as a special case.

Freeze changes to discount logic, apps and evaluation order several weeks before peak. Run the full combination matrix against every planned peak promotion, including the ones scheduled to overlap. Confirm hard limits and velocity alerts are active, and lower alert thresholds where the business would rather investigate early. Rehearse the kill switch with the people who will be on call. Agree in advance who can disable a promotion during peak without seeking further approval, because waiting for a meeting while margin leaks is the most expensive delay of the year.

Common Questions About Promotion Governance

Who should own promotion governance: merchandising or engineering?

Both, with different responsibilities. Merchandising owns the commercial intent of each promotion. Finance and merchandising own the hard limits. Engineering owns the system: where rules run, the evaluation order, testing, audit, monitoring and rollback. Incidents happen most often when engineering ownership is missing.

Will these controls slow down promotion launches?

Initially they add some setup work. Once the discount inventory, evaluation order, limits and automated test baskets exist, most promotions launch faster because teams spend less time debating edge cases and recovering from incidents.

Should we buy a dedicated promotion engine?

Only if your promotional mechanics genuinely exceed what your platform and its supported extension points can handle, and you can own the engine and its integration. For many retailers, consolidating discount logic into the platform's native engine with careful extensions is safer and cheaper.

When is it safe to let an AI agent apply offers?

When hard limits are enforced in the final price calculation, the agent chooses from a pre-approved menu, every applied offer is audited and you have evidence from a proposal-only phase that the agent's choices perform better than a simple rule and stay within limits.

The JM Digital Perspective

Promotions are where the gap between merchandising intent and system behaviour is most expensive. Closing that gap does not require a new platform. It requires engineering leaders to treat promotion logic as a system they own, with the same rigour they apply to checkout and payments.

My recommendation is to start with the discount source inventory and the written evaluation order this month, then add hard limits before your next major promotional period. If an AI offer agent is on your roadmap, put the permission ladder in place before the pilot, not after the first surprise. The next article in this series looks at the architecture behind customer lifetime value, where offer decisions meet long-term customer economics.

Related reading

Continue the production-readiness path

These connected JM Digital Corp insights add architecture, data, workflow, and delivery context around the AI series.

Read next Increasing AOV Without Margin Damage: The Data, Offer, and Governance Problem Read next Nobody Owns the Agent After It Starts Acting Read next Real-Time Personalization Without Constant Discounting

Research references

This article is grounded in current platform, standards, and industry material. The links below are included for readers who want source context behind the recommendations.

Govern promotions before an agent touches them

The AI Production Readiness Kit includes the promotion control checklist, scenario test matrix and offer agent permission ladder used in this article. Book 30 minutes if a promotion incident or an offer agent pilot is on your agenda.

Get the free AI Readiness Kit Book a 30-minute call