List all active, storefront-visible earning rules for the shop.
Retrieve the active earning rules a customer can see, with points already boosted for the logged-in customer’s VIP tier and any active bonus campaign. Use this to display how customers earn points. Pass the logged-in customer through the app proxy and the response reflects their personalized earning rates; for guests it returns base rates.
Usage
MageSDK.getEarningRules().then(function(resp) { if (resp.success) { resp.data.earningRules.forEach(function(rule) { // `points` is the final award after tier and campaign boosts console.log(rule.name, rule.points); }); }});
Response
boolean
Whether the request was successful.
array
List of active earning rules.
Show Earning rule properties
string
The earning rule ID.
string
Internal name of the rule.
string
Description of how points are earned, reflecting the boosted value.
string
The trigger action (e.g. "purchase", "birthday", "follow_on_instagram").