Setting Up a Loyalty Program
This guide walks you through setting up a complete points-based loyalty program.
-
Create your project
Start by creating a project in the Storelayer dashboard. This gives you an isolated environment for your loyalty program.
-
Configure point earning rules
Set up how customers earn points. Common rules include:
- Purchase rewards — 1 point per $1 spent
- Sign-up bonus — 100 points for new customers
- Review bonus — 50 points for product reviews
These are configured as workflows that trigger on loyalty events.
-
Create promotions
Add promotions for special earning opportunities:
Terminal window curl -X POST https://api.storelayer.io/v1/promotions \-H "Authorization: Bearer YOUR_API_KEY" \-d '{"name": "Double Points Weekend","type": "points_multiplier","multiplier": 2,"conditions": {"dayOfWeek": ["saturday", "sunday"]}}' -
Set up redemption options
Create catalog items that customers can redeem with points:
Terminal window curl -X POST https://api.storelayer.io/v1/catalog/products \-H "Authorization: Bearer YOUR_API_KEY" \-d '{"name": "$10 Gift Card","pointsPrice": 1000,"category": "rewards"}' -
Integrate event tracking
Send events from your application to track customer actions:
// After a purchaseawait fetch('https://api.storelayer.io/ingest/events', {method: 'POST',headers: {'X-API-Key': 'YOUR_API_KEY','Content-Type': 'application/json',},body: JSON.stringify({event: 'purchase',customerId: customer.id,amount: orderTotal,metadata: { orderId: order.id },}),}) -
Monitor and iterate
Use the dashboard to track program performance:
- Points earned vs. redeemed
- Active customer count
- Promotion redemption rates