Skip to main content
RapidDev - Software Development Agency
AI ImplementationsE-commerce & Retail31 min read

White-Label AI Customer Loyalty Program Manager for Retail & DTC Agencies

Three paths: subscribe to Smile.io or Yotpo Loyalty at $49–$799+/mo per merchant (agency co-branding only, not full white-label), hire RapidDev at $13K–$25K for a custom platform, or build yourself with Lovable + Stripe webhooks for ~$40 in a weekend. Research recommends build-yourself: Claude Haiku 4.5 at $0.002 per personalized redemption email and embedding-based affinity scoring at $0.00002 per member makes a 100-merchant white-label run under $20/mo total in AI costs — resellable at $79/mo with 90%+ gross margin.

4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members

Decision matrix

Should you buy, hire, or build it yourself?

Three paths to launch a Customer Loyalty Program Manager, side-by-side. Pick the one that matches your budget, timeline, and how much control you actually need.

Subscribe to Smile.io, Yotpo, or LoyaltyLion

Buy SaaS
Time to launch
1–2 days per merchant setup
Upfront cost
$0
Monthly cost
$49–$799+/mo per merchant
Ownership
Locked into vendor; agency co-branding only (not full white-label)
Customization
Points rules, reward catalog, widget color — within vendor's schema

Best for

A single DTC brand that wants a proven loyalty program launched in a day without any engineering

Risks

  • Smile.io's agency program offers co-branding (your logo + Smile's logo) — not full white-label. The client's loyalty portal still references Smile.io in the admin URL and email footers.
  • AI personalization is absent across all mainstream loyalty platforms — redemption emails are template-based, not member-specific.
  • Per-merchant pricing means agency economics are inverted: you pay $49–$799/mo per merchant with no margin on the tool cost, then charge a service fee on top.
  • Migrating members and points balances off Smile.io or Yotpo to a custom platform later requires data export (if available) and member re-authentication — high switching cost if you're locked in.

Hire RapidDev

Hire agency
Time to launch
5–8 weeks
Upfront cost
$13,000–$25,000
Monthly cost
$150–$350 infra (Supabase Pro + Vercel + Resend)
Ownership
You own the code
Customization
Unlimited — your roadmap

Best for

Retention agencies with 8+ committed merchant clients paying $99+/mo each for a branded loyalty dashboard

Risks

  • Shopify Customer Tags and Order webhooks are the data sources — merchant client needs to grant Admin API access, which some clients resist without SOC 2 documentation.
  • Points ledger data is the most sensitive data in the system — every points transaction must be idempotent with deduplication on the Stripe/Shopify order webhook ID to prevent double-crediting.
  • AI personalization prompt quality needs per-merchant tuning — a beauty brand's Haiku voice differs from a hunting gear brand's; budget 2–4 hours of prompt calibration per merchant.
  • State gift-card and escheatment laws (CA, NY) may apply to unredeemed points balances after a defined inactivity period — consult a compliance attorney before issuing points redeemable for cash-equivalent rewards.
Recommended

Build with Lovable

Build yourself
Time to launch
1 weekend
Upfront cost
$25 Lovable Pro
Monthly cost
$15–$50 (Supabase free/Pro + Vercel) + ~$2 AI for 100 members
Ownership
You own the code
Customization
Full — limited only by your engineering skill for complex tier rules

Best for

Shopify app developers or solo DTC consultants who want to own a loyalty product for their clients without a $13K+ build investment

Risks

  • Points ledger idempotency is critical but easy to miss in a Lovable scaffold — duplicate webhooks from Shopify can double-credit points if the idempotency check isn't explicitly implemented.
  • State escheatment laws on unredeemed points are an obscure compliance area that Lovable won't flag — consult a compliance attorney if the merchant issues high-value reward redemptions.
  • The Klaviyo email send integration for personalized redemption emails requires Klaviyo API key management per merchant — Lovable will scaffold this but the multi-tenant API key isolation needs explicit review.
  • Shopify Customer Tags sync (marking VIP members with a tag) requires the Admin API write scope — stricter than read-only access and some merchant clients push back on granting it.

What a Customer Loyalty Program Manager actually does

Manages a points-based customer loyalty program with AI-personalized reward recommendations, churn-triggered double-points campaigns, and embedding-based next-best-action scoring — all white-labeled under the agency's brand.

The platform combines a standard loyalty mechanics engine (points for purchases, tiers, referrals) with three AI-powered personalization layers. First, reward-redemption personalization: when a member's points balance crosses a redemption threshold, Claude Haiku 4.5 generates a personalized email ('You have 450 points — here's the $20 off bundle that matches your recent purchases: the cold-brew concentrate you bought in August pairs well with our new stainless travel mug, both included in our Fall Bundle at exactly 450 points'). Second, churn-triggered campaigns: an XGBoost classifier scores each member's 30-day churn probability; members above 0.7 trigger a double-points or bonus campaign drafted by Haiku 4.5 in the merchant's brand voice. Third, next-best-action scoring: text-embedding-3-small embeds each member's purchase history and matches it against available rewards, surfacing the single most relevant reward for each member's profile in the portal and email digest.

