+1-757-461-3022 x124

Creating Discounts and Coupon Codes for xTupleCommerce and xTuple ERP Sales Orders

Creating Discounts and Coupon Codes for xTupleCommerce and xTuple ERP Sales Orders

Coupon codes are an important part of the shopping experience, both online and offline. With xTuple's Discounts and Promotions package, you can now offer discounts to your customers for use either on your xTupleCommerce website or over the phone. The discounts can be based on the following:

  • Coupon codes - The buyer must have a coupon code to receive the discount.
  • Volume based discounts - The discount is automatically applied when a particular volume of particular items is added to the cart.
  • Buy One Get One (B1G1) - A free item is added to the cart when a particular item or set of items is added to the cart

In this article, we will discuss a few strategies that can be used for improving your customers' buying experience and (hopefully) increasing your sales. Throughout this article, we primiarily refer to xTupleCommerce, but please understand that everything you read here can be applied to offline orders for sellers who have the Discounts and Promotions package installed in their ERP. For more detailed information about the package, please see the Discounts and Promotions Product Guide.

Coupon Codes Defined

Coupon Codes are something that most everyone is familiar with. A buyer receives a code (usually a string of numbers and letters like 10%OFFSUMMER) through an email or other campaign. The customer can enter that code into a field during the checkout process or (in some cases) over the phone.

The coupon code may be associated with rules or restrictions. Perhaps the coupon discount only applies to a particular product, or perhaps a particular quantity of the product must be purchased for the coupon discount to apply.

Volume Based Discounts Defined

Volume based discounts are automatically applied to the customer's cart when specific criteria are met. An eCommerce site could advertise a "Buy 10 get 10% off" sale. Or, perhaps, if any ten items from a particular item group are added to the cart, then the customer receives a discount.

Buy One Get One (B1G1 or BOGO) Defined

Buy one get one is a blanket name for a strategy that involves giving the customer one or more free products if they purchase a particular item or set of items. The strategy is quite flexible. It is not limited to a quantity of one item, meaning the strategy could be "Buy 5 of Product X get 1 of Product X free". Additionally, the strategy can work across multiple products—for example, "Buy 5 of Product X get 1 of Product Y." Or it can work across groups of products—for example, "Buy any 5 items from ItemGroup X, get 5 Product X items".

The one limitation with the B1G1 discount is that only one SKU can be offered for free at a time. For instance, the system cannot be configured for the strategy "Buy 1 of Product X, get 1 of Product Y and 1 of Product Z". If that strategy were required, the ERP manager would need to create a single Item in the ERP that represented a kit, which included Product X and Product Y.

How to Implement Discounts

The process for creating discounts can be slightly confusing, the first time around. However, you'll find the process becomes signficantly easier the second and third times around. Eventually, like most things ERP-related, creating discounts will become second nature. So don't be overwhelmed by the number of steps below.

Let's look at the features within the ERP, then walk through the steps of building one of each of the discount types.

Discount Creation Steps

Below is a general outline of the steps taken to add discounts to your ERP. We go into more detail about some of these steps later in this article. You can also find more information in the Discounts and Promotions Product Guide.

  1. Create reference items for discount type.
  2. Create discount usage restriction types.

    The two previous steps are only completed once. After the resources are created, they are used for the following 2 steps:

  3. Create a discount rule.
  4. Create a discount rule assignment.

Discount Creation Steps - Explained

Create Reference Items for Discount Type

The discount applied to a purchase is recognized as a line item on the sales order. Hence, each discount type requires one item to reference it. For instance, you will need an item for "dollar off" discounts and another item for "percentage off" discounts. If you have other discount types, you will need to create an item for each of those as well.

Creating the item is similar to creating any other item. If you need a refresher on those steps, see the Reference Guide. The differences between a standard item and a discount reference item is found in the following fields:

  • Item Type: Reference.
  • Fractional checkbox: Checked. If you don’t check the Fractional box, this item won’t be available as an option when creating the actual discount code.
  • Sites Tab - Add each site in which the discount can be applied. It may be a good idea to add all existing sites, if you intend for the discount to be valid universally. If discounts are only valid for your xTupleCommerce site, then, technically, you only need to add the site associated with your xTupleCommerce website.

