I've created an e-commerce system for a website I'm working on.

The administrator can add promo-codes, add categories, and add items within those categories.

When creating a promotional code the user has the option to create conditions that the promotional code will apply. For example, you get this item free if you have this item in your order.

In addition, there is an option to set an expiration date for the promotional codes.

Suppose an administrator creates a promo code which gives the customer a free item if they have another certain item in their order. Now let's say the administrator deletes the item associated with the condition, or deletes the product that the customer would get for free.

Should the promo code automatically be deleted when items it is associated with are deleted, or is this something that should be left to the administrator? Similarly, should promotional codes that have expired automatically be deleted?

  • 7
    I'm assuming that when you say "deleted" you actually mean "deactivated"? Rule of thumb for any kind of business data: you never delete anything.
    – Lilienthal
    Commented Sep 30, 2015 at 13:42

5 Answers 5


YES, but....

In fact, you don't need to delete the promo code itself, but the association to the product. However, it's always good to delete the promo code as well, for the reasons below:

  1. Make your user's life easier

You're building this for an user, and you're building an usability paradigm, thus this paradigm has to keep the user in mind. One of the things that will happen if you don't delete promo codes is the user will lose track of them. Figure this scenario: your user forgets about the promo codes and 1 year later someone buys an item and uses this promo code for a product. This could be a HUGE issue, depending on promo code, it could mean a big loss.

  1. Promos are.... PROMOS

Sounds stupid, but well, it's exactly that. A promotional campaign (and a promo code is ALWAYS part of a promotional campaign) has limits in time, location, availability and such. Not deleting your promo codes would mean promos are infinite... if this is the case, why don't you simply adapt your price structure?

  1. A promo code belongs to something

This is a given! Let's say you have a product with 1 or more promo codes. If you delete the product... why do you need the promo code? Take a look to this visual aid that illustrates the concept: enter image description here

  1. Psychology Reasons

When you use a Promo Code, you're appealing to the customer's psychology. When available, the promo code appeals to the sense of Urgency, Scarcity, and even Illusion of Control. If not available, you communicate the user the promo code is not available anymore and can use this as a selling tool. Now think what would happen if you let that promo code live, yet not working. The sense of frustration for the user will go to the roof, it's like saying to your customers: "OK, I see you have a 10 dollars bill but I won't accept it. Just because"


The above being said, keep in mind this doesn't deal with implementation, or at least only deals with it tangentially. For your admin users, it could be useful to offer an option like this:

enter image description here

Bottom line, you need to provide your user with an usability structure that helps them, and this includes their admin tasks as well as dealing with their customers without problems and financial/support issues. So always try to look the different aspects of the problem and if in doubt.... test, test, test!


Some literature and testing that may help you see how deleting your coupon codes affects your flow. While a bit off the direct question, you'll see most articles, research and testing recommend NOT to have a coupon code box, so this is something you may consider and even use as additional help for your users. You'll also find what to do with codes, which has direct relation to your question

The One Little Box That’s Costing You Big Dollars

Do Coupon Codes INCREASE Checkout Abandonment?

The Sad Tale of Abandoned Shopping Carts

9 Things Designers Can Learn from Target’s Checkout Form

  • 3
    that was an EXTREMELY thorough answer. I have had multiple clients ask me for this functionality though. The reason I was so big on this particular issue is I've created a framework that automatically creates the administration side for me. Before I get too much deeper into programming the rest of the framework, I wanted to nip this issue in the bud.
    – Allenph
    Commented Sep 29, 2015 at 19:02
  • @Allenph, I kind of figured that was your case, so I included it, yet provided a broader view for both or anyone else browsing this question in the future. As a matter of fact your question gave me a lot of things to think about and even thinking on doing some testing of my own. Needless to say I love this kind of questions!
    – Devin
    Commented Sep 29, 2015 at 20:35
  • 1
    "Not deleting your promo codes would mean promos are infinite" The OP explicit states they have an expiration date on the code. Presumably, the system will refuse to apply a code that has expired.
    – jpmc26
    Commented Sep 29, 2015 at 22:17
  • As i said above, I tried to include more scenarios than just the OP's. In that case, it's more than obvious that you should delete an orphan promo code, as I also explained
    – Devin
    Commented Sep 29, 2015 at 22:30
  • It's a very good idea to keep expired promo codes in your database, and in relevant parts of the User Interface. For instance, when a customer calls, Customer Support should be able to see what promo codes were valid at the time of the order, which will include promo codes that have expired at the time of the call.
    – MSalters
    Commented Sep 30, 2015 at 8:55

