Systems and records
How do you test whether an agent stacks promotions within the rules?
By SourceX Editorial · Updated
9 sections
Short answer
Test promotion stacking by freezing a cart at an exact instant, attaching every promotion version live then with its combination settings, priority and limits, and asking the agent for the valid set, order and per-line adjustments. A retail promotion stacking dataset grades that answer against the store's own engine and includes cases where only one promotion, or none, applies.
Agent run
Retail promotion stacking
Key takeaways
- Stacking logic is engine-specific, so record the platform and the settings that drive it for every task.
- Store promotions as versions with start and end instants and time zones; the valid answer can flip at a boundary.
- Sample by interaction type and keep negative cases, because a test without them cannot measure over-applied discounts.
- Grade the promotion set, order, per-line adjustments and reason codes, and repeat runs to measure reliability.
- Check historical orders against an engine replay before using them as labels; overrides and defects distort them.
How do you test whether an agent combines promotions within the applicable rules?
Give the agent a frozen cart, an exact timestamp and every promotion that was live at that moment with its combination settings, priority, eligibility and limits, then ask for the set of promotions that may apply, the order they apply in and the adjustment on each line. Grade that answer against what the store's own discount engine would do, and include cases where the right answer is that only one promotion applies, or none.
The hard part is not arithmetic. It is that stacking rules live in platform settings that differ by engine, and that effective dates turn a valid stack into an invalid one at a boundary the agent cannot see unless the data records it. A retail promotion stacking dataset is useful only when it captures both: the interaction rules and the time window each promotion version was live.
This guide sets out a template for a promotion interaction and effective date dataset, the interaction types worth sampling, an illustrative worked example with an exception, and the limits that tell you when a historical order is not a safe label. It is written for retail and ecommerce teams that hold promotion configurations and years of discounted orders.
Why the dataset has to record each discount engine's own stacking logic
There is no single industry rule for which promotions combine; each platform encodes its own. An agent that has learned one engine's behavior will make confident mistakes on another, so the dataset must name the engine and store the settings that drive its decisions.
Shopify groups discounts into product, order and shipping classes, lets each discount state which classes it combines with, applies product discounts first, then order discounts to the reduced subtotal, then shipping discounts, and allows up to five product or order discount codes plus one shipping code on an order. Adobe Commerce applies cart price rules by priority, lowest number first, and a rule set to discard subsequent rules stops lower-priority rules from applying to the products it matches. WooCommerce exposes a coupon's individual use flag, which removes other applied coupons, and an exclude sale items flag, which keeps the coupon off items that carry a sale price.
| Behavior | Shopify | Adobe Commerce | WooCommerce |
|---|---|---|---|
| How combinations are allowed | Per discount, by class: product, order, shipping | Rule priority plus a discard subsequent rules setting | Coupon individual use flag; sale item exclusion |
| Order of application | Product, then order on the reduced subtotal, then shipping | Lowest priority number first; equal priorities apply separately by rule id | Record the observed order from order coupon lines |
| Effective dates | Active dates in the admin time zone; no end date means no expiry | From and to dates on the rule | Coupon expiry and sale price dates in the site time zone |
| Usage limits | Code count limits per order | Uses per coupon and per customer | Total uses, uses per customer, items per coupon |
| Thresholds | Minimum purchase requirements on the discount | Conditions on subtotal or quantity | Minimum and maximum order amounts |
Where effective dates break a promotion stack
Timing errors are a distinct class of stacking error: a promotion that ended at midnight in one time zone, a sale price that started after the cart was built, or a promotion edited mid-campaign. The dataset should treat each promotion as a series of versions with start and end instants, not as one row with today's settings.
The platforms make time zone a first-class fact. Shopify's help center says a discount's start and end follow the time zone selected in the admin and that a discount with no end date does not expire. WooCommerce documents coupon expiry and product sale price start and end dates in the site's time zone, with separate GMT fields for the expiry. Store both forms where the platform provides them, and record the customer's local time separately so boundary tasks can be built on purpose.
Dates also matter for what an agent may say. The FTC's Guides Against Deceptive Pricing treat a former price as a legitimate basis for a comparison when the article was openly offered at that price for a reasonably substantial period, so an agent that invents a was-price from a short-lived configuration can create a claim the business would not make. Keep reference prices and their history in the dataset if agents will describe savings, and route pricing claims to the business's own review.
- Cart built before a promotion ends, checkout completed after it ends.
- Promotion edited during its window: value, eligible products or combination settings changed.
- Sale price and coupon windows that overlap for only part of a day.
- Promotion with no end date that was later deactivated by hand.
- Reactivated promotion whose new window differs from the original.
What should the promotion interaction and effective date dataset include?
One task is one cart at one instant, joined to the promotion versions live at that instant. The field groups below can be filled from the platform's discount configuration, its change history, the order records and customer service logs, and used as the dataset template as is.
Express adjustments as which lines were discounted, by which promotion, and as a proportion of the line price, rather than as currency amounts. That keeps the dataset comparable across price changes and makes the expected answer independent of the catalog's price level.
| Field group | Fields | Source record | Why it is needed |
|---|---|---|---|
| Promotion master | Promotion id, engine, type, class, value form, eligible products, customer segments | Discount or price rule configuration | Defines what each promotion could touch |
| Combination settings | Combines-with classes, priority, discard subsequent flag, individual use flag, sale item exclusion | Same configuration, versioned | The rules the agent must apply |
| Version window | Version id, start and end instants with time zone, editor, change reason | Admin change log or audit trail | Decides which version was live at checkout |
| Limits | Total uses, uses per customer, items per coupon, minimum and maximum order thresholds, usage count at the task instant | Configuration plus usage counters | A valid stack can fail on an exhausted limit |
| Cart snapshot | Lines, quantities, sale price status, customer segment, cart and checkout timestamps | Cart or order record, sale price history | The starting state, frozen at one instant |
| Expected result | Valid promotion set, application order, per-line adjustment as a proportion, rejected promotions with reason codes | Engine replay in a sandbox, reviewed | The label the agent is graded on |
| Observed history | Promotions actually applied, manual overrides, later price adjustments | Order discount lines, service notes | Shows where history disagrees with the rules |
| Outcome evidence | Complaints, price adjustment refunds, promotion error tickets within a set period | Helpdesk and payments | Flags orders whose discounts were later corrected |
Which promotion interactions should the test sample?
Sample by interaction type, because ordinary orders with a single coupon will swamp any random draw. Each type below changes the valid action in a way the agent can only detect from a specific field, which is what makes it a useful test.
Keep a share of tasks where no promotion applies, or where the customer asks for one that is not allowed. An agent may over-apply discounts, and a test with no negative cases cannot measure that.
- Compatible stack: two promotions whose settings allow combination on the same order.
- Mutually exclusive pair: an individual use coupon or a non-combinable class removes the other promotion.
- Priority cut-off: a higher-priority rule with discard subsequent rules set blocks a lower one on the matched items.
- Threshold slip: a product discount lowers the subtotal below an order promotion's minimum.
- Sale item exclusion: a coupon skips lines that already carry a sale price.
- Shipping conflict: a shipping discount that cannot combine with the product or order discount in the cart.
- Boundary instant: checkout within minutes of a start or end time, in the store's and the customer's time zones.
- Exhausted limit: a per-customer or total usage limit reached before the task instant.
Worked example (illustrative): two promotions and a closing window
This example is illustrative and does not describe a real store. Discounts are shown as percentages and thresholds as item counts so no currency amounts are needed. It follows the answer format: conditions, evidence, expected result, then an exception.
- Conditions: an illustrative store whose engine applies product promotions before order promotions; cart of four items from one collection; checkout at 23:56 store time on the last day of Promotion A.
- Promotion A: a product-class discount of 20 percent (illustrative) on the collection, set to combine with order discounts, ending at 23:59 store time.
- Promotion B: an order-level bundle discount of 10 percent (illustrative) whose published terms require four items not already discounted, set to combine with product promotions.
- Evidence the agent needs: both promotion versions with windows and combination settings, the cart lines, sale price status and the checkout instant with time zone.
- Expected result: A applies first to all four lines; because B's terms exclude items that are already discounted, B is rejected with reason code threshold-not-met.
- Observed history check: confirm the historical order shows A only; if B appears, flag the order as an engine or configuration anomaly and exclude it as a label.
- Exception: the same cart checked out at 00:04 the next day, store time. Promotion A has ended, so the cart keeps four items at full price and meets the bundle threshold, and Promotion B now applies. The two tasks differ by eight minutes and produce opposite answers for B, which is the point: an agent must read the version window and the timestamp, not the promotion names.
How should the agent's promotion answer be graded?
Grade the structured answer, not the explanation: the promotion set, the order, the per-line adjustments and the reason codes for rejected promotions. Replaying the cart through the store's own engine in a sandbox, configured with the historical versions, gives an independent expected result that does not depend on whether staff got the original order right.
At a glance
How should the agent's promotion answer be graded
Run each task more than once. The tau-bench project reports agent reliability as pass^k across repeated trials, and the same idea applies here: an agent that stacks correctly on most runs but occasionally applies an excluded coupon will cost the business money and credibility at scale.
- Set match: the agent's valid set equals the expected set.
- Order match: application order matches the engine's documented order.
- Line match: every line's adjustment proportion matches, including lines that should get nothing.
- Reason match: each rejected promotion carries the right reason code.
- Repeat stability: pass^k across several runs, reported next to single-run accuracy.
When is a historical order not a safe label?
When the engine itself did not behave as configured, or when a person overrode it. Adobe's own knowledge base lists a quality patch for a case where discard subsequent rules did not work as expected, with the fix scheduled for Adobe Commerce 2.4.7. Orders placed under that behavior show what the platform did, not what the rules said, so record the platform version for each task and decide whether the label is the documented rule or the observed behavior.
Promotion data also needs care before it leaves the company. Configurations reveal pricing strategy and margins, and customer segment fields can encode loyalty status or other personal attributes. Tokenize customer identifiers, keep segments as coded categories, and have the commercial owner confirm which campaigns may be shared. Rights are a separate check: de-identification does not settle whether the company may license order data that came through a marketplace or a platform with its own terms, so counsel reviews those sources.
Promotion histories as licensed test material
Versioned promotion configurations joined to years of orders give commerce-agent tests the effective dates and combination settings they need. SourceX helps companies take selected records like these through qualification, rights review, contracting, preparation, delivery and payment when licensing them for AI.
Learning whether a company fits starts with a short assessment and requires sharing no promotion data. Before anything is delivered, the company approves the scope and terms in a signed agreement, which then marks the limits of SourceX's use, sublicensing and distribution of the de-identified dataset.
Frequently asked questions
What is a retail promotion stacking dataset?
It is a set of carts frozen at specific instants, each joined to the promotion versions live at that moment and their combination settings, with the valid promotion set, application order and per-line adjustments as the expected answer. It is used to train or test agents that apply or explain promotions.
Can two promotions apply to the same item?
It depends on the engine and its settings. Shopify limits combining multiple product discounts on the same item to Shopify Plus stores, Adobe Commerce resolves overlapping cart rules by priority and the discard subsequent rules setting, and a WooCommerce coupon marked for individual use removes other coupons.
Why do effective dates matter so much for promotion tests?
Because the valid answer can flip at a start or end instant, and platforms evaluate those instants in a configured time zone. A dataset that stores only today's promotion settings cannot reproduce what was valid when the order was placed.
Should historical orders be used as the answer key?
Only after checking them. Manual overrides, engine defects and later price adjustments mean an order can show a discount the rules did not allow; replaying the cart through a sandbox with historical settings gives a cleaner expected result.
What should be removed from promotion data before licensing it?
Customer identifiers, free-text notes and any segment fields that reveal personal attributes should be tokenized or coded. The business should also decide which campaign configurations are commercially sensitive, and counsel should confirm rights for marketplace or platform data.
Sources
- Shopify groups discounts into product, order and shipping classes, applies product then order then shipping discounts, and allows up to five product or order codes plus one shipping code per order, and limits combining several product discounts on the same line item to Shopify Plus stores. Source
- Shopify discount start and end times follow the time zone selected in the admin, and a discount with no end date does not expire. Source
- Adobe Commerce applies cart price rules by priority, lowest number first, and a rule set to discard subsequent rules prevents lower-priority rules from applying to the products it matches. Source
- Adobe's knowledge base lists quality patch ACSD-49480 for discard subsequent rules not working as expected, scheduled to be fixed in Adobe Commerce 2.4.7. Source
- The WooCommerce REST API documents coupon individual use, sale item exclusion, expiry in the site time zone, usage limits and minimum and maximum order amounts. Source
- The WooCommerce REST API documents product sale price start and end dates in the site time zone. Source
- The FTC Guides Against Deceptive Pricing treat a former price as a legitimate comparison basis when the article was openly offered at that price for a reasonably substantial period. Source
- The tau-bench repository reports agent reliability as pass^k over repeated trials. Source
See if your company qualifies
A short company assessment. No data uploads are needed.