The loyalty module gives your customers a points-based rewards program with four built-in tiers (bronze, silver, gold, platinum), configurable earning rules, and automatic point accrual whenever an order is placed. Accounts are provisioned automatically on a customer’s first interaction; no manual setup is required. Source:Documentation Index
Fetch the complete documentation index at: https://86d.app/docs/llms.txt
Use this file to discover all available pages before exploring further.
modules/loyalty · npm: @86d-app/loyalty
Installation
The loyalty module requires the
customers module to be enabled.Configuration
Number of points a customer earns per dollar spent. Applied to the order amount at the time the
order.placed event fires.Minimum point balance required before a customer can redeem. Customers with fewer points than this threshold cannot use the
/loyalty/redeem endpoint.Points-to-currency conversion rate. A value of
"100" means 100 points = $1.All configuration values are strings for module config system compatibility, even though they represent numbers.
Store endpoints
| Method | Path | Description |
|---|---|---|
GET | /loyalty/balance | Get the authenticated customer’s current point balance |
GET | /loyalty/transactions | List the customer’s point transaction history |
GET | /loyalty/tiers | List all loyalty tiers |
GET | /loyalty/calculate | Calculate how many points an order amount would earn |
POST | /loyalty/redeem | Redeem points against an order |
GET | /loyalty/store-search | Search loyalty data (store search integration) |
Redeem points (POST /loyalty/redeem)
LoyaltyTransaction on success, or 400 if the customer has insufficient points or the amount is below minRedemption.
Calculate points (GET /loyalty/calculate)
Pass amount as a query parameter (in dollars):
{ "points": 49 } based on active earning rules.
Admin endpoints
| Method | Path | Description |
|---|---|---|
GET | /admin/loyalty/accounts | List loyalty accounts (filter by tier, status) |
GET | /admin/loyalty/accounts/:customerId | Get a single customer’s loyalty account |
POST | /admin/loyalty/accounts/:customerId/adjust | Manually add or deduct points |
POST | /admin/loyalty/accounts/:customerId/suspend | Suspend a loyalty account |
POST | /admin/loyalty/accounts/:customerId/reactivate | Reactivate a suspended account |
GET | /admin/loyalty/summary | Get program-wide statistics |
GET | /admin/loyalty/rules | List earning rules |
POST | /admin/loyalty/rules/create | Create an earning rule |
PUT | /admin/loyalty/rules/:id/update | Update an earning rule |
DELETE | /admin/loyalty/rules/:id/delete | Delete an earning rule |
GET | /admin/loyalty/tiers | List tiers |
POST | /admin/loyalty/tiers/create | Create a tier |
PUT | /admin/loyalty/tiers/:id/update | Update a tier |
DELETE | /admin/loyalty/tiers/:id/delete | Delete a tier |
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.
The customer’s ID. If omitted, the component shows a sign-in prompt.
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×.
The customer’s ID. If omitted, the component shows a sign-in prompt.
PointsHistory
A filterable table of the customer’s point transactions (earn, redeem, adjust, expire).
The customer’s ID. If omitted, the component shows a sign-in prompt.
Maximum number of transactions to display.
LoyaltyPage
A full-page loyalty dashboard that composes PointsBalance, TierProgress, and PointsHistory into a single view with a two-column layout.
The customer’s ID. If omitted, the component shows a sign-in prompt.
Types
Rule types
| Type | Description |
|---|---|
per_dollar | Award a fixed number of points per dollar spent |
fixed_bonus | Award a flat point bonus when the order meets a minimum amount |
multiplier | Multiply the base points earned by a factor |
signup | One-time bonus awarded on a customer’s first interaction |

