Ecommerce Website Development in Pune: Building Discount Codes, Coupons and Gift Cards That Protect Your Margin and Do Not Break at Checkout
A discount code looks like the simplest feature in an online store, and it is one of the easiest to get expensively wrong. A badly configured code can stack with a sale price, apply to items you meant to exclude, be shared on a coupon site, be used a hundred times by one person, or quietly push an order below cost. This guide explains how ecommerce website development in Pune should approach discounts, coupons and gift cards: the rule types to offer, the rules that protect margin, how to build and test them on Shopify and WooCommerce, and how to explain the offer clearly so the customer is not surprised at checkout. Throughout, we describe options and checks, not guaranteed uplift, because discount performance depends entirely on your products, margins and customers.
It is written for store owners and marketing managers who run, or are about to launch, an online store and want promotions that behave predictably. Some sections are for the person doing the setup, but nothing requires coding knowledge. Where a developer is needed, we say so.
Start With the Margin, Not the Code
Before any code is created, answer this question: what is the maximum discount this product or order can take and still make sense?
For each product category, write down:
- Selling price
- Cost of goods
- Payment gateway fee, packing, shipping you absorb and expected returns
- The remaining contribution per order
Only that remainder is available for discounts. A worked example, using invented round numbers to show the method:
| Line | Amount (₹) |
|---|---|
| Selling price | 1,000 |
| Cost of goods | 450 |
| Packing and shipping absorbed | 100 |
| Payment fee, estimated | 25 |
| Contribution before discount | 425 |
| A 20% discount | 200 |
| Contribution after discount | 225 |
| Extra shipping cost if free shipping also applies (illustrative) | 60 |
| Contribution after discount and free shipping | 165 |
These figures are illustrations, not typical costs; your own numbers will differ. The method is what matters: knowing the floor before choosing the offer. If a customer can combine two offers and reach a loss, the code is not ready to launch.
Remember that tax treatment affects price display and discounts in India. How a discount interacts with GST on an invoice is a matter for your accountant, and you should confirm the configuration with them, not rely on a plug-in default. Our guide to GST 2.0 changes for online stores covers how pricing display has been affected.
The Types of Promotion You Can Build
Most stores need only a handful of promotion types. Each has different rules to define.
Percentage off
A percentage off an order, a collection or specific products. Easy to understand, scales with the basket, and requires care on high-priced products where the rupee value can become large. A maximum discount cap in rupees protects against that.
Fixed amount off
A set rupee amount, such as ₹200 off orders above ₹1,999. Easier to control on cheap items and easier to explain. A minimum spend should accompany it.
Free shipping
Common in India, where shipping charges can discourage purchase. Define the threshold, the regions, and whether it applies to cash on delivery orders. Check what shipping actually costs you, as the free shipping is paid by you.
Buy X get Y and bundles
Buy two get one at a lower price, or a set of products at a bundle price. These interact with inventory and with the discount allocated to each line for returns. Our guide to upsell, cross-sell and bundles explains how to design them to raise order value without confusing customers.
Automatic discounts
Applied without a code when the basket qualifies. These have the best customer experience because nobody has to hunt for a code, and they remove the leak of codes shared on coupon sites. Use them for site-wide sales and threshold offers.
Unique single-use codes
A code generated for a person or an email, valid once. Useful for welcome offers, abandoned-cart reminders, apology credit and influencer tracking. Most platforms can generate these in bulk.
Gift cards and store credit
A gift card is a stored balance purchased by one person and spent by another. Store credit is typically issued by the business, for example in place of a refund. Both create a liability on your books and rules about expiry, so read the section on gift cards below.
The Rules Every Discount Needs
Whichever type you choose, a discount should have explicit rules for each of these.
| Rule | Question it answers | Example setting |
|---|---|---|
| Eligible products | What does the discount apply to? | Selected collections only; exclude already-reduced items |
| Minimum spend or quantity | When does it start to apply? | Orders above ₹1,499 after other discounts |
| Maximum discount | What is the cap? | Up to ₹500 |
| Start and end date and time | When is it valid, in which time zone? | Indian Standard Time, with an exact end time |
| Usage limit, total | How many times can it be used overall? | First 500 orders |
| Usage limit, per customer | Can one person use it repeatedly? | Once per customer |
| New customers only | Is it for first orders only? | Check by email or account |
| Combinability | Can it combine with other discounts? | No stacking with other codes; or defined stacking |
| Shipping | Does it affect shipping charges? | Applies to products only |
| Payment method | Does it differ by COD or prepaid? | Prepaid only, if you choose, and stated clearly |
| Region | Does it apply to certain delivery locations? | All India, or listed states |
| Channels | Where does it apply? | Online store only, not marketplaces |
Write these into a one-page specification for every promotion, even small ones, and ask the person who will approve it to initial it. When something goes wrong, you can then compare the setup with the intention.
Decide stacking explicitly
Stacking is where most margin leaks occur. Common problem combinations include a percentage code applied to an already-reduced sale price, a welcome code stacked with a bundle discount, and free shipping combined with a fixed-amount code on a low-value basket. Decide, for each promotion, whether it combines with each of the others. Platforms differ in how they handle this, so test the real combinations rather than assuming. If you cannot test every pairing, make the default "does not combine" and allow specific exceptions.
Make time limits exact
"Valid till Sunday" is ambiguous. State the date, the time and the time zone, and configure the system to match. Test the last minute of the offer and the first minute after, because time-zone differences between a platform, a plug-in and the server are a known source of surprises.
Building It on Shopify
Shopify supports discount codes and automatic discounts, including percentage, fixed amount, buy-X-get-Y and free shipping, with options for minimum requirements, customer eligibility, usage limits and combinations with other discounts. The exact options and limits change, so check the current Shopify Help Center before you design a promotion. Points worth knowing for a store in India:
- Combinations: Shopify lets you choose which discount classes (product, order, shipping) can combine. Review these settings on each discount.
- Customer eligibility: discounts can be limited to specific customers or segments, which is useful for member or wholesale pricing.
- Gift cards: Shopify provides gift card products, with availability depending on your plan and region, so confirm it for your store.
- Apps: for advanced rules, such as tiered discounts or buy-more-save-more messaging, apps are available. Each adds cost, scripts and a dependency, so test page speed before and after. Our guide to store speed and Core Web Vitals explains why.
- Checkout customisation: the degree to which checkout can be customised depends on the plan and Shopify's current checkout extensibility, so ask your developer what is supported.
Building It on WooCommerce
WooCommerce includes coupons as standard, with percentage, fixed cart and fixed product discounts, plus controls for expiry date, minimum and maximum spend, individual use only, excluded products and categories, allowed emails, and usage limits per coupon and per user. Points worth knowing:
- Individual use: the "individual use only" setting prevents a coupon being combined with others. Use it as your default.
- Sale items: there is a setting to exclude sale items. Check it on every coupon to avoid stacking a code on already-reduced prices.
- Email restrictions: limiting a coupon to named email addresses supports single-customer offers, though customers may check out with a different email, so combine this with a per-user limit where needed.
- Extensions and plugins: advanced rules usually need a plugin. Choose one that is actively maintained and compatible with your version, and audit it as you would any plugin. Our guide to auditing WordPress plugins explains how.
- High-performance order storage: if you run WooCommerce's newer order storage, test that any coupon plugin supports it. See our note on WooCommerce HPOS.
Custom and Headless Stores
On a custom or headless build, the discount engine is your own code, which means the margin rules above must be implemented and tested by your developers. Insist on these properties:
- The server calculates the price, never the browser. A discount that can be changed by editing the page can be abused.
- Rules are data, not code. The business should be able to create and end promotions without a release.
- Every applied discount is recorded on the order line, with the code, the amount and the rule that applied, for reporting and for refunds.
- Idempotency: applying a code twice, or refreshing the page, must not discount twice.
- Race conditions are handled: two customers using the last remaining use of a limited code at once should not both succeed.
Our checkout system work covers these properties for stores that outgrow standard plug-ins.
Preventing Code Leaks and Abuse
Public codes spread. A code intended for newsletter subscribers will appear on coupon aggregator sites within days if it is simple and generic. Reduce the damage in layers.
- Prefer automatic discounts for site-wide offers, as there is no code to leak.
- Use unique codes for individual offers such as welcome emails.
- Set usage limits per code and per customer.
- Cap the discount in rupees.
- Avoid obvious code names such as WELCOME10 for restricted offers.
- Watch for patterns: many orders using the same code with different names but the same address or phone number suggests abuse.
- Protect the checkout from bots, since automated scripts can test codes at speed. Our guide to stopping fake orders and bot checkouts covers rate limiting and challenges.
- Monitor daily during launch. Check the first day of any large promotion for unexpected volume.
Be careful, though, not to penalise honest customers. A strict rule that rejects a legitimate return customer is a poor experience; explain the rule in a clear message at the point of rejection.
Communicating the Offer Honestly
Discounts are covered by advertising and consumer-protection rules, and misleading price claims can bring complaints. India's Consumer Protection Act, 2019 and the guidelines issued under it address misleading advertisements and unfair trade practices, and the Advertising Standards Council of India has its own code. Practical points:
- Show the real terms next to the offer: minimum spend, exclusions, end date and whether it can be combined.
- Do not inflate "original" prices to make a discount look bigger. A reference price should be a price at which you genuinely sold the product.
- Do not use fake urgency, such as countdown timers that reset on reload. This is the kind of pattern addressed in India's guidance on dark patterns. See our guide on checkouts and dark patterns.
- Show the discount in the cart and at checkout, and make the final payable amount clear before payment.
- Explain the failure: if a code is invalid, say why in plain words: expired, below the minimum, not valid for these items.
Confirm the details for your category with a qualified adviser, since the rules differ for some products.
Gift Cards and Store Credit
Gift cards are popular for festivals and weddings, and they bring extra obligations.
Decisions to make before you launch
- Denominations: fixed amounts or a customer-chosen amount within limits.
- Delivery: email, with a scheduled send date, and a printable version if you want one.
- Expiry: whether the card expires and how that is communicated. Check the legal position and your accountant's advice before applying an expiry period. Do not hide an expiry date in the terms.
- Partial use: whether the balance remains after a purchase, which is normally expected.
- Refunds: whether orders paid by gift card are refunded to the card, to store credit or to the original payment method.
- Accounting and tax: a gift card sold is a liability, and the tax treatment on sale and on redemption needs your accountant's guidance. Do not assume a plug-in's default is right.
- Fraud: gift cards are a target for stolen payment cards. Review unusual large purchases and set sensible limits.
Display the balance clearly
Customers should be able to check a balance and see how it was applied at checkout, along with the remaining amount. A "check balance" page reduces support requests.
Reporting: Knowing Whether a Promotion Worked
A promotion that raises sales but loses money has not worked. Plan reporting before launch.
- Orders using the code, with revenue before and after discount.
- Average order value with and without the promotion.
- New versus returning customers, where the offer was designed for acquisition.
- Return rate on discounted orders compared with the usual rate.
- Contribution after discount, shipping and returns, not just revenue.
- Repeat purchase from customers acquired through the offer, over a later period.
Compare with a baseline period of similar length, and acknowledge seasonality. Our guide to setting up the order confirmation page and purchase tracking explains how to make sure orders and discount values are recorded once and correctly in analytics.
Testing Checklist Before You Publish a Promotion
Run these on a test order or a staging copy, on both a phone and a computer.
- The code works with an eligible basket and shows the right amount in the cart and at checkout.
- The code is rejected for an ineligible basket, with a clear message.
- The minimum spend is calculated after other discounts, as intended.
- Excluded products and sale items are not discounted.
- Stacking with every other live promotion behaves as specified.
- Usage limits stop a second use by the same customer and the total limit stops at the right count.
- The start and end times behave correctly at the boundaries.
- Free shipping applies only where intended, including cash on delivery orders.
- Gift card purchase, delivery, partial redemption and balance check all work.
- Order emails, invoices and the order admin screen show the discount correctly.
- A refund of a discounted order returns the right amount.
- Analytics records revenue and discount without duplicates.
- A discounted order's tax lines match your accountant's instructions.
- Page speed has not been harmed by any new app or script.
Our pre-launch testing checklist for online stores gives a wider test plan that you can run alongside this one.
Common Mistakes
Launching without a floor. If nobody knows the minimum margin, nobody can say whether a stacked offer is safe.
Leaving old codes active. Expired promotions with no end date become permanent discounts. Review active codes monthly and end those no longer needed.
Giving the same code to everyone. Single-use or segment codes are easier to control than a code shared on every channel.
Training customers to wait. A store that discounts constantly teaches customers to wait for the next sale. Use promotions with a purpose, such as clearing stock, welcoming a new customer or rewarding loyalty.
Ignoring returns. A discounted order that is returned may need the refund calculated on the discounted amount. Test it.
Hiding the terms. Fine print discovered at checkout causes abandonment and complaints.
What to Ask an Ecommerce Developer About Discounts
- Which discount types and combinations does our platform support natively?
- How do you prevent stacking that takes an order below cost?
- Is the discount calculated on the server?
- How do refunds and returns handle discounted lines?
- How are discounts recorded for reporting and tax?
- Which apps or plugins are needed, and what do they cost and weigh?
- How do we test the promotion before it goes live?
Where to Start This Week
- Calculate the margin floor for each product category.
- List every live code and automatic discount, and end the ones you no longer need.
- Write a one-page specification for your next promotion using the rules table.
- Decide your default stacking policy.
- Run the testing checklist on a staging copy.
- Plan the report you will look at after the promotion ends.
Frequently Asked Questions
How do I stop customers stacking multiple discount codes?
Set each code to not combine with others, or limit the number of discounts allowed per order, using your platform's combination settings. On WooCommerce use the individual-use setting; on Shopify choose which discount classes can combine. Then test real combinations, because defaults differ between platforms and plug-ins.
What is the difference between a discount code and an automatic discount?
A discount code must be entered by the customer; an automatic discount applies when the basket qualifies. Automatic discounts are simpler for customers and cannot be shared as a code, so they suit site-wide offers, while codes suit targeted offers such as welcome emails.
Can I offer a discount only to first-time customers?
Often, yes, but it is hard to enforce perfectly, since customers can use a different email. Combine a new-customer rule with a per-customer limit and other checks, and accept that some leakage may remain.
Should gift cards expire?
That depends on legal advice and your business policy. If a card does expire, state this clearly at purchase and in the delivery email, and ask your accountant and adviser about the correct treatment before applying any expiry.
How do I know if a discount made money?
Compare contribution after discount, shipping and returns with a similar period without the offer, and look at repeat purchases later. Revenue alone can hide a loss. Plan the report before the promotion begins.
Sources and Notes
- Shopify Help Center, discounts: help.shopify.com/en/manual/discounts
- WooCommerce documentation, coupon management: woocommerce.com/document/coupon-management
- Department of Consumer Affairs, Government of India, consumer protection and guidelines on misleading advertisements and dark patterns: consumeraffairs.nic.in
- Advertising Standards Council of India: ascionline.in
The rupee figures in the worked example are invented to show the method and are not typical of any store. TODO: tax and gift-card accounting treatment must be confirmed with a chartered accountant before it is applied.
Working With Govindani Infotech on Store Promotions
Govindani Infotech is a website design and development company at 2nd Floor, Landmark Plaza, 206 Satara Road, Parvati Paytha, Pune 411009. Our ecommerce development team builds Shopify, WooCommerce and custom stores, and sets up discount rules and checkout behaviour as part of a store build.
If you would like us to review how your current promotions behave at checkout, message us on WhatsApp at wa.me/919201958278 or use our contact page. We will explain what a review would cover before any price is discussed.
About the author: written by the Govindani Infotech ecommerce development team in Pune, drawing on our experience of building and testing online stores.