A loyalty program
in Medusa
Points for every order, right where the store is run: one point per unit of the order total, a reward ladder the customer redeems from, the redemption history and manual adjustments in the admin, and the customer's own points in the storefront. A wholesaler keeps its customers close: every order earns, every reward brings them back.
What exactly
this integration does
-
Points per order
A placed order awards the total times pointsPerPln, scaled by the customer's tier multiplier. Idempotent per order; marketplace imports are skipped.
-
A reward ladder
The rewards from the options, from the cheapest. The admin and the storefront show which reward the customer can redeem next, so the goal is visible.
-
Redemption
The customer redeems points for a reward or a discount at redeemRate; the redemption is recorded in the ledger and the account's history, once.
-
Manual adjustments
Bonuses and corrections from the admin, always with a reason and a customer search. The ledger stays complete even when points arrive by hand.
-
The customer's points in the store
The balance, the totals, the saved amount, the redeemed rewards and the latest transactions through the store API – the customer sees their account without logging into the admin.
-
The original tables untouched
loyalty_account and loyalty_transaction keep their names and shapes, so stores that ran the original module carry their rows over; the migration only adds the demo flag.
How it guards
your data
-
Points exactly once
Awarding is idempotent per order: a repeated event never adds points a second time.
-
A closed ledger
Every transaction has a reason: an order, a redemption or an adjustment with a note. The balance can always be rebuilt from the ledger.
-
Demo kept apart
Sample accounts and transactions are flagged demo, so showcase data never mixes with real customer points.
Setup
in three steps
The full list of options, events and API routes is in the package README on GitHub.
Paste it into Claude Code, Cursor or another AI assistant in your Medusa project: it installs and configures the integration, with writes off.
- 1 Install the package from npm.
npm install @koda-plus/medusa-plugin-loyalty - 2 Add the plugin to medusa-config.ts.
plugins: [ { resolve: "@koda-plus/medusa-plugin-loyalty", options: { // Everything is optional. pointsPerPln: 1, redeemRate: 0.05, rewards: [ { at: 1500, name: { en: "50 off", pl: "Rabat 50 zł" } }, { at: 3000, name: { en: "Free 18V drill", pl: "Wkrętarka 18V gratis" } }, ], // demo: process.env.LOYALTY_DEMO === "true", }, }, ] - 3 Run the migrations and open the integration in the Medusa admin.
npx medusa db:migrate
Running for our clients
See our portfolio Other
integrations
- Allegro Offers, orders, stock and parcels
- BaseLinker Cards, stock, prices and orders both ways
- Subiekt nexo Orders as ZK, WZ and invoices with KSeF
- Fakturownia Invoices, corrections and KSeF exactly once
- InPost Parcel lockers, courier and COD on ShipX
- OLX Adverts that match the store's stock
- Stripe Volume, fees, disputes and account health
- Negotiations Target price, counter offer, acceptance
- Trade credit Limits, terms and customer balances
- Packaging Piece, box, pallet, minimum and step
- EU compliance GPSR, RODO and Omnibus in one panel
- VAT whitelist NIP, VIES and REGON in one panel
- E-mails Ready templates in Polish and English
- Tasks Tasks on orders, products and customers
Tell us about your project,
we'll tailor the rest to you
A 15-minute call is enough for us to know whether we are a fit for your project.
We start from what you need, not from an off-the-shelf solution.
