Skip to main content
Attributes are the building blocks of rule logic. Every condition in the Rule Engine references an attribute — a named piece of data that carries a value at evaluation time. Loyalife supports four categories of attributes, each serving a different purpose. Rule conditions combine attributes from both transactions and members in a single rule — what happened in the transaction and who the member is.

Attribute categories

Global transaction attributes

The seven global transaction attributes are built into every Loyalife program and are present on every transaction. They cannot be removed.
AttributeAPI / file keyData typeMandatoryDescription
Transaction Idtransaction_idStringYesUnique identifier for the transaction — used for deduplication
Transaction Datetransaction_dateDateYesDate (and optionally time) of the transaction. Supports combined date+time conditions in rules
Transaction AmountamountDecimalYesMonetary value of the transaction in the program currency
Product Codeproduct_codeSelectionYesProduct category classification — values are configured per program
Sub Product Codesub_product_codeSelectionNoSubcategory within the product code
Relation Referencemember_relation_referenceStringYesThe member’s unique identifier — links the transaction to their account
Transaction Typetransaction_typeSelectionYesDirection of the transaction: CR (credit/earn) or DR (debit/redemption)
Product Code and Sub Product Code are selection type — the allowed values are a configurable picklist. For these attributes, the “Match attribute” comparison is not available; only fixed value selection is supported.

Custom transaction attributes

Beyond the seven global attributes, you can define additional transaction attributes specific to your program. These are configured in Rule Engine → Attributes and must be submitted with each transaction via API or TXN file. Common examples:
Custom attributeExample use in a rule
Merchant NameIF Merchant Name ilike "Fuel" THEN 2x points
MCC CodeIF MCC Code = 5411 (grocery) THEN 1.5x points
ChannelIF Channel = "Online" THEN bonus 50 points
Store IDIF Store ID in_group [premium_stores] THEN 3x points
CurrencyIF Currency = "USD" THEN apply FX rule
To create a custom transaction attribute, go to Rule Engine → Attributes → Add Attribute and select “Transaction” as the attribute type. Once saved, the attribute appears in the Rule Engine condition builder and must be supplied in every transaction submission that should have it evaluated.

Member attributes (global)

The nine built-in member profile fields available in every program. These are set at enrollment and updated via API or the member profile in the admin portal.
AttributeData type
Relation ReferenceString
Full NameString
EmailString (PI)
PhoneString (PI)
AddressString (PI)
GenderString (PI)
Date of BirthDate (PI)
StatusString
Preferred LanguageSelection

Custom member attributes

Any additional member-level fields you define for your program — occupation, product preference, dealer tier, etc. Configured in Members → Attributes. Once created, they appear automatically in the Rule Engine condition builder and in Segment filters.

Aggregate attributes

Computed metrics derived from transaction history. The Rule Engine calculates these dynamically at evaluation time.
AttributeDescriptionExample value
Monthly Spend Sum (MTD)Total transaction amount this calendar month₹18,500
Transaction Count (MTD)Number of transactions this calendar month7
Average Transaction ValueAverage spend over recent transactions₹2,642
Lifetime Spend SumTotal spend since enrollment₹2,34,000
Lifetime Transaction CountTotal number of transactions ever89
Aggregate attributes appear automatically in the Rule Engine condition builder and in Segment filters. Any new aggregate attribute you define will appear in both places without additional configuration. Key aggregate evaluation rules:
  • The current transaction is included in the aggregate count/sum before rule evaluation
  • Reversals and refunds are automatically subtracted from aggregates
  • Aggregation runs at the account level — transactions from primary and supplementary cards are counted together

Aggregate time periods

When creating an aggregate attribute, you select the time window over which it is calculated:
PeriodInternal valueDescription
Lifetime1Computed from the member’s enrollment date to now — never resets
Month to Date (MTD)2Resets on the first of each calendar month
Quarter to Date (QTD)3Resets at the start of each calendar quarter (Jan/Apr/Jul/Oct)
Year to Date (YTD)4Resets on January 1st each year
Rolling5A sliding window of N days back from the current date (e.g., last 30 days, last 90 days)
Billing Cycle6Follows the program’s configured billing cycle start/end dates rather than calendar boundaries
Choose Billing Cycle for programs where the calculation period aligns with statement or billing periods rather than calendar months. The billing cycle start date is configured in Configuration → Calculation Settings.

