Discount codes are very popular in e-commerce buying; often sites will offer a discount for the first order, or for orders with monetary value over a set amount of money.
Discount codes usually change periodically and can be linked to different offers within the same web site. There could be several discount codes on offer over any retail site that may or may not be able to be used in conjunction with one another.
The main reason why retailers offer discount codes is to attract a greater level of sales and a higher spend per customer. Often sites will offer a discount code to be used on the second order to induce buyers to make additional orders through the same site.