Discount codes are an easy way to offer promotional pricing to your customers. A customer simply enters a code during the quote journey and, if the code is valid and within its promotional period, the appropriate discount is applied automatically.
This article demonstrates how to build discount codes directly into your rating file.
Step 1 - Create a Discount Code Question
Add a Text question to your question set where the customer can enter their discount code.
This is typically placed on the final page of the quote journey.
For example:
| Property | Value |
|---|---|
| Question | Discount Code |
| System ID | DiscountCode |
| Type | Text |
When a customer reaches this page they can enter a code such as:
- SUMMER10
- THANKYOU5
- NEW2026
Step 2 - Create a Discount Rating Field
Create a rating field to hold the discount value.
This is normally created within your Risk Groups alongside your other premium calculations.
For example:
| Rating Field |
|---|
| DiscountCode_Main |
This field will store the discount amount before it is included in your overall premium calculation.
Step 3 - Add the Discount Codes to Your Rating File
Each discount code is represented by its own rating block.
The rating block checks:
- The policy inception date falls within the promotional period.
- The customer entered the correct discount code.
- The appropriate discount is applied.
For example:

Understanding the Formula
Each rating block begins with a formula such as:
Formula:IF([Policy.InceptionDate] >= #2026-07-01#,IF([Policy.InceptionDate] <= #2026-09-01#,1,0),0)This checks whether the policy inception date falls between 1 July 2026 and 1 September 2026.
If it does, the formula returns:
1If it does not, the formula returns:
0The rating row is only processed when the formula returns 1.
Example
A customer enters:
SUMMER10Policy inception date:
15 July 2026The formula returns:
1The discount code matches SUMMER10, so:
SetRate:DiscountCode_Main
-10is applied.
If the same customer selected an inception date of 15 October 2026, the formula would return 0 and no discount would be applied, even though the code itself is correct.
Adding New Discount Codes
Adding another promotional code is simply a matter of copying an existing rating block and changing:
- The start date
- The end date
- The discount code
- The discount amount
Best Practice
- Use meaningful discount code names such as SUMMER10 or NEW2026.
- Keep each promotional campaign in its own rating block.
- Date-gate every discount code to prevent expired promotions being used.
- Test both valid and expired scenarios before releasing a promotion.
- Consider placing all discount code sections together within the rating file to make future maintenance easier.
This approach keeps the rating file simple to understand, makes promotions easy to add or remove, and ensures discount codes automatically expire without requiring further changes once the promotional period has ended.
Choosing the Right Approach
This article demonstrates how to build discount codes directly into your rating file. This approach is ideal where you only have a small number of promotional codes that are added or changed infrequently.
For example, if you have three or four seasonal promotions each year, creating a separate rating block for each code is simple to understand and easy to maintain.
If you expect to manage a larger number of discount codes, or frequently add and remove promotions, consider storing your discount codes in a lookup file instead. Using a lookup file means you can maintain your discount codes in one location without continually expanding your rating file. This provides a more scalable solution for schemes with many promotional campaigns.


| Number of Discount Codes | Recommended Approach |
|---|---|
| Small number (e.g. 1–5 codes) | Build directly into the rating file (as shown in this article). |
| Large number (e.g. 5+ codes or regularly changing promotions) | Store the codes in a lookup file and retrieve the discount from the rating file. |
Tip: If your marketing team regularly creates new promotions, a lookup file is generally the preferred solution as it reduces ongoing maintenance and keeps the rating file much cleaner.

