Drupal Commerce allows you to sell customizable products that require customer input when added to the cart. Use cases for this functionality include:
The core Line Item module accommodates these scenarios by letting you add any number of fields to the Product line item type and expose them to the Add to Cart form. However, sites that sell multiple types of customizable products or a mixture of customizable and non-customizable products need to define multiple line item types to handle the different configurations of fields. That's where Customizable Products module comes in!
Add a coupon code textfield to the product line item type. Create a Rule that looks for this value and applies a discount based on the code entered.