Loyalty & Referrals
The SDK provides access to the Stackfront loyalty and referral program via the REST API. Points, tiers, transactions, referrals, and redemptions are all managed server-side.Quick Reference
| Hook | Purpose |
|---|---|
useLoyalty(customerId) | Points balance, tiers, transactions, redemption |
Service Methods
TheLoyaltyService exposes:
getAccount(customerId, customerEmail?)— points, tier, progressgetTransactions(customerId, page, pageSize)— point historyredeem({ customerId, pointsToRedeem, orderTotal })— spend pointsgetReferral(customerId)— referral code and statstrackReferral({ referralCode, referredCustomerId, orderId })— log a referral