Skip to main content
Rules don’t exist in isolation. They depend on attributes to know what to evaluate, on members to know who earns, and on rule groups to know which members a set of rules applies to. Before the first transaction is processed, each layer must be in place. This guide walks through every step in the correct sequence.

The setup dependency chain

Each layer depends on the one above it. Attributes must be defined before rules reference them. Members must be enrolled before transactions can be attributed to them. Rule groups must exist before transactions are evaluated. Segments are not required. A rule group with no linked segment applies to every member in the program. Only create segments when you need rules to target a specific subset of members.

Phase 1 — Program configuration

Before attributes or rules, your program’s foundational settings must be in place. Navigate to Configuration → Program Settings and verify:
Product Code and Sub Product Code are selection attributes — their allowed values come from the configured picklist. If a rule condition needs to check Product Code = "Retail", the value Retail must exist in the picklist before the rule can reference it.

Phase 2 — Define your data model

This is the most important planning step. Attributes are the vocabulary your rules speak. Every condition in a rule references an attribute. Get the data model right before building rules — changing an attribute’s data type after it is used in a live rule requires creating a new attribute and migrating all rules that referenced the old one.

2a. Member attributes

Nine global member attributes (Relation Reference, Full Name, Email, Phone, Address, Gender, Date of Birth, Status, Preferred Language) are available in every program without any setup — see Member Attributes for the full reference. For program-specific member data, define custom member attributes at Members → Attributes → Add Attribute. Before creating custom attributes, answer:
  • What member-level facts do my rules need to check? (card type, dealer tier, KYC status)
  • What member-level fields do my segments need to filter on? (region, product holding, enrollment channel)
  • What columns does my CPD file contain beyond the standard fields?
Example — retail bank loyalty program:

2b. Transaction attributes

Seven global transaction attributes are present on every transaction: For transaction-level data beyond these seven, define custom transaction attributes at Rule Engine → Attributes → Add Attribute (not under Members). Before creating custom transaction attributes, answer:
  • What transaction-level data should rules evaluate? (merchant name, MCC code, channel, store)
  • What columns does my TXN file send beyond the standard seven?
  • What fields does the transaction API payload include?
Example — retail bank loyalty program:
The API / file key you set here is the exact field name that must appear in every TXN file column header and every API payload key for this attribute. A mismatch means the attribute arrives as null — the rule condition sees no value and evaluates to false.

Phase 3 — Enroll members

Members must exist in Loyalife before any transaction can be attributed to them. Two methods:

CPD file (bulk enrollment)

Upload a CPD file via SFTP to upload/CPD. Each row is one member. For new members, set Action Type = N. Required columns:
The column name for each custom attribute must exactly match the API / file key configured in Members → Attributes. After upload, each member has:
  • A Loyalife account linked to their Relation Reference
  • Global and custom attributes populated from the file
  • A starting balance of zero
  • Aggregate attributes initialised at zero (they build as transactions arrive)

API (real-time enrollment)

Use the Create Member Profile endpoint to enroll members from your application as they register. The same attribute mapping applies — API keys must match what was configured in Members → Attributes.

Phase 4 — Create rule groups

Go to Rule Engine → Create Rule Group. Give the group a name, optionally link it to a segment (leave blank to apply to all members), and set any caps you need. See Rule Groups for the full field reference and cap behaviour. The key structural decision is how many groups you need and how to divide them. A group per logical earning category keeps them independently manageable — you can pause a promotional group without touching base earning. Example structure:
A member can earn from multiple rule groups simultaneously. A Platinum cardholder buying something on a Saturday earns from Base Earning AND Platinum Benefits AND Weekend Promotions in the same transaction — each group’s caps are tracked independently.

Phase 5 — Create earning rules

Each rule group can contain one or more earning rules. Every rule is an IF / THEN statement evaluated against each transaction. Go to Rule Engine → [select a rule group] → Add Rule.
Add New Rule form showing Rule Details at the top (rule name, version, sequence), followed by Set Rule Conditions with IF attribute/operator/value dropdowns and AND/OR condition builders, and a THEN Points section with reward type selector