The following screenshot illustrates these key fields on the Item master:

Create Discount Usage Restriction Types

When the Discounts package is installed in xTuple ERP, the Usage Restrictions screen is located at Sales > Pricing > Discount Usage Restrictions. The package includes the following three discount usage restriction types by default: 

  • ONEPERCUST - Discount can be used by each customer once.
  • UNIQUE - Discount can be used by one particular customer one time. 
  • UNLIMITED - The discount code can be used by any customer any number of times.

If you have specific criteria for your discounts that cannot be created with these three restriction types, you can create additional restriction types. In most cases, these three should be sufficient. 

NOTE - The previous two steps only have to be complete once for each type. Once these references are created they can be used for all future discount creation.

Create a Discount Rule

This step is the creation of the actual discount. When the Discounts and Promotions package is installed in xTuple ERP, the Discount Rule screen is located at Sales > Pricing > Discount Rule. On this screen, you will create the actual discount, whether it is a coupon code, a volume based discount, a B1G1 discount or any other discount type you need. 

Here is a general overview of the steps required to create a discount rule. More detailed information can be found in the Implementation Guide.

  1. Click NEW.
  2. Give the discount a code, name and description. The code is required for all discounts, not only coupon codes. It should not include spaces.
  3. Set the appropriate usage restriction.
  4. Set the at level setting. The discount can either be on a particular line item or it can be on the whole order. This is especially important when working with percentage off coupons.
  5. Set the unique to setting.
  6. Set the discount type.
    • The Additional Item field is for B1G1 coupons.
      • Item Price - If you intend to give the "free" item for free, leave this setting as $0. However, if you want the customer to pay a specific (often reduced) price for the item, you can enter a price here. For example, "Buy one get one 50% off."
      • Use Item options:
      • Discount Item - Distinguish a specific SKU from the ERP.
      • Parent Line Item - The "free" item will be the same as the parent item the customer is buying.
      • Use Discount Quantity options:
        • Fixed Quantity - Set a specific quantity of "free" items the customer will receive.
        • Parent Line Quantity - Base the quantity of "free" items on the number of parent items have been purchased.
    • Price Modifier reduces the price of either the line or the whole cart.
      • Set the Modifier Type - Select the modifier type - Percent Off, Dollar Off or Reverse Full Amount.
      • Set the amount of the discount (either the fixed amount or the percent off).
    • Use Item - Select the item that you created initially for the discount (typically percent off or dollar off).
    • Use Discount Quantity - Only active if you are creating a Fixed Amount coupon. This can be set to a Fixed Qty or the Parent Line Qty. This is helpful if you are offering a coupon for a particular item. You can choose if the buyer will receive the discount for either a set number of the line item quantity or the whole total of the line item quantity. Think - “Get a discount on this item. Only valid for up to 5 items”.
  7. Applies Automatically checkbox - If this is checked,  the discount will be applied to the cart as soon as the criteria is met. A coupon code is not required. This is how you set a discount to a volume based discount. 
  8. Effective Dates - You can set a start and end date when the coupon/discount is valid.
  9. Minimum Required Checkbox - This is used if you have requirements for when the discount is valid. Perhaps the user must buy ten of a particular SKU before they receive the discount. Select one of the following options and enter the qualifying information in the associated fields.
    • Item Qty/Volume - The number of a particular line item must reach a specific value or more.
    • Item Total Dollars - The value of a particular line item must reach a specific value or more.
    • Order Qty/Volume - The number of all order items must reach a specific value or more.
    • Order Total Dollars - The cart must reach a specific value or more.
    • Repeat for each minimum met - if checked, the discount will be applied to the order for each time the specified critera is met. For instance, if your discount it to apply $5 off the whole order for every $50 spent. The cart will receive the following discounts at the specified cart values.
      • Cart is $60 = $5 off.
      • Cart is $102 = $10 off.
      • Cart is $583 = $55 off.
  10. Limit Application Items Checkbox - This is used if you want to control which items, item groups, product categories or line item types that the coupon can be used against. This is good if, for instance, you only want to allow the coupon to be used against a particular type of product.

