Referrals
The referral system lets you create growth loops by rewarding customers who bring in new users.
How It Works
Section titled “How It Works”- A customer generates a referral code or referral link
- A new user signs up using that code
- Both the referrer and referee receive rewards
Creating a Referral Program
Section titled “Creating a Referral Program”curl -X POST https://api.storelayer.io/v1/referral-programs \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Friend Referral", "referrerReward": { "type": "points", "amount": 500 }, "refereeReward": { "type": "points", "amount": 250 }, "maxReferrals": 10 }'Referral Codes
Section titled “Referral Codes”Each customer gets a unique referral code:
curl -X GET https://api.storelayer.io/v1/referrals/{customerId}/code \ -H "Authorization: Bearer YOUR_API_KEY"Response:
{ "success": true, "data": { "code": "JANE-X7K2", "url": "https://your-app.com/ref/JANE-X7K2", "referralsCount": 3, "maxReferrals": 10 }}Tracking Referrals
Section titled “Tracking Referrals”View a customer’s referral activity:
curl -X GET https://api.storelayer.io/v1/referrals/{customerId}/history \ -H "Authorization: Bearer YOUR_API_KEY"