IF conditions

Each condition has three parts: an attribute, an operator, and a value. Multiple conditions combine with AND (all must match) or OR (any must match).

THEN reward

Restrictions

Add restrictions to control when and how much the rule fires:

A complete example

Rule Group: Base Earning (no segment — all members) Rule Group: Platinum Benefits (segment: Premium Card) Rule Group: New Member Welcome (segment: New Members) Rule Group: Weekend Promotions (no segment — all members)
Rules within the same group all evaluate simultaneously against the same transaction. A Platinum cardholder transacting on a Saturday online earns the weekend multiplier and the online bonus and the base points — from different rule groups running in parallel.

Advanced rule conditions

”Is Multiple Of” operator

The Is Multiple Of operator is available for aggregate integer attributes (e.g., Monthly Transaction Count, Lifetime Transaction Count). It triggers a reward every time the member’s aggregate value reaches a multiple of the configured number. Example: Reversals are deducted from the aggregate count and can affect whether the multiple condition is met.

Attribute-to-attribute date comparison

Rule conditions can compare two date-type attributes against each other — not just a date attribute against a fixed value. Example: Rules and constraints:
  • Self-comparison (an attribute compared against itself) is prevented
  • Comparisons between incompatible data types are blocked
  • Date-type fields are auto-locked in the comparison selector to enforce valid pairings
Combining both conditions (Day of Month AND Month of Year) creates a birthday rule that matches only on the exact calendar day — useful for birthday cashback without hardcoding dates.
Members with no value recorded for the comparison attribute (e.g., no Date of Birth) will not match the condition and will not receive the reward.

Time picker for Transaction Date

The Transaction Date attribute now includes a time selector (HH:MM, 24-hour format) alongside the date picker:
  • The default time is 00:00 if not explicitly set
  • The combined value is stored and evaluated as MM/DD/YYYY HH:MM
  • For the Between operator, each date boundary has its own independent time selection
  • Existing date-only rules are fully backward compatible — they are treated as 00:00
This allows time-of-day conditions such as “transactions placed between 18:00 and 23:59” or “early-morning bonus before 09:00”.

Phase 6 — Submit transactions

With members enrolled and rules active, submit transactions to trigger rule evaluation.

TXN file (batch)

Upload via SFTP to upload/TXN. Required columns:
Every custom transaction attribute column must appear in every row (use empty string if not applicable for that row). A missing column causes a column count mismatch and rejects the entire file.

API (real-time)

Call the Insert Transaction endpoint. The payload must include all 7 global attributes plus any custom transaction attributes defined in your program.

What happens at evaluation time

For each accepted transaction row, Loyalife:
  1. Resolves the member from the Relation Reference
  2. Identifies all active rule groups
  3. For groups with a linked segment — checks whether the member is in that segment
  4. Evaluates every rule’s IF conditions against the transaction’s attributes (both transaction-level and member-level)
  5. Awards points from all matching rules across all qualifying groups simultaneously
  6. Updates aggregate attributes (Monthly Spend Sum, Transaction Count, etc.) for the member
  7. Re-evaluates tier qualification

Phase 7 — Verify

After submitting a test transaction, confirm the correct rules fired:
  1. Go to Members → [search by Relation Reference] → Accrual Info
  2. Find the transaction by Transaction Id or date
  3. The Accrual Info tab shows each rule that evaluated, whether it matched, and how many points it awarded
  4. Cross-check against the rule conditions to confirm the evaluation logic is correct
Checklist before going live:
  • All custom member attributes have the correct data type
  • All custom transaction attributes have the correct API / file key
  • At least one test member is enrolled via CPD or API
  • All rule groups are set to Active
  • Rules within each group are set to Active
  • A test TXN row submitted via API matched the expected rules
  • Accrual Info confirms correct points were awarded
  • Group-level caps are set to sensible values for your program volume

Quick reference — where each piece is configured

Every time an earning rule fires on a submitted transaction, one Credit By Accrual entry is written to the points ledger. These entries are visible in the member’s transaction history and can be filtered in Transactional reports under Reports & Analytics → Transaction Category → Credit By Accrual.