How to Test Coupons, Discounts, Taxes and Shipping Rules
E-commerce pricing is rarely as simple as:
Product Price × Quantity = Total
The final amount a customer pays may depend on:
- coupon codes;
- automatic discounts;
- quantity discounts;
- sale prices;
- tax rules;
- customer location;
- shipping methods;
- free-shipping thresholds;
- product eligibility;
- promotion stacking.
The difficult part is not testing each rule individually.
The difficult part is verifying that those rules interact correctly.
For example:
Does free shipping use the subtotal before or after a coupon?
Is tax calculated before or after the discount?
Can two promotions be combined?
What happens if the cart drops below a threshold after a product is removed?
A small calculation defect can affect:
- customer trust;
- revenue;
- profitability;
- tax reporting;
- payment reconciliation;
- refunds.
The core QA principle is:
Know the expected amount before executing the test.
Then compare that amount through the complete transaction:
Cart → Checkout → Payment → Order → Confirmation
For the broader e-commerce framework, see E-commerce Website Testing Checklist.
Start With the Business Rules
Before testing calculations, understand how the store is supposed to behave.
Do not assume there is one universal e-commerce formula.
Different stores may define rules differently.
For example:
- discounts may apply before tax;
- tax may be calculated before discounts;
- shipping may be taxable;
- free shipping may use the original subtotal;
- free shipping may use the discounted subtotal;
- sale items may be excluded from coupons;
- multiple coupons may be prohibited.
QA needs the actual business rule before deciding whether the result is correct.
Map the Order Calculation
Document the intended calculation order.
A simplified example might be:
Product Subtotal
− Discount
+ Tax
+ Shipping
= Final Total
Another implementation may calculate some parts differently.
The important point is not to assume the sequence.
Write it down.
Create a Manual Calculation Reference
Before testing complex scenarios, create simple values that can be checked manually.
Example:
Product: $100
Coupon: 10%
Shipping: $10
Tax: 20%
Suppose the business rule says:
- discount applies before tax;
- shipping is not taxable.
Then:
Subtotal: $100
Discount: −$10
Taxable amount: $90
Tax: $18
Shipping: $10
Expected total: $118
Now QA has a known expected result.
This is much stronger than:
The total looks about right.
Verify the Basic Subtotal First
Before introducing discounts, tax, or shipping complexity, verify:
Price × Quantity
Example:
Product price: $25
Quantity: 3
Expected subtotal:
$75
If the basic cart calculation is already wrong, more complex pricing tests become unreliable.
For deeper cart testing, see Shopping Cart Testing.
Coupon Testing
Coupons introduce several types of logic:
- discount amount;
- validity;
- eligibility;
- thresholds;
- usage limits;
- stacking;
- recalculation.
Test these systematically rather than with one successful code.
Test Fixed-Amount Coupons
Example:
SAVE10 = $10 off
For a $100 eligible subtotal:
Expected discount: $10
Expected discounted subtotal: $90
Then test:
- low-value carts;
- large carts;
- excluded products;
- minimum-order requirements.
Check whether the discount can ever reduce the eligible amount below allowed limits.
Test Percentage Coupons
Example:
SAVE20 = 20% off
For $100:
Expected discount: $20
For $53:
Expected discount: $10.60
Percentage discounts are especially useful for finding:
- rounding defects;
- precision defects;
- inconsistent tax calculation.
Test Decimal and Rounding Behavior
Use values that do not produce clean whole-number results.
Example:
Subtotal: $49.99
Discount: 15%
Raw discount:
$7.4985
The application must apply its defined currency-rounding rule.
If that becomes:
$7.50
verify the same rounded value across:
- cart;
- checkout;
- order;
- payment provider.
A one-cent mismatch can create real payment and accounting problems.
Test Coupon Validity
Group validity checks together.
Test:
- valid coupon;
- invalid coupon;
- expired coupon;
- coupon before its start date;
- exact start/end boundary;
- case variations;
- leading/trailing spaces.
For example:
SAVE20
save20
[SAVE20 ]
[ SAVE20]
The expected behavior should follow the store’s actual rule.
Do not assume coupon codes are case-insensitive or automatically trimmed unless that behavior is defined.
Test Date and Time Boundaries
If a coupon expires at midnight, clarify:
- which timezone applies;
- whether the expiration date is inclusive;
- whether expiration occurs at 00:00 or 23:59.
Test directly around the boundary.
Time-based promotions often fail because of configuration or timezone assumptions.
Test Minimum Order Thresholds
Suppose:
Minimum subtotal = $50
Test:
- $49.99;
- $50.00;
- $50.01.
This is classic boundary testing.
Do the same around every important pricing threshold.
Test Maximum Discount Caps
Example:
20% off, maximum discount $50
Test:
$100 subtotal → $20 discount
$250 subtotal → $50 discount
$500 subtotal → still $50 discount
This verifies both normal calculation and the cap.
Coupon Eligibility
Coupons often apply only to part of the cart.
This is an important source of pricing bugs.
Test Product and Category Eligibility
Create carts containing:
- eligible product;
- ineligible product;
- both together.
Example:
Eligible Product: $80
Excluded Product: $20
Coupon: 10%
If only the $80 product qualifies:
Expected discount: $8
not:
$10
Also test category-based rules where relevant.
Test Excluded Items
Common exclusions include:
- sale items;
- gift cards;
- subscriptions;
- selected categories;
- selected brands.
Verify excluded items do not accidentally contribute to the discount.
Test Mixed Carts
Mixed eligible/ineligible carts are more valuable than testing only fully eligible orders.
They expose whether the system correctly calculates:
- eligible subtotal;
- excluded subtotal;
- discount amount;
- final taxable amount.
Coupon Usage Limits
Promotional codes may be limited by:
- total usage;
- usage per customer;
- usage per order.
Test the exact boundary.
Example:
Maximum uses per customer = 1
First completed order:
Coupon accepted
Second completed order:
Coupon rejected
Test Guest Usage Rules
If guest users can use coupons, determine how customer identity is tracked.
Possible identifiers include:
- email;
- account;
- order history.
Do not assume the implementation.
Test against the intended business rule.
Test Single-Use Coupons After Failed Transactions
For a one-time coupon:
Unused → Applied → Payment Fails
What happens next?
Should the coupon:
- remain consumed;
- become available again?
This is an important business decision.
Test it explicitly.
Coupon State Changes
Pricing rules should recalculate when cart state changes.
Test Coupon Removal
Apply a coupon, then remove it.
Verify:
- discount disappears;
- tax recalculates;
- shipping recalculates where relevant;
- final total returns to the correct value.
Test Coupon Replacement
Apply Coupon A.
Then apply Coupon B.
Possible rules:
- B replaces A;
- both apply;
- B is rejected.
The system should behave consistently with the defined stacking rules.
Test Multiple Coupons
If stacking is supported, order can matter.
For example:
10% off → then $10 off
may produce a different value than:
$10 off → then 10% off
The store should have a defined calculation order.
Test it.
Test Stacking Restrictions
If coupons cannot be combined, verify:
- second code is rejected;
- first code remains active;
- customer receives a clear message;
- total does not change incorrectly.
Automatic Discounts and Promotions
Not every discount uses a coupon code.
Common automatic rules include:
- sale prices;
- member pricing;
- quantity discounts;
- tiered discounts;
- seasonal promotions;
- BOGO offers.
Test Sale Price + Coupon Interaction
Suppose:
Regular price: $100
Sale price: $80
Coupon: 10%
Possible rules:
$80 − 10% = $72
or:
Coupon not allowed on sale products
Neither is universally correct.
Verify the configured rule.
Test Quantity and Tiered Discounts
Example:
1–4 units → no discount
5–9 units → 10%
10+ units → 20%
Test around every transition:
- 4 / 5;
- 9 / 10.
Boundary tests are more valuable than testing only the middle of each tier.
Test BOGO Rules
For:
Buy one, get one free
or:
Buy two, get the cheaper item free
test combinations such as:
- 2 items;
- 3 items;
- 4 items;
- different prices;
- mixed eligible/ineligible products;
- different variants.
Example:
Product A: $50
Product B: $30
If the cheaper product should be free:
Expected discount: $30
Tax Testing
Tax should first be tested independently before combining it with discounts and shipping.
Verify the Basic Tax Calculation
Example:
Subtotal: $100
Tax rate: 20%
Expected:
Tax: $20
Total: $120
Once this works, add complexity.
Identify What Determines the Tax Rate
Tax may depend on:
- shipping address;
- billing address;
- store location;
- customer tax status;
- product type;
- tax class.
QA should never guess which rule applies.
Use documented requirements and configuration.
Test Location Changes
Use representative addresses from different tax regions.
Example:
Address A → 8%
Address B → 10%
Then change the address during checkout.
Verify the tax recalculates correctly.
Stale tax values are a common checkout defect.
Test Taxable and Non-Taxable Products
Create mixed carts containing:
- taxable item;
- tax-exempt item.
Verify tax applies only where intended.
Test Multiple Tax Classes
If the store uses:
- standard rate;
- reduced rate;
- digital rate;
create carts containing products from multiple classes.
The final tax should equal the defined calculation across those classes.
Test Discount + Tax Interaction
This is one of the highest-value combined scenarios.
Example:
Subtotal: $100
Discount: $20
Tax: 20%
Does tax apply to:
$100
or:
$80?
The correct answer depends on the business rule and applicable tax configuration.
Test the expected implementation, not an assumption.
Test Shipping Tax
Shipping may be:
- taxable;
- non-taxable;
- taxed at a separate rate.
Example:
Products: $100
Shipping: $10
Tax: 20%
If both are taxable:
Taxable amount: $110
Tax: $22
If shipping is not taxable:
Tax: $20
Verify the actual configured rule.
Test Tax Rounding
Rounding can differ depending on whether tax is calculated:
- per item;
- per line;
- on subtotal;
- on final taxable total.
Use low-value and decimal-heavy products to reveal differences.
Most importantly, verify that:
cart tax = checkout tax = order tax
unless the system intentionally represents values differently.
Shipping Rule Testing
Shipping logic can depend on:
- destination;
- subtotal;
- weight;
- quantity;
- shipping class;
- customer group;
- promotion.
Test Shipping Methods
Verify:
- correct methods appear;
- prices are correct;
- unavailable methods are hidden;
- selected method persists;
- total updates when method changes.
Typical examples:
- Standard;
- Express;
- Local Pickup.
Test Shipping Zones
Use addresses from different:
- countries;
- states;
- regions;
- postal codes.
Confirm the correct shipping methods and prices appear.
Also test unsupported locations.
The system should explain clearly when delivery is unavailable.
Test Free-Shipping Thresholds
Suppose:
Free shipping at $100
Test:
- $99.99;
- $100.00;
- $100.01.
Do not test only a $150 order.
Boundary behavior is the point of the rule.
Test Free Shipping After Discounts
Example:
Original subtotal: $105
Coupon: −$10
Discounted subtotal: $95
Free shipping threshold: $100
Does free shipping remain?
Possible rules:
Rule A: threshold uses original subtotal → Yes
Rule B: threshold uses discounted subtotal → No
This interaction must be defined and tested.
Test Shipping Recalculation After Cart Changes
Start with an order that qualifies for free shipping.
Then remove a product.
If the new cart falls below the threshold:
- shipping method should recalculate;
- shipping price should update;
- final total should update.
The reverse scenario should also be tested:
Add an item and cross the free-shipping threshold.
Boundary Testing
Boundary testing is one of the most important techniques for pricing QA.
Whenever a rule has a threshold, test:
just below → exactly at → just above
Examples:
Coupon Minimum
$49.99 / $50.00 / $50.01
Free Shipping
$99.99 / $100.00 / $100.01
Quantity Discount
4 / 5 / 6 items
Maximum Discount Cap
just below / exactly at / above the cap
Promotion Dates
just before / exactly at / just after start and expiration
Pricing bugs often exist at transitions rather than normal values.
Test Rules Together
Testing each rule independently is necessary.
It is not sufficient.
The highest-value scenarios combine rules.
For example:
coupon + discounted subtotal + tax + shipping threshold
Suppose:
Products: $120
Coupon: −20%
Discounted subtotal: $96
Free shipping threshold: $100
Tax: 10%
QA needs to know:
- does shipping remain free?
- what amount is taxable?
- is shipping itself taxable?
- what is the expected final total?
This is where many pricing defects appear.
Build a Small Combination Matrix
You do not need every theoretical combination.
Prioritize high-risk interactions.
For example:
| Scenario | Coupon | Tax | Shipping |
|---|---|---|---|
| Baseline | None | Standard | Standard |
| Percentage Discount | 20% | Standard | Standard |
| Free Shipping Boundary | None | Standard | Threshold |
| Discount + Free Shipping | 10% | Standard | Threshold |
| Discount + Tax | Fixed | Alternate Region | Standard |
| Full Combination | Percentage | Alternate Region | Threshold |
This gives strong coverage without combinatorial explosion.
Verify the Complete Transaction
Do not stop at the cart.
A correct cart value can become incorrect later.
Verify:
Expected Amount → Cart → Checkout → Payment → Order → Confirmation
All important monetary values should remain consistent.
Cart
Verify:
- subtotal;
- discount;
- tax estimate;
- shipping where available;
- total.
Checkout
Verify recalculation after:
- address changes;
- shipping method changes;
- coupon changes;
- cart edits.
Payment
Confirm the payment provider receives the expected amount.
For deeper transaction testing, see Payment Testing for E-commerce Websites.
Order Record
Verify the stored order contains the correct:
- subtotal;
- discount;
- tax;
- shipping;
- total.
A customer-facing display can be correct while backend order data is wrong.
Confirmation
Where relevant, verify:
- confirmation page;
- confirmation email;
- invoice;
- receipt.
These should reflect the same transaction.
Example Pricing Defects
Coupon Eligibility Bug
Expected Result:
The 20% coupon applies only to full-price products.
Actual Result:
The coupon also discounts an excluded sale item.
Tax Recalculation Bug
Expected Result:
Changing the shipping address to Region B should update tax from $8 to $10.
Actual Result:
Tax remains $8 after the address change.
Free-Shipping Boundary Bug
Expected Result:
Free shipping should apply at a discounted merchandise subtotal of $100 or more.
Actual Result:
A cart totaling exactly $100 still receives a $7.99 shipping charge.
Payment Amount Mismatch
Expected Result:
Checkout and payment provider should both use a final total of $47.62.
Actual Result:
Checkout displays $47.62, but the payment provider receives $47.63.
Even a one-cent discrepancy should be investigated.
For clearer expected/actual documentation, see Expected Result vs Actual Result.
Prioritize Pricing Defects by Business Impact
Not every pricing bug has equal severity.
A minor formatting problem in a coupon message may be low impact.
A defect that causes customers to be:
- undercharged;
- overcharged;
- charged incorrect tax;
- charged a different payment amount;
- incorrectly denied shipping;
can be release-critical.
For broader classification, see Bug Severity vs Priority.
For release blocking decisions, see Which Bugs Should Block a Website Release?.
Build Pricing Rules Into Regression
Pricing logic is highly interconnected.
Once high-value scenarios are verified, retain them for regression.
A practical core suite may include:
- no discount;
- percentage coupon;
- fixed coupon;
- invalid coupon;
- minimum threshold;
- excluded product;
- free-shipping threshold;
- taxable address;
- alternate tax location;
- coupon + tax;
- coupon + free shipping;
- full coupon + tax + shipping combination.
Retest Around the Fixed Boundary
If a developer fixes a free-shipping threshold at $100, do not test only:
$100
also test:
$99.99
and:
$100.01
A boundary fix should be verified around the edge.
Retest Related Rules
A coupon change may affect:
- tax;
- shipping;
- payment amount.
A tax fix may affect:
- checkout total;
- order record;
- refund values.
Regression should follow these dependencies.
Production Verification
Production may use different:
- tax configuration;
- payment credentials;
- shipping integrations;
- promotion data.
After important pricing-related releases, perform safe production verification where appropriate.
For the wider process, see How to Verify a Website Deployment After Release.
Avoid unnecessary live transactions.
Use an approved controlled process when production payment verification is required.
A Practical Pricing Rules Testing Workflow
Step 1 — Document the Business Rules
Understand:
- coupon rules;
- discount rules;
- tax basis;
- shipping logic;
- calculation sequence.
Step 2 — Create Manual Expected Calculations
Know the expected monetary result before testing.
Step 3 — Verify Basic Subtotals
Check price × quantity first.
Step 4 — Test Coupons and Discounts Individually
Cover:
- fixed;
- percentage;
- eligibility;
- validity;
- usage limits;
- stacking.
Step 5 — Test Tax Individually
Verify:
- rate;
- location;
- classes;
- rounding.
Step 6 — Test Shipping Individually
Verify:
- methods;
- zones;
- costs;
- thresholds.
Step 7 — Test Boundaries
Test values:
just below → exactly at → just above
Step 8 — Combine Rules
Test important interactions:
coupon + tax + shipping
Step 9 — Verify End-to-End Amount Consistency
Compare:
Cart → Checkout → Payment → Order → Confirmation
Step 10 — Add High-Risk Scenarios to Regression
Reuse stable expected calculations in future releases.
Coupons and Discounts Checklist
- Valid coupon calculates correctly.
- Invalid coupon is rejected.
- Expired coupon is rejected.
- Future coupon is rejected.
- Percentage discounts are correct.
- Fixed discounts are correct.
- Rounding is correct.
- Minimum threshold works.
- Maximum discount cap works.
- Product exclusions work.
- Sale-item restrictions work.
- Usage limits work.
- Coupon removal recalculates totals.
- Stacking rules work.
- Automatic discounts work.
- Quantity/tier rules work.
- Boundary values are tested.
Tax Checklist
- Basic tax calculation is correct.
- Correct location determines tax.
- Address changes trigger recalculation.
- Taxable items are taxed.
- Exempt items remain exempt.
- Multiple tax classes calculate correctly.
- Discount interaction is correct.
- Shipping tax is correct.
- Rounding is correct.
- Stored order tax matches checkout.
Shipping Checklist
- Correct shipping methods appear.
- Shipping zones work.
- Unsupported destinations are handled.
- Shipping prices are correct.
- Free-shipping threshold works.
- Discount interaction with free shipping is correct.
- Cart changes trigger recalculation.
- Method selection persists.
- Local pickup works where applicable.
Final Transaction Checklist
- Product subtotal is correct.
- Discount is correct.
- Tax is correct.
- Shipping is correct.
- Grand total is correct.
- Checkout total matches expected amount.
- Payment amount matches checkout.
- Order record matches payment.
- Confirmation reflects the stored order.
Common Mistake: Testing One Successful Coupon
One successful coupon proves very little.
Also test:
- invalid;
- expired;
- threshold;
- excluded items;
- usage limits;
- cart changes.
Pricing rules have states and boundaries.
Common Mistake: Testing Only Whole Numbers
Whole numbers can hide precision defects.
Use values such as:
$19.99
with:
15% discount
to expose rounding behavior.
Common Mistake: Testing Rules Only Separately
A coupon may work.
Tax may work.
Shipping may work.
But:
coupon + tax + shipping
may still produce the wrong total.
Combination testing is essential.
Common Mistake: Ignoring Boundaries
If free shipping begins at $100, testing only $150 does not validate the rule properly.
Always test:
$99.99 / $100.00 / $100.01
Common Mistake: Verifying Only the Cart
The customer is ultimately charged at payment.
A correct cart value with an incorrect payment value is a serious defect.
Verify the complete transaction.
Common Mistake: Assuming Payment Success Means Correct Payment
A payment can succeed while charging the wrong amount.
Always compare:
Expected Amount → Checkout Amount → Payment Amount → Order Amount
Common Mistake: Ignoring the Stored Order
The frontend may display the right total while the saved order contains:
- wrong tax;
- wrong discount;
- wrong shipping;
- wrong total.
That can create later problems with:
- refunds;
- invoices;
- accounting.
Common Mistake: Guessing Tax Rules
Tax treatment depends on configuration and applicable business/legal requirements.
QA should test against documented expected behavior.
Do not invent tax rules.
Common Mistake: Changing the Requirement to Match the Application
If the business rule says:
Free shipping applies at $100 after discounts.
but the system uses the pre-discount subtotal, that is not automatically the new correct behavior.
Compare actual behavior to the defined rule.
Common Mistake: No Regression After Pricing Changes
Pricing calculations are interconnected.
Any change to:
- coupon logic;
- discount calculation;
- tax;
- shipping;
should trigger relevant regression across the final order calculation.
Build Pricing Rules Into the E-commerce QA Process
A strong e-commerce pricing workflow can look like:
Product Pricing → Coupons/Discounts → Shipping → Tax → Checkout → Payment → Order → Confirmation → Regression
This keeps pricing QA connected to the actual customer transaction without turning this article into a general cart or checkout guide.
For broader checkout coverage, see How to Test an E-commerce Checkout Flow.
For teams that need structured e-commerce QA coverage, reusable calculations, regression scenarios, defect tracking, and release-readiness workflows, Qualavo QA Professional provides a broader QA framework.
Final Thoughts
Coupons, discounts, taxes, and shipping rules are some of the most interconnected parts of e-commerce QA.
Each rule may work correctly in isolation while producing the wrong result when combined with another.
The most effective strategy is:
test each rule individually → test its boundaries → test high-risk combinations → verify the complete transaction
Pay particular attention to:
- coupon eligibility;
- stacking rules;
- minimum thresholds;
- maximum discounts;
- tax location;
- tax rounding;
- free shipping;
- discount/shipping interaction;
- final payment amounts.
Always know the expected result before testing.
Then verify that result across:
Cart → Checkout → Payment → Order → Confirmation
The most important question is not:
Did the coupon apply?
It is:
Did every pricing rule interact correctly so the customer was offered, charged, and recorded for exactly the amount required by the business rules?
That is the standard a reliable e-commerce pricing QA process should meet.
