Coupons are used as an eligibility requirement for the discount and one or more unique coupons are associated with a discount. Only when the users enter the correct coupon code, the discount is applied to the basket.
 
Creating coupon codes is simple and based on multiple properties, the behavior of the coupon code will change. Some of the properties are
 
Usage Limit : This specifies number of time the user can apply this coupon to the basket.
Type           : This specifies coupon type. Coupon type can be public, private or restricted. public coupons can be used by everyone. private coupons are targeted to specific users. Each user will get a unique private coupon.  Restricted coupons are restricted to single user and may be used multiple times. 

Import file format  one (text file or csv file)
CouponCode    TargetUser <!—header : compulsory to add in import file. –>
XX0F5RMFGX        ravi@kanth.com
XX2KVC59KX        rk@rk.com
XX6NJD2NGX        ravi@ava.com
XXF05PQ3CX        kanth@kanth.net
XXJ684X3VX         ravikk@msn.com
XXKTVCTMFX       kanth@ravikanth.net
XXM1N27QXX      ravi@hotmail.com

Import file format  two (text file or csv file)
TargetUser   <!—header : compulsory to add in import file. –>
ravikk@msn.com
ravikanth25@yahoo.com
ravi@ravi.com
kanth@ravi.com
ram@ram.com
 

In private coupon codes, if you opt for generating codes, commerce server generates X number of codes but it will not associate user Ids to individual codes. But, if we provide coupon codes with target user details then commerce server import coupon code and target user.
 
Let’s create restricted coupons for these users. I have already created a discount and through add coupons screen, I am creating restriction coupon code.

  • Double click on a discount and click on coupons tab.
  • Click on “Create New” button to create coupon definition (as shown below).
Coupon definition creation wizard.

Coupon definition creation wizard.

Once the definition created, the screen looks as shown below. Now click on “Add coupons” button at the bottom.

Coupon Definition after creation.

Coupon Definition after creation.

  • All coupon code definitions are auto populated. Press next screen.
Coupon Definition Step 1

Coupon Definition Step 1

  • Give name to batch creation and select – “Generate coupons from user list”. Now we are expected to go for import format 2 (i.e., only email ID).  Press next screen.
Coupon Definition Step 2

Coupon Definition Step 2

  • In this screen, we will specify how the coupon code should look like. It takes prefix suffix and number of characters. After entering all required details, press next button.
Coupon Definition Step 3

Coupon Definition Step 3

  • This is the last screen which expects import file input. Press next screen to finish the wizard.
Coupon Definition Step 4

Coupon Definition Step 4

All generated coupon codes are stored in mktg_promocode table. If you observe, all promotion codes are associated with the emails IDs provided through import file.

 Coupons in database

Related Articles


If you like this post, please click on our sponsor advertisement.


8 Responses to “Working with Commerce Server Coupon codes”

  • Adam:

    Hi There! I’ve been scouring the internet for this kind of information to no avail until I stumbled across yours! I’ve tried everything, but cannot get the Marketing Manager to accept my file for the “Batch Import File Selection” stage of adding a restricted coupon… Can you make any recommendations?

    I really need to create a single-use series of coupons, am I even heading in the right direction?

    Thanks,

    Adam

  • Adam,
    Have you followed the steps mentioned in the article? What error you are getting in Marketing Manager? Have you checked whether you have permissions in Azman?

    Regards,
    -Ravi Kanth

    • Adam:

      Apologies – I didn’t get an email from the site that you had replied! I was able to figure it out eventually, though I’m still not sure what was preventing my files from being imported!

  • Sercan:

    I have created a restrict promotion code with spesific users and add it into a discount

    then i run specified user basket basket pipeline with specified promocode. but i cant see the discount in my basket page.

    I can use private and public coupon discounts. but when ı create it with a target user ı cant see what is the problem?
    Here is my code sample

    Guid registeredUserId = (Guid)Membership.GetUser(2@2.com).ProviderUserKey;
    registeredUserBasket = OrderContext.Current.GetBasket(registeredUserId, “Default”);

    registeredUserBasket.OrderForms[0].PromoCodes.Clear();
    if (!string.IsNullOrEmpty(txtPromotionCode.Text))
    registeredUserBasket.OrderForms[0].PromoCodes.Add(txtPromotionCode.Text);

    PipelineInfo pipeline = new PipelineInfo(“basket”, OrderPipelineType.Basket);
    registeredUserBasket.Save();
    registeredUserBasket.RunPipeline(pipeline);
    dgBasket.DataSource = registeredUserBasket.OrderForms[0].LineItems;
    dgBasket.DataBind();

    this code is working for private promocodes but not working restrict.
    i have checked the database everything is ok.

    is there any missing thing?

  • Sercan:

    is there anyone to solve my problem
    Thanks

  • Sudhakar:

    Hi Ravi,

    Thanks for the valuable post related to coupon codes.
    We have one requirement where
    Can we create restricted promocodes for email addresses as groups.
    business wanted to create couple of email addresses as group and they wanted to create restricted promo codes for the selected groups.

    Please let me know if i am not clear.

  • No Sudhakar.. this is not available as Out Of Box feature from commerce server.

  • Sudhanshu:

    Hi Ravikant,

    I am facing an issue while creating/using “Private” coupon.
    As per my client requirement: Coupon should be used ones. Hence I have made the Usage limit to 1.
    As per my site requirement: user has to sign-in for making purchase.

    As a guest, user is able to use the Coupon and relevant discount has been shown to him in shopping cart.
    But when he login on the site for the purchase and making payment, he is not able to see the applied discount on the cart and at the same time he/she can’t use the same again coupon. Just because of this I have to inform users to use coupons only after login.
    Every thing works fine if I change the usage limit to 2.

    Is it a bug in Commerce Server 2009 or I am missing any thing while creating the discount. Please help me.

    Thanks for your help in advance.

Leave a Reply

Follow me on Google+
Add to circles

In 0 people's circles

Sign up for Newsletter