Skip to main content
Experimental. The current earning and redemption paths are not production-ready rewards accounting. Use test data only. See maturity levels.
The Loyalty Module gives each Customer a points account with four built-in tiers (bronze, silver, gold, platinum), earning rules, and redemption endpoints. It creates the account on the Customer’s first interaction and accrues points from the current order.placed event flow.

Planned product contract

The planned Stable behavior uses one Loyalty domain as the points authority. Earning and redemption start disabled. You can configure:
  • points earned per dollar
  • points required for one dollar of redemption
  • activation delay and expiration
  • minimum redemption and maximum redemption percentage
  • eligible products and channels
Store Admin will show the effective reward value, and Shoppers will see the actual redemption value. Physical-product points will activate only after the required Fulfillment is satisfied. The endpoints and options below describe the current Experimental implementation while that migration is in progress. Source: modules/loyalty · npm: @86d-store/loyalty

Installation

The Loyalty Module requires the Customers Module to be enabled.

Configuration

The exported LoyaltyOptions fields do not currently configure the controller. Use active rule records created through Store Admin or the administrative rule endpoints.
Do not connect current earning or redemption to live Orders. The current money-unit and Checkout integration contracts are incomplete.

Store endpoints

Redeem points (POST /loyalty/redeem)

The request requires an authenticated Customer and a description. It returns the resulting LoyaltyTransaction when the controller accepts the deduction. There is no working minRedemption option or monetary redemption conversion in the current implementation.

Calculate points (GET /loyalty/calculate)

Pass amount as a numeric query parameter:
The endpoint returns a point count based on active earning rules. Use it only for isolated evaluation until the money-unit mismatch above is fixed.

Admin endpoints

Store components

Use these components in your MDX Template files.

PointsBalance

Displays the Customer’s current point balance with a tier badge and lifetime earn/redeem stats.
string
The Customer’s ID. If omitted, the component shows a sign-in prompt.
States: signed out (sign-in prompt) → loading (skeleton) → loaded (balance, tier badge, lifetime stats).

TierProgress

Shows the Customer’s current tier and a visual progress bar toward the next tier. Displays a multiplier badge when the current tier has a points multiplier greater than 1×.
string
The Customer’s ID. If omitted, the component shows a sign-in prompt.
States: signed out → loading (skeleton) → loaded (progress bar, percentage to next tier, tier step indicators with checkmarks).

PointsHistory

A filterable table of the Customer’s point transactions (earn, redeem, adjust, expire).
string
The Customer’s ID. If omitted, the component shows a sign-in prompt.
number
default:"10"
Maximum number of transactions to display.
States: signed out → loading (skeleton rows) → loaded (filter bar + transaction table) → empty (“No transactions found”).

LoyaltyPage

A full-page loyalty view that composes PointsBalance, TierProgress, and PointsHistory in a two-column layout.
string
The Customer’s ID. If omitted, the component shows a sign-in prompt.

Types

Rule types