The white-label opportunity is clear: Smile.io's lowest paid tier is $49/mo per merchant with agency co-branding only (your agency logo alongside Smile's) — not a full white-label. Yotpo Loyalty, Stamped, and LoyaltyLion are identical: per-merchant pricing with no rebrand option. An agency serving 20 DTC retention clients pays $1,000–$16,000/mo in loyalty SaaS subscriptions while delivering a Smile-branded experience to their clients. A white-label Lovable build with genuine AI personalization runs under $5/mo in AI + infra costs per merchant, resellable at $79–$199/mo — and the client sees the agency's brand, not Smile's.

AI capabilities involved

Personalized reward-redemption email generation

Claude Haiku 4.5 ($1/$5 per M)DeepSeek V4 Flash ($0.14/$0.28 per M)GPT-5.4 nano ($0.20/$1.25 per M)

Churn-triggered double-points campaign drafting

Claude Haiku 4.5 ($1/$5 per M)GPT-5.4 nano ($0.20/$1.25 per M)DeepSeek V4 Flash ($0.14/$0.28 per M)

Next-best-action reward scoring via customer-history embeddings

text-embedding-3-small ($0.02/M tokens)Gemini 3.1 Flash-Lite ($0.25/$1.50 per M)Mistral Large 3 (Apache 2.0, self-hosted embeddings)

VIP-tier promotion timing optimization

Claude Haiku 4.5 ($1/$5 per M)GPT-5.4 nano ($0.20/$1.25 per M)DeepSeek V4 Flash ($0.14/$0.28 per M)

Referral message drafting personalized to sender's voice

Claude Sonnet 4.6 ($3/$15 per M)Claude Haiku 4.5 ($1/$5 per M)GPT-5.4 mini ($0.75/$4.50 per M)

Who uses this

  • DTC retention agencies serving 10–50 Shopify merchants who want a white-labeled loyalty program as a recurring retainer product
  • Shopify Plus partners who include loyalty as a built-in service and want to deliver it under their own brand rather than pointing clients to Smile.io
  • Lifecycle-marketing consultants who want to bundle loyalty with email and SMS under a single agency-branded dashboard
  • Multi-brand DTC operators (3–10 portfolio brands) who need a unified loyalty management layer across all brands from one admin
  • Independent Shopify app developers building a loyalty app to list on the Shopify App Store with AI personalization as a competitive differentiator

SaaS alternatives on the market

Real products you can sign up for today — with current 2026 pricing, honest pros and cons.

Smile.io

Individual DTC merchants with under 500 loyalty members who want to launch a points program in a day without any development.

Free (up to 200 members)

$49/mo (Starter, 500 members)

$599+/mo (Growth)

Pros

  • +Largest Shopify loyalty ecosystem — 100,000+ merchants, the most-integrated loyalty tool with Klaviyo, Mailchimp, and Omnisend.
  • +Free tier covers up to 200 members — best choice for very early-stage merchants validating loyalty ROI.
  • +Starter-tier includes referral programs, tiered rewards, and basic customization at $49/mo.
  • +Agency partner program offers co-branded reporting and a dedicated agency dashboard for managing multiple merchants.

