Discount code

Also known as: coupon code

On this page 7

A discount code, also called a coupon code, is a short alphanumeric string that a shopper enters at checkout to apply a predefined price reduction or benefit to an order. In e-commerce and commerce marketing, discount codes are one of the most flexible promotional levers, because each code can carry its own rules, audience, expiry date and tracking value.

Unlike a sale price that every visitor sees, a code is conditional and attributable: only people who hold it receive the offer, and the store can measure exactly which campaign, partner or channel produced each redemption.

How a discount code is validated at checkout

When a shopper submits a code, the store platform runs a validation sequence before changing the cart total. The code is matched against a stored promotion rule, and the rule decides whether the order qualifies and how the reduction is calculated.

  1. The platform normalizes the input, usually trimming spaces and ignoring letter case.
  2. It looks up the code and checks its status, start date and expiry date.
  3. It evaluates eligibility conditions such as minimum order value, product categories, customer segment or first order only.
  4. It checks usage limits, both the global cap and the per-customer cap.
  5. It applies stacking rules that decide whether the code combines with automatic discounts or other codes.
  6. It recalculates line prices, shipping and taxes, then records the redemption against the order.

The order of operations matters for tax and accounting. In most jurisdictions with sales tax or value-added tax, a merchant-funded discount reduces the taxable base, so the tax is calculated on the discounted price. A discount funded by a third party can be treated differently, which is why finance teams need to know who pays for each promotion.

Types of discount codes and offer mechanics

Discount codes differ in two dimensions: the benefit they grant and the way they are distributed. The benefit determines the margin impact, while the distribution model determines how easily the code can leak beyond its intended audience.

Benefit typeExampleMain effectTypical risk
Percentage off15% off the orderScales with basket sizeLarge orders erode margin quickly
Fixed amount off$10 off orders over $60Predictable cost per redemptionWeak appeal on expensive items
Free shippingFree delivery codeRemoves a top checkout objectionCostly for heavy or remote parcels
Buy X get YBuy two, get one freeRaises units per orderComplex rules confuse shoppers
Free giftSample with purchaseLow perceived cost to the storeInventory of gift items runs out
Tiered discount10% over $50, 20% over $100Lifts average order valueShoppers game thresholds with returns
Common discount code benefits and their effects

Distribution is just as important. A public code is shared openly and behaves almost like a site-wide sale. A unique single-use code is generated per recipient, often in batches of thousands, and cannot be reused once redeemed. Between the two sit segment codes shared with a closed group, such as newsletter subscribers or members of a loyalty program.

ModelHow it is issuedLeak resistanceBest suited for
Public codeSame code for everyoneLowSeasonal campaigns, Black Friday
Segment codeShared within one audienceMediumNewsletters, influencer audiences
Unique codeOne code per recipientHighAbandoned cart email, win-back offers
Partner codeOne code per affiliate or creatorMediumAffiliate marketing attribution
Distribution models for discount codes

A discount code is one of several tools in the commerce marketing toolkit, and it overlaps with neighboring concepts. The key difference is that a code requires an explicit action by the shopper, which creates friction but also gives the store control and measurability.

MechanismShopper action neededTargetingKey difference from a code
Discount codeEnter a stringPreciseReference point for comparison
Automatic discountNoneRule-based onlyNo friction, but weaker attribution
Flash saleNoneEveryoneTime pressure instead of exclusivity
Gift cardEnter a card numberHolder onlyStored value, not a price reduction
Loyalty pointsRedeem pointsMembersEarned over time, not handed out
How discount codes relate to similar mechanisms

The distinction from a gift card is frequently misunderstood. A gift card is a prepaid liability on the balance sheet and acts as a payment method, while a discount code lowers the price and never represents money the customer has already paid.

Using discount codes strategically

Effective programs treat each code as a measured experiment with a clear objective, a margin ceiling and a defined audience. The objective shapes the mechanics: acquisition codes should attract new buyers, while retention codes should reward behavior the store wants to repeat.

GoalRecommended code designReason
First purchaseUnique code, first order onlyPrevents existing customers from claiming it
Recover abandoned cartsUnique code with 48-hour expiryUrgency without training shoppers to wait
Raise basket sizeFixed amount above a thresholdRewards adding items, protects margin
Measure creatorsOne partner code per creatorAttributes sales even without tracked clicks
Clear old stockCategory-restricted percentage codeLimits discount to targeted products
Choosing a discount code approach by goal

Measurement should go beyond redemption counts. Mature teams compare redeemers with a holdout group to estimate incremental revenue, because many redemptions come from shoppers who would have bought anyway. Without this comparison, a code can appear successful while it simply subsidizes existing demand.

Risks, leakage and common mistakes

The most widespread problem is code leakage: a code intended for a small audience appears on coupon aggregator sites and browser extensions, where it is applied automatically by shoppers who were never targeted. Leakage converts a targeted offer into a blanket margin loss and distorts attribution, especially in affiliate programs.

  • Unlimited public codes that never expire keep circulating for years.
  • Missing per-customer limits let one person redeem a welcome code repeatedly with new email addresses, a pattern known as promo abuse.
  • Uncontrolled stacking combines several codes with a running sale and sells products below cost.
  • Visible code fields on the checkout page send shoppers away to search for codes, which can increase abandonment.
  • Constant discounting trains customers to delay purchases until the next code arrives.

Practical defenses include unique single-use codes, short validity windows, minimum order thresholds, device and address checks against abuse, and collapsing the code field behind a small link. Stores should also review redemption anomalies weekly, such as sudden spikes from unfamiliar referral sources.

Explained without jargon

A discount code works like a password for a lower price. The store decides in advance what the password unlocks, for example ten percent off or free delivery, and who should receive it. When a shopper types the code at checkout, the system checks the rules and, if everything matches, lowers the total.

The store benefits because it can see which message worked: a code sent in an email tells it the email led to the sale. The main danger is that codes get shared far beyond the intended people, so stores often use one-time codes that work only once.

A typical use case

An online shop selling outdoor clothing notices that about 70% of carts are abandoned at checkout. The team sets up an automated email that goes out three hours after abandonment and contains a unique single-use code worth $10 on orders above $80, valid for 48 hours.

To learn whether the code really helps, the shop sends the same email without a code to a random 20% of abandoners. After six weeks, the coded group recovers noticeably more carts than the holdout group, while the codes cannot be found on coupon sites because each one works only once. The team keeps the program, tightens the threshold to $90 to protect margin, and gains a reliable, measurable source of recovered revenue.