A discount code is safe when the discounted order still leaves the contribution you need after every cost that comes with the sale: product, payment, packaging, carrier, and returns. So decide that minimum first, in money per order. Your discount ceiling is the order’s contribution before the discount minus that minimum. Then test the offer on the baskets where it does the most damage, such as the cheapest eligible product or a cart just over the threshold, and limit eligibility to the customers and products the offer is for.

“10% off” tells you what the customer saves, not what you keep. A promotion can raise order revenue and still leave less money for payroll, software, rent, returns, and profit. The arithmetic is the same whether the customer types a code or the promotion applies automatically.

Download the discount margin calculator and open it in Excel, Google Sheets, or Numbers. It contains three fictional scenarios with working formulas. Replace every assumption, use one currency and one tax basis throughout, and enter the total basket separately from the merchandise the offer applies to.

Calculate contribution margin before and after the offer

At order level, use this planning formula:

Contribution margin = discounted merchandise revenue + customer-paid shipping − product cost − payment cost − fulfillment and packaging cost − carrier cost − other variable cost

The calculator keeps total merchandise revenue and eligible merchandise revenue separate, so an offer can apply to only part of a mixed basket. For a percentage offer, the discount is eligible revenue × discount rate; a fixed offer can’t exceed eligible revenue; an optional cap limits either result. The payment fee is recalculated on what the customer pays after the discount, including shipping. Contribution margin percentage is contribution after discount ÷ customer revenue after discount. A negative contribution means the order doesn’t cover its own variable costs. A positive one still has to cover fixed costs and profit.

Keep tax consistent. If merchandise revenue is tax-exclusive, enter costs and customer-paid shipping on the same basis, using the definitions your bookkeeping already uses. Tax-inclusive revenue minus tax-exclusive costs is not margin. Decide too whether refunds, return postage, marketplace charges, or pick-and-pack fees vary enough with campaign orders to need their own input.

Note the source and date of each cost assumption: product cost, carrier charge, packaging, and payment terms. Enter the payment provider’s percentage and fixed fee separately; the sheet applies them to the post-discount payment. The shipping-subsidy column shows the part of carrier cost that shipping revenue doesn’t cover, while the contribution formula keeps both amounts visible. For how payments flow through checkout, read how checkout and Stripe payments work.

Set a discount ceiling from your margin floor

Work backwards from the lowest contribution you’ll accept per order, in currency, not from a competitor’s headline percentage. In a simplified model, the largest affordable discount is the contribution before the discount minus the contribution you must keep. Leave a buffer for costs you aren’t sure of.

Suppose an order has 100 in eligible merchandise revenue and 62 in total variable costs, with no customer-paid shipping. Its contribution before the discount is 38. If the business needs at least 20 per order, the theoretical ceiling is 18. That doesn’t make 18 a good discount: returns, fee changes, and basket mix can eat the gap. It does mean a 25 discount breaks the floor under these assumptions.

Test at least four baskets: the cheapest eligible product, a basket exactly at the threshold, one just above it, and the largest plausible eligible basket. A percentage offer may need a maximum discount to cap exposure. A fixed-amount offer must not exceed eligible merchandise revenue or produce an accidental zero-value order.

Give every discount a job

A code is a mechanism, not a strategy. Name the customer behavior or operational problem the offer should address.

  • A first-order invitation gives a genuinely new shopper a reason to try the store. Define “new” and decide how you’ll handle guest checkout, duplicate emails, and household orders.
  • A product-specific promotion focuses attention on an overstocked item or a deliberate assortment story. Check the margin of the eligible products, not the store average.
  • A minimum-spend offer encourages a larger basket only if the threshold and discount leave a safe contribution. Model a basket just above the threshold: the customer doesn’t owe you a comfortably high order.
  • A service-recovery code resolves a specific bad experience. Keep it narrow, documented, and easy for support to explain.
  • A partner or creator code attributes a campaign at a basic level. Include any commission or placement fee in the economics; code uses don’t prove the promotion caused every order.
  • A time-limited seasonal offer coordinates merchandising and communication. The deadline should be real, shown with a time zone where it matters, and the offer removed when the campaign ends.

Don’t discount just because the calendar is quiet. If the real problem is weak presentation, fix product grouping, photography, or product cards first. Merchandising a small catalog explains how to build a focused selection without inventing urgency.

Write the eligibility rule, then configure it in Setka

Write the rule in plain language first: who qualifies, which products or categories, minimum quantity or spend, start and end, geography if relevant, maximum discount, redemption limits, and whether it combines with other promotions.

