Lynes Loyalty Cheatsheet
Quick Reference
Function | API Endpoint | Method | Key Parameters |
---|---|---|---|
Track Event | /v1/event | POST | eventId , customerId , amount |
Get User Points | /v1/customer/{id}/points | GET | id (path parameter) |
Check Challenge Progress | /v1/customer/{id}/challenges | GET | id (path parameter) |
View User Streaks | /v1/customer/{id}/streaks | GET | id (path parameter) |
System Overview
Lynes Loyalty is an event-driven gamification platform that converts user actions into rewards and engagement features:
System Flow:
User Actions → Events → Lynes API → Multiple Outputs:
- Points/Rewards
- Challenges
- Streaks
- Leaderboards
- Analytics
Events Reference
Key Event Settings
- Maximum Completions: How many times a user can earn rewards (daily/weekly/unlimited)
- Reward: Points to award (fixed or per unit)
- Condition: For conditional events, the threshold that triggers the reward
- User Group Specific: Different rewards for different user segments
API Endpoint
POST https://api.lynesapp.de/v1/event
Basic Event Structure
{
"eventId": "string", // ID from dashboard
"customerId": "string", // User identifier
"amount": number, // Optional for fixed, required for others
"metadata": { // Optional additional data
"key": "value"
},
"timestamp": "2023-05-01T14:30:00Z" // Optional, ISO 8601 format
}
Challenge Reference
Challenge Types
Type | Description | Example |
---|---|---|
Series | Progressive challenges in sequence | Complete 5, 10, then 25 trips |
Single | Standalone objectives | Complete your profile |
Time-Limited | Limited-duration challenges | Order 3× during holiday season |
Challenge Configuration
- Based on events already in your system
- Require specific actions a certain number of times
- Can be automatically sequenced (Series)
- Can have start/end dates (Time-Limited)
Retrieving Challenge Progress
GET https://api.lynesapp.de/v1/customer/{id}/challenges
Streak Reference
Streak Types
Period | Description | Use Case |
---|---|---|
Daily | Action performed each day | App opens, daily check-ins |
Weekly | Action at least once per week | Weekly purchases |
Monthly | Action at least once per month | Monthly subscription renewal |
Streak Features
- Event-Based: Uses existing events
- Zero-Code: Configured in dashboard
- Automatic Tracking: System maintains streak counts
Checking User Streaks
GET https://api.lynesapp.de/v1/customer/{id}/streaks
Implementation Checklist
-
Identify Key Events
- User registration/login
- Content consumption
- Purchases/transactions
- Social interactions
- Feature usage
-
Set Up Events in Dashboard
- Create event with appropriate type
- Configure reward settings
- Set completion limits
- Add user group specifics (if needed)
-
Implement in Your Application
// Example API call fetch("https://api.lynesapp.de/v1/event", { method: "POST", headers: { "Content-Type": "application/json", Authorization: "Bearer YOUR_JWT", }, body: JSON.stringify({ eventId: "purchase", customerId: "user123", amount: 49.99, }), });
-
Configure Gamification Features
- Create challenges based on events
- Set up streaks for consistency
- Design leaderboards for competition
Error Handling
HTTP Status | Common Cause | Recommended Action |
---|---|---|
400 | Invalid event structure | Check required parameters and format |
401 | Authentication failure | Verify your API key or token |
404 | Event or customer not found | Confirm IDs are correct |
429 | Rate limit exceeded | Implement exponential backoff |
500 | Server error | Retry with backoff, then contact support |
Best Practices
-
Event Design
- Start with core actions users already perform
- Use meaningful, consistent naming
- Consider both reward-based and tracking-only events
-
API Usage
- Handle errors gracefully
- Batch events when possible
- Include detailed metadata
- Use unique user identifiers consistently
- Set correct timestamps for offline events
-
Reward Economy
- Balance point values across actions
- Control point inflation with max completions
- Use non-rewarding events for analytics
- Consider user groups for segment-specific rewards
Common Event-Tracking Examples
User Action | Event Type | Configuration |
---|---|---|
Login | Fix | 5-10 points, once daily |
Purchase | Transactional | 1-2 points per $1 spent |
Watch Video | Conditional | 20 points when 5+ minutes watched |
Complete Profile | Fix | 50 points, once ever |
Referral | Fix | 100 points per referral |
System Automation Flow
- User performs action in your application
- Your app sends event to Lynes API
- System validates the event
- Points are awarded (if applicable)
- Challenges progress is updated
- Streaks are calculated/maintained
- Leaderboards are refreshed
- Analytics data is recorded
SDK Integration
// Initialize the SDK
import { LynesLoyalty } from "lynes-loyalty-sdk";
const loyalty = new LynesLoyalty({
apiKey: "YOUR_API_KEY",
environment: "production", // or 'development'
});
// Track an event
loyalty.trackEvent({
eventId: "article_read",
customerId: "user123",
amount: 1,
});
// Get user points
const points = await loyalty.getPoints("user123");
Glossary
Term | Definition |
---|---|
Event | A tracked user action that can trigger rewards |
Challenge | A goal for users to achieve by completing specific events |
Streak | Consistent performance of actions over time |
User Group | Segment of users with specific reward rules |
Leaderboard | Competitive ranking of users based on points or actions |