In commerce server a promotion code can be used to associate a discount to an order. Promotion code can also know as coupon code. For example, a retailer can declare 20% discount on all his products with a promotion code = ’20OFF’ and the user while purchasing, enters this promotion code along with order then he will get 20% discount.
Promotion codes are of three types
1. Public – these coupons can be used by anyone.
2. Private – these coupon codes are targeted to specific users.
3. Restricted – these coupon codes are restricted to one user.
In the given scenario, if you would like to create a public promotion code and wants to impose that a user can use this code only once. Out of box commerce server doesn’t support this functionality. For public coupon codes, it will allow users to use public coupon codes as many times as they want – at the max the business uses can restrict the usage per basket. If the business requirement is restrict user to use public promotion code only once then here is the work around.
For that user, get all his previous purchase orders and check whether he has used the given promotion code. This approach will impact application response time. The other approach is to fetch the details directly from the database.
Select Count(*) from DiscountsApplied d
left outer join OrderForms o
on d.OrderGroupId = o.OrderGroupId
where PromoCode = ’20OFF’ and
promoUserIdentity = ‘ravi@ava.com’
The above code snippet, gives the count and if the count is greater than zero, we will warn the user the coupon code has expired.
If you like this post, please click on our sponsor advertisement.

Thanks for the info provided.
I want to provide exactly same functionality.
I know the query also but I have no knowledge on pipelines.
Can you please provide detailed steps on
(1) where to put custom pipeline component to stop usage more than once per customer?
(2) What code we need to write in the component to stop usage of Promo Code or remove Promo Code if used already by the customer?
Thanks in advance
If you want to do it in pipelines then I recommend you create seperate pipeline configuration file (PCF) which reads each promotion code attached into the basket, checks in the database and remove it from the basket if that user already used that promo code. From the code, just you need to call this pipeline (before calling basket/total/checkout pipelines).
Hope this helps.
Ravi Kanth
http://www.facebook.com/commerceserver