In Setka, promotions are part of the platform, so the rule you configure is the one the cart and checkout apply, with no separate discount app to connect. Setka runs percentage and fixed-amount promotions, Buy X Get Y offers, free or discounted shipping, spend-and-save deals, quantity breaks, product- and category-specific sales, scheduled campaigns, and savings caps. Compatible offers combine automatically, and each live promotion can carry a named discount code. You choose the audience, products, dates, thresholds, and wording.

Two limits matter for the use cases above. Promotions that apply only when the customer enters a code, such as a private partner or service-recovery code, are coming soon. A promotion can cap how much it redeems per order, but limits on how many times each customer redeems it aren’t available yet. If your launch depends on either, tell us at contact@getsetka.com: requests go straight to the people building Setka.

Before the campaign goes live, check eligible and ineligible carts, the threshold, the schedule, the cap, and every intended combination in the cart of your published store. Then place one real order and refund it, to see the discount on a paid order. The shopping cart UX guide has a broader set of cart states to test.

Plan abuse controls without punishing legitimate shoppers

Use the narrowest controls that fit the use case. A first-order offer may need one redemption per customer plus a total campaign cap. A partner code may need a short validity period and exclusions for low-margin products. A fixed discount may need a minimum spend comfortably above the discount value. Don’t collect extra personal data just to make an offer harder to share.

Assume a public code will travel beyond its audience. Decide beforehand whether you’ll honor leaked uses, end the offer, or contact affected customers, and give support a written exception policy. Automated fraud flags produce false positives, so give a legitimate customer a way to ask for review instead of an unexplained rejection.

Test combinations explicitly. Put an eligible and an excluded item together; change the quantity; cross the threshold by the smallest unit; remove an item after the discount appears; test the start and end times; and try every other live promotion alongside it. If you can’t control or verify stacking, calculate the worst combination or don’t run overlapping campaigns.

Explain the offer where the customer decides

Campaign copy should say what the customer gets, what qualifies, when it ends, and the material exclusions. Put a short version next to the promotion and link to the full terms. In the cart, show the applied discount and the updated total. If an entered code fails, say whether it expired, doesn’t apply, or was mistyped, as far as you can without helping anyone abuse it.

Don’t hide a minimum spend in fine print or advertise “sitewide” while excluding major categories. Say whether the threshold is calculated before shipping and tax. If a customer removes an item and drops below the threshold, the cart should update immediately and explain why the discount changed. Customers judge the offer by what the cart shows them.

Use three scenarios, then replace them

The download includes three fictional teaching cases: a percentage offer on part of a mixed basket, a fixed product promotion, and a capped seasonal percentage promotion. They aren’t benchmarks, recommendations, customer results, or Setka configurations. They show how the same headline discount behaves differently when eligibility, product cost, fulfillment, shipping, payment terms, and basket value change.

For each real campaign, duplicate a row for a low-margin basket, an expected basket, and a high-value basket. Use item-level economics where the basket mix varies a lot. Compare the post-discount contribution with your floor and the calculator’s safety check. Then estimate the campaign as a whole: discounted orders multiplied by the discount and its operational effects, plus creative, partner, or media spend.

For everything the business must cover beyond the costs of each order, use the online-store cost guide.

Review the campaign after it ends

Before launch, record the audience, dates, eligibility, margin floor, and expected order mix. Afterwards, compare the plan with what happened:

  1. Count eligible orders, discounted revenue, discount cost, refunds, and contribution with consistent definitions. Track store sessions too if you’ll compare revenue per session.
  2. Segment by product mix, customer type, and acquisition source where the data is reliable and lawful to use.
  3. Compare campaign orders with a fair baseline, allowing for seasonality and other changes. A before-and-after difference alone doesn’t prove the discount caused it.
  4. Review support contacts, failed attempts, leaked-code handling, and confusing terms.
  5. Decide whether to repeat, narrow, redesign, or stop the promotion, and write down why.

Revenue per session helps compare two offers: divide merchandise revenue after discounts and refunds by store sessions over the same period, with consistent shipping and tax treatment. Read it next to contribution, acquisition spend, and operating costs. Higher revenue per session can still leave the business with less money if the offer changes discount depth, product mix, shipping subsidy, or returns.

Check what happens after the offer, too. A promotion can pull forward purchases that would have happened next month, so a strong week is followed by a weak one. Choose a review window that fits the product’s normal buying cycle, and compare similar audiences and acquisition sources where you can. Revenue, redemptions, and a later dip can’t on their own tell you how much demand the campaign created and how much it only moved. Don’t call sales “incremental” without a credible comparison or experiment.

Your next test

Download the calculator, replace every fictional input with a sourced assumption, and set your contribution floor. Then set up the offer in Setka and check eligible, ineligible, threshold, schedule, cap, and combination states before you make it active.