Referral Programs
Referral programs reward customers for bringing in new users, creating organic growth loops.
-
Create a referral program
Terminal window curl -X POST https://api.storelayer.io/v1/referral-programs \-H "Authorization: Bearer YOUR_API_KEY" \-d '{"name": "Invite a Friend","referrerReward": {"type": "points", "amount": 500},"refereeReward": {"type": "points", "amount": 250},"maxReferrals": 20}' -
Generate referral links
Each customer gets a unique code:
Terminal window curl -X GET https://api.storelayer.io/v1/referrals/{customerId}/code \-H "Authorization: Bearer YOUR_API_KEY" -
Apply referral on signup
When a new user signs up with a referral code:
Terminal window curl -X POST https://api.storelayer.io/v1/referrals/apply \-H "Authorization: Bearer YOUR_API_KEY" \-d '{"code": "JANE-X7K2","refereeId": "cust_new456"}' -
Track performance
Terminal window curl -X GET https://api.storelayer.io/v1/referrals/{customerId}/history \-H "Authorization: Bearer YOUR_API_KEY"
Reward Types
Section titled “Reward Types”| Type | Description |
|---|---|
points | Award points to the wallet |
discount | Give a discount code |
free_item | Award a catalog item |