Cons

  • Agency partner program offers co-branding (your logo + Smile's) — not full white-label. Smile.io brand stays in the customer-facing portal and admin URLs.
  • AI personalization is completely absent — redemption emails are template-based; no next-best-action scoring.
  • Starter tier ($49/mo) caps at 500 members — merchants with 501+ members must jump to $199/mo Gro tier.
  • Migrating off Smile.io is painful: customer points balances must be exported and manually imported, and some member data is tied to Smile's customer IDs.
Smile.io's agency program explicitly states 'co-branding' not 'white-label' — for an agency selling 'our loyalty platform' to clients, the Smile.io brand appearing in the client's portal is a clear credibility issue.

Yotpo Loyalty

Shopify merchants already using Yotpo Reviews or Yotpo SMS who want unified customer data across reviews, SMS, and loyalty.

No free tier

$199/mo (Starter)

$599+/mo (Pro)

Pros

  • +Deep integration with Yotpo Reviews and SMS — if a merchant already uses Yotpo, the loyalty module integrates data across all three products.
  • +Points for reviews, photo submissions, and social shares in addition to purchases — strong community-building mechanics.
  • +Strong Shopify Plus integration with headless commerce support.
  • +Better segmentation than Smile.io — loyalty tiers can trigger Klaviyo/Yotpo SMS flows automatically.

Cons

  • No white-label tier at any price point.
  • No AI personalization — redemption emails and campaign triggers are template-based.
  • At $199/mo floor, more expensive than Smile.io for small merchants.
  • Must be part of a Yotpo product bundle for best pricing — standalone loyalty is expensive.
No white-label at any tier — even the highest-priced enterprise plan keeps Yotpo branding in the customer portal.

LoyaltyLion

Mid-market DTC brands ($2M–$20M GMV) where loyalty analytics and Klaviyo integration are the primary decision factors.

Free (up to 400 orders/mo)

$199/mo (Small)

$799+/mo (Large)

Pros

  • +Best analytics in the loyalty category — cohort-retention dashboard shows which loyalty tiers drive the highest LTV.
  • +Strong email personalization integration with Klaviyo and Dotdigital.
  • +Flexible points rules covering purchases, activities (account creation, reviews, referrals), and custom events.
  • +Loyalty-data export available — cleaner migration path than Smile.io.

Cons

  • No white-label tier.
  • No AI personalization — analytics are strong but the personalization layer is template-based.
  • $199/mo floor for under 800 monthly orders — expensive for small DTC merchants.
  • UI customization is more complex than Smile.io — steeper learning curve for merchant onboarding.
$799/mo for 'Large' tier at 1,500+ orders/mo — agencies serving 10 merchants at this scale would pay $7,990/mo with no white-label.

Rivo

Early-stage DTC merchants who want a cleaner UI than Smile.io at a similar price point and don't need the Smile.io ecosystem depth.

Free plan (limited)

$49+/mo

Pros

  • +Lowest paid-tier pricing in the segment at $49/mo with no member-count caps on the first paid tier.
  • +Good Shopify integration with Customer Tag sync for tier management.
  • +Cleaner UI than Smile.io for the member-facing portal.
  • +Active development — frequently adds new features including some basic personalization tooling.

Cons

  • No white-label tier — Rivo brand in the customer portal.
  • Smaller ecosystem than Smile.io — fewer integrations with email and SMS platforms.
  • No AI personalization.
  • Less mature than Smile.io or LoyaltyLion — fewer case studies and enterprise references.
No white-label at any tier — same fundamental limitation as all major loyalty platforms.

The AI stack

The loyalty AI stack is lightweight and cheap — three models handle all personalization at a combined cost under $0.003 per member per month. Haiku 4.5 handles all copy generation; text-embedding-3-small handles affinity scoring; XGBoost handles churn prediction. Don't over-engineer this stack.

01

Personalized redemption email + campaign copy generation

Generates member-specific redemption suggestion emails, churn-prevention campaign copy, and tier-upgrade congratulations messages

Claude Haiku 4.5

$1/$5 per M tokens

All redemption emails and churn-prevention campaigns — tone quality is the primary loyalty email differentiator

+ Best balance of tone quality and cost for loyalty copy; 200K context handles full member history; consistent brand-voice adherence across diverse merchant categories 200K context cap means very long member histories (5+ years of purchase data) require truncation to the most recent 50 orders

DeepSeek V4 Flash

$0.14/$0.28 per M tokens

SMS nudges and bulk notification copy (points-expiry reminders, tier-anniversary messages) where brevity is valued over warmth

+ 7× cheaper than Haiku 4.5; adequate for high-volume bulk notifications (points-expiry reminders, birthday rewards, newsletter cadences) Copy tone is more functional than warm — acceptable for transactional notifications, not for the personalized redemption moment

Claude Sonnet 4.6

$3/$15 per M tokens

Premium-tier referral message generation for merchants where referral is the primary acquisition channel (beauty, wellness, food boxes)

+ Significantly better at generating personalized referral messages that match the referring customer's voice and purchase context 15× more expensive than Haiku 4.5 — only justified for referral messages where personalization drives meaningfully higher share rates

Our pick: Default to Claude Haiku 4.5 for all redemption emails and churn campaigns. Use DeepSeek V4 Flash for bulk transactional notifications (expiry reminders, tier status updates). Reserve Claude Sonnet 4.6 for referral message generation on merchants where referral drives >20% of new customer acquisition.

02

Next-best-action reward scoring via embeddings

Matches each member's purchase history to the available reward catalog to surface the single most relevant reward in their portal and email

text-embedding-3-small

$0.02/M tokens

All production merchants — the cost is negligible and even basic embedding-based matching outperforms template-based 'featured reward of the month'

+ At $0.00002 per member scoring (embedding their 10 most recent purchases against 20 rewards), a 1,000-member merchant costs $0.02 in embedding fees per scoring run — essentially free Text-only embeddings miss category-level affinities that don't appear in product titles (a customer who buys 'men's shirts' may want 'men's accessories' but the embedding similarity is weak without product-category metadata

Our pick: Embed every reward item's title + description with text-embedding-3-small at catalog setup. For each member's monthly digest, embed their last 10 purchase titles and compute cosine similarity against the reward embedding matrix. Return the top-3 rewards by similarity. Total per-member cost: $0.00002. Run as a monthly batch.

03

Churn-risk scoring

Predicts which loyalty members are at 30-day churn risk based on purchase frequency, last-order recency, and tier engagement patterns

XGBoost classifier (self-hosted on Supabase Edge Function)

$0 (Supabase compute)

All merchants with 6+ months of loyalty program history and 200+ lifetime members

+ Industry-standard for tabular churn prediction; RFM (Recency, Frequency, Monetary) features map naturally to loyalty member behavior; interpretable feature importances Requires 90+ days of member history and at least 50 historical churns to train meaningfully — new merchants on the platform get a naive model initially

SQL RFM scoring (no ML)

$0 (Supabase Postgres compute)

New merchants with fewer than 200 members or fewer than 90 days of history — use SQL RFM as the cold-start churn scorer, graduate to XGBoost when training data accumulates

+ Works on any merchant from day one without training data; RFM scores (recency, frequency, monetary) correlate strongly with churn and are immediately interpretable Less accurate than XGBoost on edge cases (high-value but infrequent purchasers, seasonal buyers)

Our pick: Implement SQL RFM scoring at launch for all merchants; flag members with recency > 60 days as at-risk. When a merchant accumulates 200+ members and 90+ days of history, train an XGBoost model on their data and switch to model-based scoring. The SQL RFM approach costs nothing and works immediately; the XGBoost upgrade improves accuracy by ~15–25%.

Reference architecture

The platform has four distinct runtime phases: continuous (Shopify/Stripe webhooks crediting points for purchases), daily (churn scoring run), monthly (redemption email generation, reward scoring, tier review), and real-time interactive (member portal for checking balance and redeeming). The hardest engineering challenge is idempotent points crediting — Shopify order webhooks can fire multiple times for the same order, and double-crediting points destroys loyalty program economics.

01

Merchant onboards — connects Shopify store and configures loyalty rules

Next.js Shopify OAuth + loyalty-config form

OAuth captures Shopify Admin API access (read orders, read customers, write customer tags). The config form sets: points-per-dollar rate, tier thresholds (Bronze/Silver/Gold), reward catalog (items with point costs), and brand tone guidelines for AI copy. All config is stored in the tenant_config table with RLS isolation per merchant.

02

Member makes a purchase — order webhook fires to credit points

Next.js Route Handler POST /api/webhooks/shopify/orders + Supabase points_ledger

The orders/paid webhook fires. The handler checks idempotency: if the Shopify order ID already exists in the points_ledger table (with status 'credited'), skip. Otherwise: compute points = order_total × points_per_dollar_rate, insert a points_ledger row (member_id, merchant_id, order_id, points_delta, event_type='purchase', created_at). Update the member's running balance in the members table. A separate trigger checks if the new balance crosses a tier threshold — if so, update tier and queue a tier-upgrade congratulations email.

03

Daily churn scoring run identifies at-risk members

Supabase scheduled function + XGBoost (or SQL RFM fallback)

A pg_cron function runs at 3am UTC. For each active member: compute RFM scores (days since last purchase, total orders in 90 days, total spend). For merchants with XGBoost models: call the model inference endpoint with feature vector. Update member_risk_scores table. Members with score > 0.7 are flagged for churn-prevention campaigns. A Trigger.dev job picks up newly flagged members and calls Claude Haiku 4.5 to generate a personalized churn-prevention email (double-points offer or bonus reward unlock).

04

Monthly batch: next-best-reward scoring and redemption email generation

Trigger.dev monthly batch job + text-embedding-3-small + Claude Haiku 4.5

On the 1st of each month: (1) embed each merchant's reward catalog if updated since last run, (2) for each active member: embed their last 10 purchase titles, compute cosine similarity against reward embeddings, select top-3 rewards with highest similarity score, (3) call Claude Haiku 4.5 with the member's name, current balance, and top-3 reward recommendations to generate a personalized monthly points-digest email. Queue emails in Resend (or pass to Klaviyo API if the merchant has Klaviyo connected) for delivery at 10am member-local-time.

05

Member opens loyalty portal and views balance + recommended rewards

Next.js member portal (served at merchant's branded subdomain)

The member portal is white-labeled: the merchant's brand_color and logo from tenant_config populate the layout. Members see: current points balance, tier status + progress to next tier, their 3 AI-recommended rewards (with 'we picked these for you' rationale), full reward catalog, and order history. The portal is served via ISR with a 1-minute revalidation — fast but fresh enough for most loyalty use cases.

06

Member redeems a reward — points deducted and fulfillment triggered

Next.js Route Handler + Supabase points_ledger + Shopify discount code API

Member clicks 'Redeem' on a reward. The handler: (1) checks member has sufficient balance (optimistic locking with Postgres row lock to prevent race conditions), (2) deducts points with a 'redemption' ledger entry, (3) generates a Shopify discount code via Admin API (fixed-amount or percentage), (4) emails the discount code to the member via Resend, (5) logs the redemption in redemption_events for merchant analytics. Redemptions are logged to support state escheatment reporting.

07

Member shares a referral link — referred friend gets welcome bonus

Next.js referral flow + Claude Sonnet 4.6 (premium tier) / Haiku 4.5 (standard)

Member generates a personalized referral link from their portal. On share click: Claude Sonnet 4.6 (premium) or Haiku 4.5 (standard) generates a personalized referral message tailored to the member's purchase history ('I've been ordering their cold-brew concentrate for 6 months — use my link for 15% off your first order'). The referred friend's first order triggers a points credit for both the referrer and the new member. FTC endorsement guidance on AI-personalized referral messages requires disclosure that the message was generated with AI assistance.

08

Agency admin reviews multi-merchant loyalty analytics

Next.js agency admin dashboard

The admin dashboard shows across all merchants: active member count, points issued vs. redeemed this month, churn-risk heatmap, AI email performance (open rate, redemption click rate from Resend tracking), and AI cost per merchant. Merchants can be added, configured, and have their tier structures updated from the agency admin without touching individual merchant Shopify stores.

Estimated cost per request

~$0.002 per personalized redemption/churn email (Claude Haiku 4.5); ~$0.00002 per next-best-reward scoring (text-embedding-3-small cosine similarity)

Cost calculator

Drag the sliders to model your actual usage. The numbers update in real time so you can stress-test economics before writing a single line of code.

Models an agency operating the platform for multiple Shopify merchant clients. Fixed costs are shared infrastructure; per-unit AI costs scale with member count. Default assumes 10 active merchant clients with 200 loyalty members each (2,000 total members).

10 merchants
1100
200 members
505,000

Estimated monthly cost

$80.48

$966 per year

Supabase Pro (DB + Auth + Edge Functions)$25.00
Vercel Pro (Next.js hosting + member portal ISR)$20.00
Resend (transactional email — redemption emails + digests)$20.00
Trigger.dev (monthly batch jobs for email generation + churn scoring)$15.00
Claude Haiku 4.5 — monthly redemption/digest email per member$0.40
Claude Haiku 4.5 — churn-prevention email (20% of members flagged)$0.08
text-embedding-3-small — next-best-reward scoring per member (monthly)$0.00
Fixed: $80.00/moVariable: $0.48/mo

Calculator notes

  • Claude Haiku 4.5 monthly email cost ($0.002/member) assumes a 400-token input (member history + reward options) and 150-token output (email body). Actual cost scales with member history depth.
  • At default settings (10 merchants × 200 members = 2,000 total members), total AI cost is ~$4.80/mo — trivial versus $79–$199/mo per-merchant billing.
  • Resend's free tier covers 3,000 emails/mo; paid tier starts at $20/mo for 50K emails — included in fixed costs above.
  • Shopify discount code generation via Admin API is free within standard rate limits (2 calls/second per merchant); no incremental cost for redemption fulfillment.

Build it yourself with vibe-coding tools

By Sunday night you'll have a working loyalty platform: a merchant admin, a white-labeled member portal with points balance and AI-recommended rewards, Shopify webhook integration for points crediting, and a Claude Haiku 4.5 personalized monthly email system — on Shopify test mode and Supabase free tier.

Time to MVP

12–16 hours (1 weekend)

Total cost to MVP

$25 Lovable Pro + ~$15 LLM credits + free Shopify dev store + free Supabase tier

You'll need

Shopify Partner account with a development store that has customer and order test dataAnthropic API key for Claude Haiku 4.5 (and optionally Sonnet 4.6 for referral messages)OpenAI API key for text-embedding-3-small (next-best-reward scoring)Supabase project with pgvector extension enabledLovable Pro subscription ($25/mo)

Starter prompt

Lovable Prompt

Build a white-label AI customer loyalty program management SaaS on Next.js + Supabase. Three user types: Agency Admin (manages multiple merchant clients), Merchant Admin (manages their store's loyalty program), and Member (end customer). Database schema (Supabase): - agencies table: id, name, logo_url, brand_color, created_at. Enable RLS. - merchants table: id, agency_id, name, shopify_domain, shopify_access_token (encrypted), points_per_dollar numeric DEFAULT 1.0, tier_config jsonb ({ bronze_threshold, silver_threshold, gold_threshold }), brand_color text, tone_guidelines text, created_at. RLS on agency_id. - members table: id, merchant_id, shopify_customer_id text, email, first_name, current_points int DEFAULT 0, tier ('none'|'bronze'|'silver'|'gold'), churn_risk_score numeric, created_at. RLS on merchant_id. - points_ledger table: id, member_id, merchant_id, shopify_order_id text UNIQUE (for idempotency), points_delta int, event_type ('purchase'|'redemption'|'bonus'|'referral'|'expiry'), notes text, created_at. RLS on merchant_id. - rewards table: id, merchant_id, name text, description text, points_cost int, reward_type ('discount_pct'|'discount_fixed'|'free_product'|'gift'), reward_value numeric, active bool DEFAULT true, embedding vector(1536), created_at. RLS on merchant_id. - member_reward_scores table: id, member_id, reward_id, score numeric, scored_at date. RLS on merchant_id. - redemption_events table: id, member_id, reward_id, merchant_id, points_spent int, shopify_discount_code text, redeemed_at, created_at. Agency admin pages (/admin/*): - /admin — dashboard: merchants count, total members, AI emails sent this month, AI cost tracker - /admin/merchants — list merchants, add new merchant (Shopify domain + access token + tier config + tone guidelines) - /admin/merchants/[id] — settings, member count, churn-risk summary, recent redemptions, monthly email performance Merchant admin pages (/merchant/[merchant_id]/*): - /merchant/[id] — KPIs: active members, points issued/redeemed this month, avg balance, top redeemers - /merchant/[id]/members — member table with tier badge, current balance, churn-risk badge, last purchase date - /merchant/[id]/rewards — reward catalog management (add/edit/disable rewards) - /merchant/[id]/campaigns — upcoming monthly digest preview, churn-prevention campaign queue Member portal (served at /portal/[merchant_id]/[member_token]/): - The portal uses merchant.brand_color and merchant.logo_url for styling. No agency or RapidDev branding. - /portal/[merchant_id]/[token]/ — points balance, tier progress bar, top-3 AI-recommended rewards ('Picked for you'), full reward catalog - /portal/[merchant_id]/[token]/redeem/[reward_id] — redemption confirmation page. On confirm: deduct points, generate Shopify discount code via Admin API, show code + copy button. - /portal/[merchant_id]/[token]/history — points transaction history with event type and order links Shopify webhook Route Handler (POST /api/webhooks/shopify/orders-paid): - Verify HMAC. Check idempotency on shopify_order_id. Find or create member by customer email. Credit points = order_total × merchant.points_per_dollar. Insert points_ledger row. Check tier threshold; if crossed, update member.tier and queue tier-upgrade email. Next-best-reward scoring (Supabase Edge Function: score-rewards): - For each active member: embed their last 10 purchase titles with text-embedding-3-small. - Compute cosine similarity of member embedding against each reward's embedding vector. - Upsert top-3 results into member_reward_scores. - Run monthly via pg_cron on the 28th. Monthly email generation (Trigger.dev job: generate-monthly-digests, runs on 1st of month): - For each merchant's active members: 1. Load member name, current points balance, top-3 reward scores with reward names 2. Call Claude Haiku 4.5: system 'You are a loyalty program manager writing a warm monthly points digest email. Brand: {merchant_name}. Tone: {tone_guidelines}. Max 200 words.' 3. User: 'Member: {first_name}. Balance: {current_points} points. Top 3 rewards they'd love: {reward_1}, {reward_2}, {reward_3}. Write the email with subject line as JSON.' 4. Send via Resend API to member.email. Log send in a digests_log table. Churn-prevention campaign (Trigger.dev daily job: churn-campaigns): - Query members with churn_risk_score > 0.7 who have NOT received a churn email in the past 30 days. - For each: call Haiku 4.5 to generate a double-points offer email ('We miss you! Earn 2× points on your next order — valid for 7 days'). Send via Resend. Log in campaigns_log. Styling: Tailwind CSS. Agency/merchant admin: clean dark sidebar, data tables, badge components for tiers. Member portal: brand_color as primary color, consumer-friendly card layout, mobile-first. Environment variables: NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, SUPABASE_SERVICE_ROLE_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY, RESEND_API_KEY, SHOPIFY_WEBHOOK_SECRET.

Paste this into Lovable

Follow-up prompts (run in order)

  1. 1

    Add Klaviyo integration as an alternative to Resend for merchants who already use Klaviyo: on /merchant/[id] settings, add a 'Connect Klaviyo' field for the merchant's Klaviyo private API key. When connected, the monthly digest and churn-prevention emails are sent via the Klaviyo v2024 Campaigns API instead of Resend. The AI-generated content populates Klaviyo email body variables. Store the Klaviyo key encrypted in merchants table alongside the existing config.

  2. 2

    Add referral program mechanics: add a member_referrals table (referrer_member_id, referred_member_id, merchant_id, created_at, credited bool). In the member portal, add a 'Refer a Friend' section that generates a unique referral link. When a referred member makes their first purchase (detected by the orders-paid webhook with referral metadata), credit bonus points to both referrer and new member. Use Claude Sonnet 4.6 to generate a personalized referral share message based on the referrer's top 3 purchased products.

  3. 3

    Add a points-expiry system: add an expires_at field to points_ledger rows for bonus points and welcome bonuses (not for purchase-earned points). Run a nightly pg_cron function that identifies expiring points (expires in 7 days or 1 day) and generates expiry-warning emails via Haiku 4.5 ('Your 200 bonus points expire in 7 days — here's the perfect reward to use them on'). Log expiry credits as negative points_ledger entries on the expiry date.

  4. 4

    Add a merchant-facing loyalty ROI dashboard: on /merchant/[id], add a 'Loyalty ROI' section with recharts charts: (1) Repeat purchase rate of loyalty members vs. non-members (compare order counts per customer from Shopify data), (2) Average LTV of members by tier, (3) Redemption rate by reward type. Include a Claude Haiku 4.5-generated monthly insight ('Your Gold tier members spend 3.4× more than Bronze — promote more Bronze members to Silver with the 90-day streak bonus').

Expected output

A working white-label loyalty SaaS: agency admin manages multiple merchants, each merchant has a branded member portal at their subdomain, Shopify orders automatically credit points, Claude Haiku 4.5 sends personalized monthly digests, and churn-risk members receive AI-drafted double-points offers.

Known gotchas

  • !Points ledger idempotency is the most critical safety requirement: Shopify's orders/paid webhook can fire 2–3 times for the same order in edge cases (payment processor delays, webhook retries). The handler MUST check for existing shopify_order_id in points_ledger before crediting — a double-credit permanently inflates a member's balance and is nearly impossible to reverse without member complaints.
  • !State gift-card and escheatment laws: unredeemed loyalty points that can be redeemed for cash-equivalent rewards (gift cards, cash back) may be subject to state unclaimed property laws (CA, NY have the strictest requirements). After a defined inactivity period (typically 3 years), unclaimed points balances may need to be escheated to the state. Consult a compliance attorney if the merchant's rewards include cash-equivalent redemptions worth more than $5.
  • !Shopify Customer Tags write scope: marking members as 'VIP Gold' or 'Loyalty Member' via Customer Tags requires the write_customers scope in the Admin API — stricter than read-only and some merchant clients push back. Document the scope requirement clearly in onboarding; provide an alternative flow that skips tag sync for clients who won't grant write_customers.
  • !FTC endorsement guidance on AI-personalized referral messages: if the platform generates referral messages that appear to be written by the member themselves, FTC's 2023 endorsement guides require disclosure that the message was AI-assisted. Add a small 'Message drafted by AI' disclosure to the referral share copy or in the platform's terms of service.
  • !The member portal URL exposes the member_token in the URL — if this token is guessable (sequential integers), members can access other members' portals. Use UUID v4 (Supabase's DEFAULT gen_random_uuid()) for all member_token values, never sequential integers.
  • !Klaviyo's API rate limits are per-account (not per-request-type) — if a merchant sends a large batch of monthly digest emails via the Klaviyo Campaigns API, it can consume most of the rate limit budget and block other Klaviyo API calls (list sync, event tracking) for the merchant. Implement a delay between batches (100ms between each Klaviyo email send call) or use the Klaviyo Bulk Send endpoint if available.

Compliance & risk reality check

Customer loyalty programs operate at the intersection of financial regulation (points as a liability on the merchant's balance sheet, potential escheatable property), consumer protection law (FTC disclosures on AI-generated referral messages), and data-protection law (behavioral profiling for churn scoring and next-best-action recommendations).

Important

State gift-card and unclaimed property (escheatment) laws

California Business and Professions Code §17538.9 and New York GBL §396 regulate gift certificates and loyalty program points that are redeemable for cash or cash-equivalent rewards. Under California's Unclaimed Property Law, unredeemed 'property' (including loyalty points redeemable for cash-equivalent rewards) must be escheated to the state after 3 years of account inactivity. New York's dormancy period is 5 years. Failure to comply results in penalties equal to the unreported property value plus interest. Points redeemable only for products (not cash or gift cards) have different treatment — consult a CPA familiar with loyalty program accounting.

Mitigation: Consult a CPA or compliance attorney before launch if any rewards include cash-back, gift cards, or cash-equivalent redemptions. For product-only rewards (discount codes, free products), the escheatment exposure is generally lower but state-specific. Implement an inactivity tracking log for members with non-zero balances from day one. In the points-expiry system (see build_yourself follow-up prompts), points expiry after a defined period can reduce escheatment liability by treating expired points as revenue rather than unclaimed property — but requires consistent application and member disclosure.

Important

GDPR/CCPA on behavioral profiling for churn scoring and next-best-action

Churn-risk scoring and next-best-reward recommendations constitute automated profiling under GDPR Article 4(4) and CCPA's definition of 'sensitive personal information' expansion in CPRA. EU members have a right to not be subject to decisions based solely on automated processing (GDPR Article 22), though the loyalty context is typically exempt as a contractual necessity. Under CCPA, members must be informed of profiling in the privacy policy and can opt out of 'sensitive' processing in California.

Mitigation: Disclose AI-powered loyalty personalization (churn scoring, next-best-reward) in the merchant's privacy policy and the member portal's data section. For EU members, add a 'Personalization Preferences' section to the member portal where they can opt out of AI-driven recommendations (defaulting to non-personalized 'featured rewards' instead). Execute a DPA with Anthropic for Claude API usage and OpenAI for embedding usage — both have standard DPAs available on their websites.

Good to know

FTC endorsement guidance on AI-generated referral messages

The FTC's updated endorsement guides (2023, 16 CFR Part 255) and their 2025 AI enforcement FAQ note that AI-generated content presented as if written by a real person (including AI-drafted referral messages that appear to be from the referring customer) requires disclosure. A referral message generated by Claude Sonnet 4.6 that reads as if the customer personally wrote it could be considered a material deceptive act if undisclosed.

Mitigation: Add a disclosure to the referral share flow: after the member clicks 'Generate Referral Message,' display a note: 'This message was drafted with AI assistance based on your purchase history. Feel free to edit it before sharing.' This small disclosure satisfies FTC guidance without materially reducing referral conversion.

Good to know

SOC 2 Type II for merchants granting Admin API access

Merchants granting the loyalty platform Admin API access (write_customers scope, read_orders scope) are trusting the platform with sensitive customer and order data. Enterprise Shopify Plus accounts and B2B merchants routinely require SOC 2 Type II attestation before granting Admin API write access to third-party tools.

Mitigation: Use Vanta or Drata to start a SOC 2 audit trail from day one. Provide a security questionnaire response to early enterprise customers documenting RLS data isolation, encrypted token storage, and access control. Request only the minimum required scopes (read_orders, read_customers, write_customers for tag sync — optionally drop write_customers if the merchant declines and skip Customer Tag sync).

Build vs buy: the real math

5–8 weeks

Custom build time

$13,000–$25,000

One-time investment

3–5 months

Breakeven vs buying

The buy path at $49/mo per merchant (Smile.io Starter) provides co-branding but no full white-label and no AI personalization. An agency serving 20 merchants pays $980/mo in Smile.io fees with no margin and no brand ownership. The RapidDev custom build at $13K–$25K one-time generates $79–$199/mo per merchant billing; at 20 merchants billing $99/mo, that's $1,980/mo revenue against $80/mo infra = $1,900/mo gross profit. Breakeven on a $13K build at $1,900/mo: 6.8 months. On a $25K build: 13 months. The Lovable self-build ($25 + $80/mo infra) generates $1,900/mo gross margin from month one — payback is immediate on the first 2 paying merchants. The AI personalization layer is the key commercial differentiator: a merchant that switches from Smile.io's template-based emails to Claude Haiku 4.5 personalized monthly digests can expect to see a 15–30% improvement in redemption rate, which directly justifies the $79–$99/mo platform fee versus Smile.io's $49/mo template-only offering.

Skip the DIY — RapidDev builds the production version

A Lovable MVP gets you a demo. Production needs auth that doesn't leak data, AI calls that don't bankrupt you, observability when models drift, and code you can audit. That's what we ship.

1

Discovery call (free)

30 min

We map your exact Customer Loyalty Program Manager use case: who uses it, target volume, AI model choice, integrations, compliance scope. You get a detailed scope document and fixed-price quote within 48 hours.

2

AI-accelerated build

5–8 weeks

Our engineers use Claude Code, Lovable, and custom tooling to ship 3–5x faster than agencies. You see weekly progress in a staging environment — not a black box.

3

Launch + handoff

1 week

We deploy to your infrastructure, transfer the GitHub repo, set up CI/CD and monitoring, and train your team. You own 100% of the source code, prompts, and model configurations.

What you get

Full source code (GitHub repo)
Deployed on your infrastructure
Audited prompts & model configs
Cost monitoring + budget alerts
3 months of bug-fix support
Direct Slack channel with engineers

Timeline

5–8 weeks

Investment

$13,000–$25,000

vs SaaS

ROI in 3–5 months

Get your free estimate

30-min call. Fixed-price quote within 48 hours. No commitment.

Frequently asked questions

How much does it cost to build a white-label AI loyalty program manager?

A RapidDev custom build runs $13,000–$25,000 for the full multi-tenant platform including Shopify webhook integration, AI personalization, member portal, churn scoring, and Stripe-connected billing. The Lovable self-build costs $25 (Lovable Pro) plus ~$15 in LLM credits for a working MVP. Ongoing AI costs run ~$0.002 per personalized email — at 1,000 members, that's $2/mo in AI plus $80/mo in infra.

How long does it take to ship a loyalty program platform?

The Lovable self-build produces a working MVP in a weekend (12–16 hours) including Shopify webhook integration and Claude Haiku 4.5 monthly emails. A RapidDev custom build takes 5–8 weeks including multi-tenant RLS, Shopify Admin API integration, churn scoring, member portal, and billing. The most time-consuming piece is the points-ledger idempotency logic and Shopify webhook reliability testing — plan a full week for this.

Can RapidDev build this for my retention agency?

Yes — RapidDev has shipped 600+ applications including loyalty programs, subscription management platforms, and AI personalization engines. Start with a free 30-minute consultation at rapidevelopers.com to scope your merchant count, Shopify integration requirements, and AI personalization goals. We'll recommend whether a standard build or a more complex multi-tier integration is the right starting point.

What's the difference between this and Smile.io's agency program?

Smile.io's agency program offers co-branding (your logo next to Smile's) and a multi-merchant management dashboard — but not full white-label. The client's loyalty portal still shows Smile.io in the admin URL, email footers, and some UI elements. This platform is a full white-label: your agency's brand and logo exclusively, no third-party brand visible to the merchant or their members. Additionally, Smile.io's email templates are static; this platform uses Claude Haiku 4.5 to generate personalized emails that reference each member's specific purchase history.

How do unredeemed loyalty points affect merchant accounting?

Unredeemed points represent a contingent liability on the merchant's balance sheet — the merchant has promised future value that hasn't yet been delivered. GAAP requires merchants to estimate and record this liability (called 'breakage') each period. The percentage of points expected to never be redeemed is the breakage rate, which offsets the liability. Your platform's redemption tracking data is essential input for the merchant's accountant to compute breakage. For points redeemable for cash-equivalent rewards, consult a CPA before launch — state unclaimed property laws may require escheating dormant balances.

Can the platform integrate with Klaviyo for email delivery?

Yes — the platform supports Klaviyo as an alternative email delivery channel for merchants who already use Klaviyo for their email marketing. The AI-generated email content (subject line, body) is passed to the Klaviyo Campaigns API or Klaviyo transactional email endpoint. This preserves the merchant's existing Klaviyo templates and deliverability reputation while adding AI-personalized content. The Lovable follow-up prompt in this guide walks through the Klaviyo integration step-by-step.

How does the AI next-best-reward recommendation actually work?

Each reward item (e.g., '15% off Cold Brew Bundle', 'Free Stainless Travel Mug', '$20 Gift Card') is embedded with text-embedding-3-small at setup — its title and description become a 1536-dimension vector. Each month, the platform embeds a member's last 10 purchase titles into the same vector space. The system computes cosine similarity between the member's purchase vector and each reward vector, returning the top-3 rewards with the highest similarity scores. A member who buys cold-brew products gets different reward recommendations than a member who buys kitchen gear — even if both have identical points balances. The cost: $0.00002 per member per month.

What happens when a member's points expire?

Points expiry requires both a technical implementation and a member disclosure. Technically: points_ledger rows with an expires_at value are checked nightly; expiring balances trigger a warning email 7 days before expiry and a Haiku 4.5-generated redemption suggestion. On the expiry date, a negative points_ledger entry is written and the member's balance is reduced accordingly. Disclosure-wise: the expiry policy must be clearly stated at program enrollment, in the terms of service, and in the member portal. State escheatment law compliance depends on whether the expiry is treated as 'breakage' revenue or a forfeiture — consult a compliance attorney for cash-equivalent rewards.

RapidDev

Want the production version?

  • Delivered in 5–8 weeks
  • You own 100% of the code
  • AI cost monitoring built in
Get a free estimate

30-min call. No commitment.

Want this built for you?

We ship production apps at a fixed price — $13K–$25K, 6–10 weeks, source code yours. You've seen what it takes; we do it every week.

Get a fixed-price quote

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.