Skip to main content

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

HookPurpose
useLoyalty(customerId)Points balance, tiers, transactions, redemption

Service Methods

The LoyaltyService exposes:
  • getAccount(customerId, customerEmail?) — points, tier, progress
  • getTransactions(customerId, page, pageSize) — point history
  • redeem({ customerId, pointsToRedeem, orderTotal }) — spend points
  • getReferral(customerId) — referral code and stats
  • trackReferral({ referralCode, referredCustomerId, orderId }) — log a referral