Loyalty and coupons
Loyalty points earned and redeemed on Sales Invoices, and Coupon Codes that unlock a Pricing Rule.
A Loyalty Program gives customers points on what they spend and lets them pay part of a later invoice with those points. A Coupon Code unlocks a discount from a Pricing Rule.
Loyalty Program
Turn on Accounts Settings' Enable Loyalty Point Program to show the redemption section on the Sales Invoice.
| Field | Meaning |
|---|---|
| Loyalty Program Type | Single Tier Program or Multiple Tier Program |
| From Date, To Date | Invoices outside these dates earn nothing |
| Customer Group, Customer Territory | Limit who Auto Opt In enrols |
| Auto Opt In (For all customers) | A customer without a program joins this one when saved |
| Collection Rules | The tiers: Tier Name, Minimum Total Spent, Collection Factor (=1 LP) |
| Conversion Factor | What one point is worth in the company currency |
| Expiry Duration (in days) | How long earned points last |
| Expense Account, Cost Center | Where redeemed points are booked |
A customer joins an Auto Opt In program only when exactly one such program is running and its group and territory, if set, contain the customer's. Otherwise set Loyalty Program on the Customer by hand. The Customer's Loyalty Program Tier follows each earn, redeem and cancel.
The tier with the lowest Minimum Total Spent must start at 0, so an enrolled customer is always in a tier.
Earning and redeeming
Sales Invoice submitted -> Loyalty Point Entry (+points) -> later Sales Invoice redeems -> Loyalty Point Entry (-points)A submitted Sales Invoice for an enrolled customer earns one point per Collection Factor of its grand total less any Loyalty Amount, rounded down, in the tier the customer's total spend reaches. ERP writes a Loyalty Point Entry with Expiry Date set Expiry Duration days after the posting date. Check Don't Create Loyalty Points to skip it.
On a later invoice, check Redeem Loyalty Points and enter Loyalty Points. ERP sets Loyalty Amount to points times Conversion Factor and fills Redemption Account and Redemption Cost Center from the program.
On submit, ERP writes a negative Loyalty Point Entry against the earned entries that expire first. The Loyalty Amount counts as paid, so Outstanding Amount drops by it.
Acme Rewards has one tier with Collection Factor 100, Conversion Factor 0.5 and Expiry Duration 365. A customer's 12,500 invoice earns 125 points. A month later they redeem 200 points, worth 100, on a new invoice. The redemption posts:
| Account | Party | Debit | Credit |
|---|---|---|---|
| Loyalty Expense - AT | 100 | ||
| Debtors - AT | the customer | 100 |
Loyalty Point Entry records are written and deleted by the invoice. Nobody creates one by hand. Points redeemed show as negative entries; the Loyalty Point Entry Redemption table is kept for parity with ERPNext and stays empty.
Rules ERP enforces on redemption:
- The program's Company must match the invoice's.
- The customer must have enough unexpired points.
- The Loyalty Amount may not exceed the invoice's rounded total.
- Cancelling an invoice deletes its entries, and is refused while another invoice redeems its points.
- A return remakes the original invoice's points from what is left of it.
A POS Invoice has the same redemption fields, and its paid amount counts the Loyalty Amount, but ERP does not yet earn or redeem points on a POS Invoice. See POS.
Coupon Code
A Coupon Code names a Pricing Rule that has Coupon Code Based checked. That rule applies only on a Sales Order or Sales Invoice whose Coupon Code field names the coupon. See Taxes and pricing for Pricing Rules.
| Field | Meaning |
|---|---|
| Coupon Name | The record's name |
| Coupon Type | Promotional or Gift Card |
| Customer | Required for a Gift Card |
| Coupon Code | What the customer types. Left blank, ERP makes one |
| Pricing Rule | The rule it unlocks. Required unless From External Ecomm Platform is checked |
| Valid From, Valid Up To | The dates it works |
| Maximum Use, Used | The cap and the count so far. 0 means no cap |
A blank Coupon Code becomes the Coupon Name without digits, cut to 8 characters and upper-cased: "Summer Sale 2026" gives SUMMER S. A Gift Card gets ten random hex characters and a Maximum Use of 1.
Rules ERP enforces:
- Valid Up To must be after Valid From.
- A newly linked Pricing Rule must not be disabled.
- On a Sales Order or Sales Invoice, the coupon must be within its dates and not used up.
- Submit adds one to Used and cancel takes one off. ERP locks the coupon first, so two submits cannot both take its last use.