Tutorial: Automatic validation of purchase receipts through OCR technology Follow
Have you created a promotion where users are requested to upload an image of their purchase receipts to participate? Promotions with the requirements “Upload Receipt” or “Validate Code” enabled can now use the OCR technology. OCR, or "Optical Character Recognition, allows the recognition of text on images, facilitating the verification of the validity of receipts uploaded by users. Using the OCR technology will allow you to automatically validate the receipts submitted in your promotion(s).
This technology analyzes the content of the purchase receipt uploaded by the user to verify that it meets the determined conditions or rules to be valid. These conditions could be, for instance, that the receipt has to have a minimum purchase amount, that it is from a specific store, or that it includes a specific code (for example, the invoice number).
This functionality is designed for promotions where direct prizes upon participation are distributed, such as the Spin the Wheel dynamic, or Instant Win campaigns, where users can receive a prize directly after registering and participating in the promotion.
So... How does it work?
The OCR feature allows you to create conditions that will be based on the presence of a given text in a receipt or a certain amount on a purchase receipt in order to be able to perform automatic validations. For example, you can request users to upload a receipt from your store of $30 or above, to be able to participate in the promotion.
With the OCR technology and the validation conditions that can be configured, the system will check each of the receipts uploaded by the users to ensure that only receipts that meet the established conditions are accepted.
What you should know before starting:
- Automatic validation through OCR technology is available in the White Label version and is limited to 5,000 validations per promotion. Contact us if you think you will have more.
- This functionality is available both in the case of activating an individual promotion and through a White Label plan or Corporate plan.
Step-by-step instructions
In this tutorial, we explain how to enable automatic validation via OCR and the different validation conditions that you will be able to set up.
-
Activate the receipt validation using the OCR system
-
Set up receipt validation conditions
-
Protections against fraud
-
How to test the validation of the receipt (also useful to check issues reported by users)
1. Activate the receipt validation using the OCR system
You will be able to access the promotion and enable there the automatic validation via OCR following these steps:
1. Enter the Editor of the promotion > Participation > You then select your stage > Requirements:
2. There, check the box "Check the receipt against the OCR":
Once the validation via OCR is activated, the next step is to set up the validation conditions, which we explain in the next point of the tutorial.
Note: Automatic validation through OCR technology is only available in promotions created with the White Label version. In case that you have created the promotion in the Premium version and you need to enable the OCR validation, you have the possibility of duplicating the promotion and copying it in the White Label version, as we explain in this tutorial.
2. Configure the receipt validation conditions
To ensure that the receipt, invoice, or receipt uploaded by the user is valid, you will create the validation conditions, which are the ones that the system will use to verify the content of the purchase receipt uploaded by the user and thus determine if it is valid or not.
Note: It's necessary to add minimum one validation condition for the OCR system to work properly.
To add validation conditions, click on the Edit Settings link, then on the “Add Condition” button:
Four different types of validation conditions can be created:
1. Condition of the presence of one or more texts
This rule allows you to search for a specific text within the receipt. For example, a VAT number, telephone number, the name of a business, or the name of a product must appear in the user receipt.
In practice: Let's imagine that we want to make sure that the purchase receipt includes the name of our store. In this case, we would add the following validation rule:
- Field: Receipt text
- Operator: Contains
- Value: Here we enter the name of the store, exactly as it appears printed on the receipt or purchase receipt.
Multiple text conditions can be combined. Following the previous example, if we want the validation to be more specific, we can add a second text presence rule to validate that the receipt contains the name of the specific city where the store is located:
In this case, having added two text conditions, the receipt must contain both the name of the store ("Frog Trips") and the city where the shop is located ("London").
Tip! If receipts from the Frog Trips store are valid and promotion is organized between shops in several different cities, in this case, we will apply the "Regular expression" condition using the | to separate the different valid cities:
Important! The system will look for and request the presence of the exact text (Uppercase and lowercase sensitive), therefore when creating the condition, it is important to write the name as it will appear on all purchase receipts.
2. Condition on the purchase amount
With this rule enabled, the users will be requested to enter the amount of the purchase receipt that they want to upload, so that the validation system will perform two checks:
- It will verify that the amount entered by the user is present within the receipt.
- It will check that the amount of the receipt meets the minimum amount established in the validation condition.
Practical example: Only receipts worth more than € 20 will be valid. The amount can be the total or that of an item from the receipt.
In this case, we will have to perform two actions:
- Check the option "Enable conditions based on the amount of the receipt", which you will find at the bottom of the page. Once enabled, you will see that a text field will be added to the participation requirement page, where the users will enter the amount of their receipt.
- Add the following Condition:
- Field: Receipt amount
- Operator: Equal to or greater than
- Value: Here we enter the minimum amount that the purchase receipt must contain.
Additional configuration for "Stamp Card" stages
For stages of the type "Stamp Card," there's an additional configuration option called "Amount per stamp," which allows you to specify the amount that each stamp represents.
Example: You can indicate that for every 10€ spent, a stamp has to be marked on the stamp card. So if you upload a 40€ receipt, the system will mark 4 stamps. If you upload a €35 receipt, the system will mark 3 stamps on the card.
Check the step-by-step tutorial of the Stamp card application.
3. Condition on the date of the purchase receipt
With this rule enabled, you'll be able to indicate which range of dates is valid and the system will try to detect automatically the dates of the receipt in order to determine if the receipt is valid or not. In addition, you'll be able to configure the date format of the receipt by specifying the order of the elements year, month, and day.
Practical example: Receipts will only be valid from a certain date, for example, receipts will be valid from August, 31. The system will verify the date of the receipt and will only validate it if the date meets the condition.
Note: The system can only auto detect the receipt date with numeric format. Receipt dates with the name of the month won't be detected.
In this case, we will have to perform two actions:
- Check the option "Enable conditions based on receipt date", which you will find at the bottom of the page. Once enabled, you will see that the system will ask you to configure the date format indicating the order of the year, month, and day elements according to the country where your promotion takes place.
- Add the following Condition:
- Field: Date.
- Operator: Less than or greater than
- Date: Here we indicate the valid date of the purchase receipt.
4. Unique code condition
For an even more exhaustive verification of the receipt or purchase receipt uploaded by the user, you can ask the user to enter a unique code present on the receipt and the system will verify that it is indeed on the receipt and that no other user has registered it before.
For instance: If the receipt includes a receipt ID or reference, or a simplified invoice ID, you can ask the user to also enter that code when uploading the purchase receipt. In this way, the system will analyze the receipt and verify that the code appears on the receipt and that, in addition, it has not been previously entered.
To do this, you will need to follow these steps:
1. Enable the requirement "Validate Code".
2. Use the method of validation by a "regular expression" in order to determine a pattern that determines the format that the unique code printed on the receipt should have. For example, if the invoice ID is 6-digit numbers, you can use the regular expression: [0-9]{6}. In this way, the system will check that a 6-digit code appears on the purchase receipt, corresponding to the invoice ID.
3. Finally, in the configuration screen for validation via OCR, check the "Verify that the code appears in the image" box.
3. Protection against fraud
To minimize fraud in the uploading of receipts by users, the validation system via OCR includes three fraud controls:
Note: Just like the OCR system, it's necessary to have at least one condition for the fraud control to work properly. Example: Add a "Text length" condition, where you indicate the minimum number of characters the receipt should contain.
A. Detection of the same image
The user will only be able to upload the same photo once, and the system is capable of detecting if a user is trying to upload the same image several times. If so, it will not return the receipt as valid.
B. Receipt similarity detection
In the same way, the system is capable of detecting if the user tries to use the same receipt but with a new photo. For this, the administrator can enable the option "Fraud control due to similarity of receipts, which allows the system to check if the photo that the user is trying to upload corresponds to a receipt that the same user had previously uploaded.
In addition, the sensitivity level of this control can be adjusted to minimize the possible false negatives that could be generated. Example: If all the receipts are from the same store and, therefore, probably will be very similar, surely we would be interested in setting a lower detection level, Whereas if the purchase receipts are from a shopping center with several stores and, therefore, the receipts will surely be very different, we can increase the detection level and chose a higher level of fraud detection.
Recommendation! The best system to ensure that the same receipt is uploaded only once in the whole promotion is by using single code validation. If the purchase receipts are from the same store, and each receipt comes with a different identifying number, use the validation by unique codes.
C. Control by number of characters in the purchase receipt
To prevent the system from returning as valid a fake receipt designed manually by a user to try and enter your promotion -for instance, a piece of paper where they wrote by hand only the name of the brand and an imaginary amount-, we can apply a control that allows us to verify that the receipt contains a minimum number of characters.
To apply this fraud control you must add a validation condition with the following characteristics:
- Field: Text length
- Operator: Greater than
- Value: Here you can indicate the minimum number of total characters that the purchase receipt must contain.
How to minimize false negatives?
If the system does not accept as valid a receipt that, due to its characteristics, meets the validation conditions set by the administrator and, therefore, is a valid receipt, we are talking about a false negative. The way to control these cases and thus minimize the incidents that users can report is to review and refine the instructions where you clearly will detail how the receipt should be so that the system returns it as valid.
To facilitate this, the promotion comes with default Instructions, which can be applied in most purchase receipts validations:
The receipt photo must meet these criteria:
- Only one receipt should appear.
- The receipt appears complete.
- All content is readable.
- The receipt is not wrinkled or folded.
- The receipt has no stains.
- The back of the receipt is not visible. Avoid backlit photos.
- Make sure you focus well on the receipt.
- The valid formats are: jpg, png, gif and webp.
These instructions that come by default can be completed or modified in order to adapt them to the specificities of each campaign.
4. How to test the validation of the receipt
From the Promotion Editor, the administrator has the possibility to test and run trials of the validation rules that have been configured, in order to make sure that everything works correctly and make any adjustments necessary.
To do this, on the Settings page of the validation system via OCR, on the right side of the screen the administrator will see a preview of the Requirement page, which is fully functional, in the sense that it will allow you to perform the test and thus check the operation of the validation system.
This way, the Test tool can also be of help when the administrator needs to check and solve possible issues reported by users who try to upload receipts and the system does not return them as valid. In this way, the administrator will be able to request the receipts from the users and, using the Test tool, will be able to check all the text that the system is detecting in each receipt and check the reason why the system is not accepting it as valid:
Comments
0 comments
Please sign in to leave a comment.