onLoyaltyPointsEarned
Purpose
Triggered when a customer earns loyalty points from a purchase. Use this hook to track customer engagement and loyalty program usage.
When It Triggers
Customer completes a purchase at a shop with loyalty enabled
Points are calculated and added to customer's balance
Parameters
data.source
number
Server ID of customer
data.shopId
string
Unique shop identifier
data.shopName
string
Display name of the shop
data.shopType
string
Shop type (for unowned shops only)
data.customerIdentifier
string
Customer's identifier
data.customerName
string
Customer's name
data.pointsEarned
number
Points earned from this purchase
data.previousPoints
number
Points before this purchase
data.newPoints
number
Points after this purchase
data.lifetimePoints
number
Total lifetime points earned
data.purchaseAmount
number
Purchase amount that earned points
data.timestamp
number
Server timestamp
Example
Last updated