Customers
Your loyalty program members. Understanding how to model, segment, and engage customers is the foundation of a successful program.
The Customer Identity Model
Every customer in Loyali has a unified identity that connects their activity across all your touchpoints:
Core Identity
- Email — Primary identifier, unique per organization
- External Reference — Your user ID from your system (crucial for integration)
- Profile Data — Name, phone, and other contact info
Loyalty Profile
- Points Balance — Current redeemable points
- Lifetime Points — Total ever earned (determines tier status)
- Current Tier — Their status level and benefits
- Activity History — Full audit trail of all interactions
Custom Data
- Metadata — Any JSON data you want to store (preferences, segments, flags)
The External Reference: Your Integration Key
The external_reference field is the most important field for integration. This is where you store YOUR user ID.
Why It Matters
When a user logs into your app, you have their user ID but not their Loyali customer ID. The external reference lets you instantly look up their loyalty profile.
Without external reference:
- User logs in → You have
user_123 - Search Loyali by email
- Hope the email matches
- Multiple API calls, potential mismatches
With external reference:
- User logs in → You have
user_123 - One API call:
GET /customers/external/user_123 - Instant access to their loyalty profile
Best Practice
Always set external_reference when creating customers:
// When user signs up
createLoyaliCustomer({
email: user.email,
first_name: user.firstName,
external_reference: user.id.toString() // Your user ID
});
Customer Segmentation Strategy
Use the metadata field to power segmentation without building custom infrastructure.
Behavioral Segments
Track customer behavior for targeted campaigns:
| Metadata Key | Purpose | Example Values |
|---|---|---|
signup_source | Attribution | "website", "mobile_app", "referral" |
last_purchase_date | Recency | ISO date string |
purchase_count | Frequency | Number |
lifetime_value | Monetary | Dollar amount |
preferred_category | Preference | "electronics", "fashion" |
RFM Segmentation
Build Recency-Frequency-Monetary segments:
- Champions — High recency, high frequency, high value
- Loyal Customers — High frequency, respond to promotions
- At Risk — Were good customers, haven't purchased recently
- Hibernating — Low on all metrics, need reactivation
Lifecycle Stages
Track where customers are in their journey:
| Stage | Trigger | Action |
|---|---|---|
| New | Just signed up | Welcome bonus, onboarding emails |
| Active | Regular activity | Engagement campaigns |
| At Risk | 30+ days inactive | Win-back offers |
| Churned | 90+ days inactive | Reactivation campaigns |
Customer Lifecycle Management
Onboarding New Members
The first 7 days determine long-term engagement:
- Welcome Bonus — Immediate gratification (50-100 points)
- First Action Reward — Bonus for completing profile, first purchase
- Education — Show them how to earn and what they can redeem
- Goal Setting — Show progress toward first tier/reward
Engagement Loop
Keep customers active with:
- Milestone Celebrations — "You've earned 1,000 points!"
- Progress Updates — "You're 200 points from Silver!"
- Personalized Offers — Based on their preferences
- Surprise & Delight — Unexpected bonus points
Win-Back Campaigns
For inactive customers:
- Reminder — "Your 500 points are waiting"
- Incentive — "Earn 2x points this week only"
- Urgency — "Your points expire in 30 days"
- Final Offer — "We miss you - here's 100 bonus points"
Data Privacy & Compliance
GDPR Considerations
- Customers can request data export
- Customers can request deletion (right to be forgotten)
- Store only necessary data
- Get consent before marketing communications
What NOT to Store
Never put these in customer records or metadata:
- Passwords or authentication tokens
- Full payment card numbers
- Social security numbers
- Sensitive health information
Data Retention
Consider policies for:
- Inactive account cleanup
- Points expiration notices
- Transaction history retention
Common Integration Patterns
Pattern 1: Signup Sync
Create loyalty profile when user signs up:
User signs up in your app
↓
Create customer in Loyali (with external_reference)
↓
Award welcome bonus
↓
Show loyalty status in your app
Pattern 2: Find or Create
Handle existing users who may or may not have loyalty profiles:
User logs in
↓
Try to find by external_reference
↓
Found? → Load their profile
Not found? → Create new profile
↓
Continue with loyalty features
Pattern 3: Profile Sync
Keep customer data in sync between systems:
User updates profile in your app
↓
Update Loyali customer with new data
↓
Both systems stay consistent
Dashboard vs API
| Task | Dashboard | API |
|---|---|---|
| View customer details | ✅ Click to explore | ✅ GET endpoints |
| Add individual customer | ✅ Form-based | ✅ POST request |
| Bulk import | ❌ Use API | ✅ Batch requests |
| Real-time sync | ❌ Manual | ✅ Automated |
| Customer lookup | ✅ Search bar | ✅ Multiple lookup methods |
Next Steps
- API Reference → — Full technical documentation for all customer endpoints
- Points Guide — Learn how customers earn and spend points
- Quick Start — Get integrated in 15 minutes