Unfortunately, we don't have any way to issue a discount code that expires at some set time after it is issued. You can, however, create discount codes that are good for only one use, and issue each buyer their own, unique code. Whether they use the code themselves or pass it to a friend, you'd still be getting the return business, and after the code is used once by anybody, it becomes invalid for everybody.
First, you will need to generate a list of unique codes. For this, we'd recommend using a site like http://www.random.org/strings/ -- mixing numeric digits and uppercase letters should be fine. Copy the list generated and paste it into a text file using Notepad (for Windows) or TextEdit (for Mac).
Next, go to Seller Admin > Cart Discounts / Gift Coupons. Set up the following discount:
- Product: All Cart Items;
- Discount Name: 10% off (but see notes below);
- Discount Codes: [paste your list of codes here]
- Max. Use Count: 1;
- Discount: 10, select "%";
- Applies to: Item Total;
- Leave all other settings blank/0 and click Submit.
That will spin off a series of discounts with identical settings, one for each code you pasted into your Discount Codes list.
Then edit the product you want to have issuing the discount codes and set up the following in addition to its existing settings:
- Enable "Send Stored Codes";
- Add a note in the Email Message field explaining what the code is for (the code itself will automatically be included), or for products using Templated Email, add [%codes%] where the code should be inserted in the template;
- Click Next until you see the PIN/Registration Codes box;
- Paste your list of codes in the box;
- Click Next until you can Submit changes.
If more than one product will be issuing discount codes, repeat all of the steps above for each product, but use a different Discount Name for each one, perhaps referencing the Item Name or Number of the product that will issue that list of codes (e.g. "10% off via This Widget Name" or "10% off via 123456"). Note that you can have up to 10,000 discounts in total configured at once for your account, limiting you to a maximum of 10,000 total Discount Codes at once if you don't have any other discounts, so subdivide that accordingly if you'll be doing this for more than one product.