Knowledge Base

View Categories

Conditional Validations

What are Conditional Validations?

Conditional validation is an advanced feature that adds flexibility to the standard Invalid and Invalid Duplicate responses within validation services. Unlike default validation, which works offline or online, conditional validation introduces special count- and duration-based rules for scans, requiring internet connectivity for execution.

Additionally, conditional validation allows you to customize validation rules using a Postback URL. Don’t worry—you don’t need to be a programmer or host your own server! Follow the steps below for configuration.

For more advanced validation methods, including both online and offline custom scripts, check out our guide on [Custom On-Device Validations (COV)].

Conditional Validation Conditions

Conditional validation empowers you to define specific conditions under which a scan is valid. Here are the most popular options:

Minimum Scans Required

  • Ensure a scan is valid only after it has been completed a certain number of times.
  • Examples:
    • A customer must scan an offer ‘X’ times to redeem it.
    • Students or members must meet attendance requirements ‘X’ times to receive a reward.

Maximum Scans Allowed

  • Limit the number of times a barcode can be scanned.
  • Examples:
    • A coupon or voucher can only be used once per customer.
    • Restrict event attendance to a specific number of visits per guest.

Start and End Time Validation

  • Control the validity of scans within specific timeframes.
  • Examples:
    • A ticket or coupon can only be used between 9:00 AM and 5:00 PM.
    • Access is disabled outside the designated hours.
  • Default timezone: America/New York

Date Range Validation

  • Restrict scans to specific start and end dates.
  • Examples:
    • A promotional code is valid only from January 1 to January 15.

First Scan Duration

  • Define a validation period that starts with the first scan.
  • Examples:
    • A voucher is valid for 48 hours after the first use.

Recurring Weekly Validation

  • Create weekly scan rules based on specific days or date ranges.
  • Examples:
    • Scans are valid only on weekdays (Monday–Friday).
    • Scans are valid on specific days like Monday, Wednesday, and Friday.
  • For non-consecutive days, the maximum scan limit resets daily.

User-Specific Scan Limits

  • Set a maximum number of scans per user.
  • Examples:
    • A value can be scanned only once per app user, but the total maximum across all users could be higher.
Conditional Validations

Requirements for Using Conditional Validation

  • Paid Plan: Conditional validation is available exclusively for paid users.
  • API Key Access: Ensure you can access your API key to configure these features.

How to Set Up Conditional Validation

Follow our step-by-step guide to configure conditional validation for your specific needs. If you encounter any challenges, contact us.

Validation Overrides

In some cases, you might need to apply different rules to specific values within the same service. Conditional validation allows you to override the primary rule by adding structured text in your database’s response column.

Example:

  • Primary rule: Scans are valid for 24 hours (duration=1440).
  • Override rule: Certain values need to be valid for 48 hours (duration=2880).

To implement this, include duration=2880 in the response text for those values.