The following screenshot shows a sample discount rule:

Create a Discount Rule Assignment

Once you have created your coupon code, you need to assign the discount rule to a particular customer, customer type, customer type pattern, or sale type. When the Discounts and Promotions package is installed in xTuple ERP, the screen needed for this task is located at Sales > Pricing > Discount Rule Assignment. From that screen, follow these steps:

  1. Click NEW.
  2. Select the appropriate parameter for the assignment.
    • Customer - For assigning the discount to a particular customer.
    • Customer Type - For assigning the discount to a particular customer type.
    • Customer Type Pattern - For assigning the discount to a particular set of customer types defined by a shared value. If you want to apply the discount to 100% of customers, enter the value .* into this field.* .
    • Sale Type - for assigning the discount to a particular sale type. For instance, if this coupon is good for web based sales, but can't be used over the phone, you'd apply that setting here.
  3. Assign a value to the parameter you selected.
  4. Choose the Discount Rule that this assignment is associated with.
  5. Save.

It is possible to create two restrictions for one discount. One restriction can define a sales type, and the other restriction can define either a customer, customer type, or customer type pattern. For instance, you can create a discount code that is valid for all customer types but only for online orders. Other than this combination of sales type and customer type definition, you cannot create additional discount assignments for 1 discount code. 

IMPORTANT - If you want the coupon/discount to be applicable to all customers of all customer types, select “Customer Type Pattern” and in the field insert a period and an asteriks “.*” which is code for “Every available option."

Example Discount Codes

The following examples represent different discount types and provide a general overview of how the rules and assignments would be configured to achieve these examples. Each of these examples assumes that the reference items and rule restriction types are already set up in the ERP.

$5 Off Coupon - no requirements - can use until a particular date

  • Usage Restriction: Unlimited.
  • At Level: Whole order.
  • Unique To: Whole order.
  • Discount Type: Price modifier.
  • Modifier Type: Fixed amount.
  • Discount By: $5.
  • Use Item: Reference the Dollar Off item.
  • Use Discount Quantity: 1.
  • Expires: Insert the expiration date.

10% Off Coupon - only good when 5 of a particular item are bought

  • Usage Restriction: Unlimited.
  • At Level: Order line.
  • Unique To: Order line.
  • Discount Type: Price modifier.
  • Modifier Type: Percent off.
  • Discount By: 10.
  • Use Item: Reference the percentage off item.
  • Minimum Required: Checked.
    • Type: Item qty/volume.
    • Qty: 5.
    • UOM: whichever UOM is appropriate.
  • Limit Application Items: checked.
  • Items Tab: SKU for this particular discount is added to the list.

Buy 5 of a particular item, get 1 of a different item for free

  • Usage Restriction: Unlimited.
  • At Level: Order line.
  • Unique To: Order line.
  • Discount Type: Additional item.
  • Item Price: $0.
  • Use Item: Discount item - select SKU of item you are giving for free.
  • Use Discount Quantity: Fixed Qty 1.
  • Minimum Required: Checked.
    • Type: Item qty/volume.
    • Qty: 5.
    • UOM: Whichever UOM is appropriate.
  • Limit Application Items: Checked.
  • Items Tab: SKU for this particular discount is added to the list.


Once each of these steps have been followed, the discounts are ready for use on the xTupleCommerce site or within the ERP. With all the variables available to you, there are many different types of discounts that can be created and used for your xTupleCommerce website, in person sales or even over the phone sales.

As we mention in all these articles, the first best step is to sit down with a pen and paper and sketch out how your discounts will work. Then, once you've "engineered" your discounts, log into the ERP and get to work. 

38 users have voted.