One thing that hasn't been mentioned here is history.

Do you need to know if a discount code applied to an order that has been placed in the past? If so, deleting the discount may lead to confusion if you are investigating the order - you may not know what discount was applied (it depends on if you save the discount information with the order or just keep it with the other discounts and refer to it in the order)

Also, keeping the discount around will make it easier to create a similar discount in the future. You can refer to it to create the new one.

  • This was my thought as well - say a customer returns a defective product, which you no longer carry due to said defect being common, and now the customer wants to purchase a similar product to replace it. They originally used a promo code. The new product is even the same price as the discontinued product. If you deactivated the promo code but didn't delete it, you can administratively apply it to the customer's replacement order, for a very easy way to achieve a net transaction amount of $0. Commented Sep 29, 2015 at 21:20
  • Someone returns a defective product and then wants to buy another from a supplier that sold a defective product? It may happen, sure, but what are the chances? 1 in 1000000? Wouldn't it be more common and logical to ask for a replacement?
    – Devin
    Commented Sep 29, 2015 at 22:33
  • @Devin being reinbursed and buying another instance of the same item is actually a way for getting a replacement.
    – Ángel
    Commented Oct 1, 2015 at 0:28
  • @Devin this is a very common occurrence (source: 8 years' retail experience). Ex: I buy Product X from ABCcompany.com using a promo code. My Product X is defective, so I bring it to my local ABC Company store, intending to buy another Product X - I assume that not all Product X are defective. I find out that Product X is no longer carried, but there is a highly similar Product Y for the same price. ABC Company's registers don't have "even exchange"; they do a return transaction and a sale. The manager uses their override key to force the register to accept the expired promo code. Commented Oct 5, 2015 at 4:39

If you have promo codes that are dependent on items/services you have for sale, for example:

  • Buy item "A" and get item "B" for free

If item "A" (or "B") ceases to exist, runs out of stock, or is disabled, then the coupon/promo should no longer remain active. Without either, the promo code cannot work.

If you create "states" for your coupons so that they can become "inactive" when their requirements can no longer be met, this gives you an opportunity to notify the administrator of defunct promotions, as well as the opportunity to fix them by updating the no longer available "A" or "B" with a new item, or "permanently" deleting the promo code from wherever they manage their promotions.

Heck, any attempts to delete a product/service that is associated with an active coupon/promo code should prompt some kind of response then and there.

Note - Business logic tends to prevail here. Have a conversation with your end user around:

  • How things are currently handled
  • What kinds of promo codes will be created
  • In what instances would they end prematurely

We don't know. This is a business/user requirements decision and not a UX decision.

You should probably talk to your users. How likely would the administrator recreate that product or another product in which that promo code also applies to? If/when that happens, would the admin want their customers to continue to be able to use that promo code?


NEVER delete a promo code that has been used, as otherwise it makes it hard to understand past orders.

However automatically marking a promo code as obsolete where the product withdrawn from sale or the “end date” is passed, and having a check box to hide obsolete code (defaulted on) would be a good ideal.

When obsolete codes are being viewed, and one is selected, the reason the code is considered obsolete by the system should be clear.

You may sometime later wish to feed the data into a pricing system that can work out how well past promos have worked, and predict the result of new promos you are planning.

(Likewise if a Promo has been used, don’t allow it to be edited, instead copy it and edit the copy, so that the history of promos is kept. A good UI can automate this process so hiding the details from the user.)

PS, I would not allow any product that had been sold to be deleted; they should be put into a “forever out of stack” state – this is for the same reasons as above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.