The model
A shop has one loyalty program. The program is organized as a hierarchy:How players earn and claim
Two reward mechanics run in parallel, and the distinction drives the whole integration:- Accrual is automatic. At checkout, Stash updates the player’s Loyalty XP and reports the per-USD Core Currency reward on the purchase webhook for your backend to grant. No player action or extra client integration is involved.
- Milestone claims are player-initiated. When XP crosses a milestone threshold the reward becomes claimable in the loyalty hub. The player clicks Claim, and Stash delivers the reward to your backend to grant.
Loyalty state on webhooks
Every webhook that can change or reflect a player’s XP carries a sharedloyalty sub-payload (the loyalty snapshot, type PlayerLoyaltyState): the current XP balance, the signed XP delta, the current and previous tier IDs, the current tier’s pointsMultiplierPermille (its XP earn rate relative to the base tier, in permille: 2000 = 2x), progress to the next tier and milestone, and the campaignId. It rides on four events:
PURCHASE_SUCCEEDEDPURCHASE_REFUNDEDLOYALTY_MILESTONE_CLAIMEDFREE_ITEM_REDEEMED
RegisterPayment and ConfirmPayment purchase requests Stash sends to a real-time-catalog backend, so your backend has the player’s tier and XP context in-band at purchase time. See Loyalty snapshot on purchase requests.
The loyalty hub
Players view their tier status, XP progress, and claimable milestones through the Stash loyalty hub, a hosted UI embedded in your webshop. No additional integration is required for the hub itself. To deep-link a player directly into the hub, call Generate authenticated URL from your backend with the target set toLOYALTY. The endpoint returns an authenticated URL that opens the player straight to the loyalty hub.
Next steps
Reward types
Define Loyalty XP, in-game currency, and catalog rewards your program grants.
Tiers
XP thresholds, string tier IDs, and per-tier earn rates.
Milestones & rewards
One-time XP checkpoints, the claim flow, and reward delivery.
Configure in Stash Studio
The end-to-end setup walkthrough, validation, and publishing.
Analytics & app integration
Consume loyalty via webhooks for analytics, and the read-only API for in-app integration.
Refunds & XP adjustments
Proportional refund reversal, tier downgrades, and free-gift XP.