Aggregate functions

Each aggregate attribute applies a statistical function across qualifying transactions in the selected time window:
FunctionDescription
sumTotal of all values (e.g., total spend, total points)
countNumber of qualifying transactions
maxHighest single value in the period
minLowest single value in the period
avgAverage value per transaction in the period

Using attributes in rule conditions

In the Rule Engine condition builder, every condition selects:
  1. An attribute (from any category above)
  2. An operator (equals, greater than, between, is multiple of, etc.)
  3. A value — either a static input or another attribute (for dynamic comparisons like birthday rules)
Date attribute type modifiers: When a date attribute is selected, you can further specify what part of the date to compare:
Type modifierCompares
Full dateComplete date value (e.g., 04/22/2026)
Date of MonthJust the day number (1–31)
Month of YearJust the month number (1–12)
YearJust the year
Day of WeekMonday, Tuesday, etc.
This allows rules like “transaction on the same day-of-month as the member’s birthday” without needing to know which month.

Accessing the Attributes Manager

Manage Attributes screen showing Global Attributes (Transaction Id, Transaction Date, Transaction Amount, Product Code, Sub Product Code, Relation Reference, Transaction Type) and Local Attributes section below for custom transaction attributes
1

Navigate to Rule Engine

Select Rule Engine from the left sidebar.
2

Open the Attributes Manager

Click the settings icon in the upper-right corner of the Rule Engine screen.
3

Browse existing attributes

The Attributes Manager lists all attributes configured for your program, organized by category.

Creating a custom attribute

1

Click Add Attribute in the Attributes Manager

Choose the attribute category: Transaction (local) or Member (custom).
2

Fill in attribute fields

FieldDescription
Attribute nameThe label used in the Rule Engine condition builder
Data typeString, Number, Boolean, Date — determines which operators are available
API / File keyThe exact field name used when submitting data via API or TXN file
Unique constraintWhether values must be distinct across records
MandatoryWhether a value is required for every transaction
PI flagMark as personally identifiable — controls export permissions
3

Save

Click Save. The attribute is immediately available in rule conditions and segment filters.
New aggregate attributes you create are automatically available in both the Rule Engine condition builder and in Segment filters — no additional steps required.
An attribute’s data type cannot be changed after it has been used in a live rule. Plan your data model carefully before publishing rules that depend on a new attribute. A wrong data type will require creating a new attribute and migrating any rules that referenced the old one.

Attribute data types and compatible operators

Data typeCompatible operators
Number= (equals), != (not equals), > (greater than), >= (greater than or equal), < (less than), <= (less than or equal), in_group, not_in_group, is_multiple_of
String= (equals), ilike (contains / case-insensitive match), not ilike (does not contain), is null (no value set), is not null (value is set), in_group, not_in_group
DateOn (exact date match), Not on, After, Before
BooleanEquals, Not Equals
Operator notes:
OperatorNotes
ilikeCase-insensitive substring match — e.g., merchant name ilike “fuel” matches “Shell Fuel” and “FUEL MART”
not ilikeExcludes records containing the substring
is null / is not nullChecks whether the attribute has any value set — useful for filtering members with missing profile fields
in_group / not_in_groupMatches against a pre-defined list or group of values; useful for MCC code lists, product code whitelists/blacklists
is_multiple_ofFires the rule when the aggregate value is a multiple of the threshold (e.g., every 10th transaction)
Date condition type modifiers (for recurring date rules): When using date attributes in recurring or comparative conditions, you can specify which portion of the date to evaluate:
Type modifierCompares
Full dateComplete date value
Day of MonthJust the day number (1–31)
Month of YearJust the month number (1–12)
Day of WeekMonday, Tuesday, etc.

Troubleshooting

An attribute is not appearing in the Rule Engine condition builder.
  • Verify the attribute is saved and active in the Attributes Manager.
  • Check that the data type is compatible with the condition you’re trying to build.
Aggregate values are not matching expected transaction totals.
  • Remember that the current transaction is included in the aggregate before evaluation.
  • Reversals and refunds are subtracted — check whether any reversals occurred in the calculation period.
  • Verify the aggregate’s period definition (MTD means month-to-date, which resets on the first of each month).