Tier Automation
Configure automatic tier calculation and customer upgrades
Tier Automation automatically calculates and assigns customer tiers based on their spending. Set it up once, and RewardsPro handles tier upgrades and downgrades without manual intervention.
How It Works
Scheduled job runs (e.g., daily at 3 AM UTC)
↓
For each customer:
↓
Calculate spending (annual or lifetime)
↓
Find matching tier by threshold
↓
If tier changed: Update assignment
↓
Log change in audit trail
↓
Continue to next customerCalculation Methods
Annual Evaluation
Spending is calculated for the last 12 months:
annualSpent
Sum of order totals in rolling 12 months
netSpent
annualSpent minus refunds
Best for:
Seasonal businesses
Encouraging consistent annual engagement
Preventing one-time big spenders from permanent VIP
Lifetime Evaluation
Spending is calculated all-time:
totalSpent
Sum of all order totals ever
netSpent
totalSpent minus all refunds
Best for:
High-ticket item stores
Long customer relationships
Rewarding overall loyalty
Enabling Automation
Step 1: Go to Settings
Open RewardsPro
Navigate to Settings > Tier Automation
Step 2: Enable Recalculation
Enable Automatic Tier Recalculation
Master toggle for automation
Step 3: Set Frequency
Choose how often tiers are recalculated:
Daily
High-volume stores, immediate upgrades
Weekly
Most stores, balanced approach
Monthly
Low-volume, stable customer base
Quarterly
Large stores, seasonal evaluation
Step 4: Save Settings
Click Save to activate automation.
Configuration Options
Shop Settings
tierRecalculationEnabled
Boolean
Enable/disable automation
tierRecalculationFrequency
Enum
DAILY, WEEKLY, MONTHLY, QUARTERLY
tierRecalculationLastRun
DateTime
Timestamp of last execution
Evaluation Period
Set per tier or globally:
ANNUAL
Last 365 days
LIFETIME
All time
How Tiers Are Determined
Tier Matching Logic
Get customer's spending (annual or lifetime)
Sort tiers by
minSpenddescendingFind first tier where spending >= minSpend
If no match, assign lowest tier (minSpend = 0)
Example
Tiers:
Platinum
$5,000
Gold
$1,000
Silver
$250
Bronze
$0
Customer spending: $1,500
Result: Assigned to Gold (spending >= $1,000 but < $5,000)
Trigger Types
Tier changes are logged with a trigger type:
ACCOUNT_CREATED
Initial tier on new customer
PERIODIC_REVIEW
Scheduled recalculation
SPENDING_MILESTONE
Immediate upgrade on threshold hit
MANUAL_ADMIN
Admin manually changed tier
PRODUCT_PURCHASE
Tier purchased via product
SUBSCRIPTION_STARTED
Tier subscription began
SUBSCRIPTION_CANCELLED
Subscription ended
Scheduled Job Details
Cron Endpoint
Authorization
Requires CRON_SECRET in Authorization header:
Execution
Default time: Daily at 3 AM UTC
Max duration: 50 seconds (Vercel limit)
Batch size: Configurable per shop
Job Flow
Verify authorization
Query all shops with automation enabled
For each shop:
Get recalculation frequency
Check if due for recalculation
Process customers in batches
Update tier assignments
Log changes
Return summary
Manual Override Protection
When a tier is manually assigned by an admin:
Protected (default)
Automation skips this customer
Not Protected
Automation can override
How It Works
Admin manually assigns customer to tier
TierChangeLogcreated withMANUAL_ADMINtriggerCustomer marked as manually assigned
Automated recalculation skips this customer
Clearing Override
To allow automation again:
Open Customer Details
Go to Tier tab
Click Reset to Automatic
Customer included in next recalculation
Dry Run Mode
Test recalculation without making changes:
In Settings
Go to Settings > Tier Automation
Click Run Dry Run
Review proposed changes
Decide whether to apply
Dry Run Output
Shows:
Total customers evaluated
Customers who would upgrade
Customers who would downgrade
Customers unchanged
Tier Change Logging
Every tier change creates a log entry:
TierChangeLog Fields
customerId
Affected customer
previousTierId
Old tier (null if first)
newTierId
New tier
changeType
INITIAL_ASSIGNMENT, UPGRADE, DOWNGRADE
triggerType
What caused the change
spendingAtChange
Customer spending at time
metadata
Additional context (JSON)
createdAt
When change occurred
Viewing Logs
Open Customer Details
Go to Tier Changes tab
View chronological history
Or in Analytics:
Go to Analytics > Tier Movement
Filter by date range
Export if needed
Best Practices
Frequency Selection
High volume (100+ orders/day)
Daily
Medium volume (10-100/day)
Weekly
Low volume (<10/day)
Monthly
Seasonal
Quarterly with manual reviews
Threshold Tuning
Review tier thresholds periodically:
Check tier distribution in Analytics
Aim for pyramid shape:
Base tier: 40-50% of customers
Mid tiers: 30-40%
Top tier: 5-15%
Adjust thresholds if distribution is off
Communication
When customers upgrade or downgrade:
Upgrades: Celebrate! Send email about new benefits
Downgrades: Handle sensitively, explain how to regain tier
Troubleshooting
Customers Not Upgrading
Check:
Automation is enabled
Frequency allows recalculation
Customer spending meets threshold
Customer not manually assigned
Solution: Run manual recalculation or check individual customer.
Wrong Tier Assigned
Check:
Tier thresholds are correct
Evaluation period matches expectation
Order spending is synced
Refunds properly deducted
Solution: Verify customer spending in Customer Details.
Automation Not Running
Check:
Cron job is configured
CRON_SECRET is set
No errors in logs
Last run date
Solution: Check Vercel cron logs or manually trigger job.
Mass Unexpected Changes
Check:
Threshold wasn't accidentally changed
Evaluation period wasn't switched
Large data sync didn't occur
Solution: Review recent settings changes, consider restoring.
Advanced: Real-Time Upgrades
For immediate tier upgrades on order completion:
How It Works
Customer places order
Order webhook fires
Check if spending crosses threshold
If yes: Upgrade immediately
Don't wait for scheduled job
Configuration
Enable Real-Time
Upgrade on order completion
Upgrade Only
Only upgrade, never downgrade in real-time
Related Guides
Creating Tiers - Set up tier thresholds
Customer Details - View tier history
Analytics - Tier distribution metrics
Last updated