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

White-Label AI Smart Shopping Cart Platform for Shopify CRO Agencies

Three paths: subscribe to UpCart or AfterSell at $15–$299/mo per merchant (no white-label tier), hire RapidDev at $13K–$25K for a custom cart platform, or build yourself with Lovable + Shopify Theme App Extensions for ~$35 in a weekend. Research recommends build-yourself: DeepSeek V4 Flash at $0.0005 per threshold-copy generation and a multi-armed bandit running in a Supabase Edge Function make a 50-merchant white-label profitable at $49/mo per merchant with 95%+ 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 Smart Shopping Cart Platform, side-by-side. Pick the one that matches your budget, timeline, and how much control you actually need.

Subscribe to cart drawer SaaS (UpCart, AfterSell, Rebuy)

Buy SaaS
Time to launch
1–3 hours per merchant setup
Upfront cost
$0
Monthly cost
$15–$499/mo per merchant
Ownership
Locked into vendor; no white-label
Customization
Cart design within the app's component library; no AI variant generation

Best for

A single DTC brand that wants a polished cart drawer with free-shipping progress bar without any engineering setup

Risks

  • No white-label tier exists across UpCart, AfterSell, iCart, or Slide Cart — the vendor brand stays in the app listing and sometimes in the cart UI.
  • Serving 20 merchants at $19.99–$99.99/mo = $400–$2,000/mo in tool costs with no margin — and you can't put your agency's brand on the delivered product.
  • AI threshold copy and exit-intent personalization are absent on all cart drawer tools in this price range — the 'AI' features, if any, are template-based.
  • Rebuy Engine ($99–$499+/mo) overlaps heavily with cross-sell upsell tooling and is metered per checkout — costs spike unpredictably during high-GMV events.

Hire RapidDev

Hire agency
Time to launch
4–7 weeks
Upfront cost
$13,000–$25,000
Monthly cost
$100–$250 infra (Supabase + Vercel)
Ownership
You own the code
Customization
Unlimited — your roadmap

Best for

CRO agencies with 10+ committed merchant clients willing to pay $79+/mo for a branded cart optimization tool

Risks

  • Shopify Theme App Extensions have specific Liquid/JavaScript constraints — scope must be validated against Shopify's current Extension API documentation before design is finalized.
  • Multi-armed bandit convergence requires a minimum of 200–500 sessions per variant to reach statistical significance — new merchant deployments look indistinguishable from control for the first 2–3 weeks.
  • The AI threshold copy is cheap to run but requires human QA before deploying new variant templates — Lovable or a junior developer can generate bad copy variants that hurt CVR.
  • Shopify periodically changes Theme App Extension APIs — budget for 1–2 weeks/yr of maintenance to keep the cart Extension compatible with Shopify's latest requirements.
Recommended

Build with Lovable

Build yourself
Time to launch
1 weekend
Upfront cost
$25 Lovable Pro
Monthly cost
$10–$50 (Supabase + Vercel Pro) + AI API costs (~$1–$5/mo at 20 merchants)
Ownership
You own the code
Customization
Full — Shopify Theme App Extension + custom backend

Best for

Individual Shopify developers or small CRO agencies who want to own the IP on a cart tool and charge per-merchant recurring fees without a $13K+ investment

Risks

  • Shopify Theme App Extension development is not a standard Lovable pattern — the cart drawer UI must be built as a Shopify Extension block, which requires Shopify CLI and is outside Lovable's standard web-app scaffolding.
  • The multi-armed bandit logic requires careful session bucketing — using localStorage to assign visitors to variants is fragile across incognito sessions and device switches.
  • DeepSeek V4 Flash occasionally produces threshold copy that doesn't match the merchant's brand voice without tone tuning — allocate time for prompt calibration per merchant.
  • Exit-intent detection is inherently imprecise on mobile (no reliable cursor-leave event) — the mobile variant needs scroll-velocity detection or back-button interception, which Lovable won't implement correctly without explicit prompting.

What a Smart Shopping Cart Platform actually does

Powers a Shopify cart drawer with AI-generated dynamic free-shipping threshold copy, exit-intent recovery messages, and multi-armed bandit optimization — all per-merchant-configurable from a white-label agency dashboard.

An AI smart shopping cart platform is an ecommerce drawer cart — the slide-out panel that replaces the default Shopify cart page — enhanced with three AI-powered conversion features. First, dynamic threshold copy: as a customer's cart total rises, DeepSeek V4 Flash generates personalized copy ('Add $8.40 to unlock free shipping + a free bamboo fork set this week only') that updates in real time. This is more effective than static threshold bars because the copy is context-aware (current cart contents, available promotions, day-of-week seasonality). Second, exit-intent recovery: when the cursor leaves the viewport on desktop or a back-swipe is detected on mobile, Claude Haiku 4.5 generates a one-sentence cart-save message that references the highest-value item in the cart ('Leaving? Your espresso machine is still waiting — complete checkout and get it shipped free today'). Third, the multi-armed bandit: across all sessions for a merchant, the system continuously tests 3–5 threshold-copy variants and auto-allocates more traffic to the winning variant using an epsilon-greedy algorithm running in a Supabase Edge Function.

The category clarification is important: 'smart shopping cart' splits into two entirely different markets. The physical-retail hardware interpretation (Amazon Dash Cart, Instacart Caper Cart) is a $5M–$50M per-chain enterprise integration involving computer vision and embedded hardware — not relevant for Shopify agencies. The ecommerce interpretation is a cart drawer UI with AI conversion features — this is the product documented here. The distinction matters because searchers landing on this page may have the hardware interpretation in mind; the page should quickly redirect them to the ecommerce context.

The agency opportunity: UpCart, AfterSell, iCart, and Rebuy Engine all charge per-merchant with no rebrandable tier. An agency serving 20 Shopify merchants pays $400–$2,000/mo in separate tool subscriptions. A white-label build with DeepSeek V4 Flash handling threshold copy at $0.0005 per render runs under $5/mo in AI costs for 20 merchants at typical session volumes — billable at $49–$99/mo per merchant with 95%+ gross margin.

AI capabilities involved

Dynamic free-shipping threshold copy generation

DeepSeek V4 Flash ($0.14/$0.28 per M)GPT-5.4 nano ($0.20/$1.25 per M)Gemini 3.1 Flash-Lite ($0.25/$1.50 per M)

Exit-intent recovery message personalization

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)

A/B and multi-armed bandit threshold variant testing

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

Cart-context-aware upsell copy injection

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

Bundle discount suggestion from cart contents

Claude Haiku 4.5 ($1/$5 per M)DeepSeek V4 Flash ($0.14/$0.28 per M)GPT-5.4 mini ($0.75/$4.50 per M)

Who uses this

  • Shopify CRO agencies serving 10–100 mid-market merchants who want a rebrandable cart experience tool as a recurring revenue product
  • DTC growth consultants who include cart optimization in their retainer and want to own the tooling rather than resell per-merchant SaaS
  • Shopify app developers who want to build a competing cart drawer app to sell in the Shopify App Store with AI differentiation
  • Multi-brand DTC operators (3–10 portfolio brands) who want a single cart optimization tool deployed across all brands from one admin
  • Email and SMS marketing agencies looking to add pre-checkout cart recovery to their suite without a separate third-party tool

SaaS alternatives on the market

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

UpCart

Single DTC merchants who want a cart drawer deployed in under an hour without any development.

Free plan (limited features)

$19.99/mo (Starter)

$99.99/mo (Enterprise)

Pros

  • +Purpose-built cart drawer for Shopify with a visual drag-and-drop block editor — fastest time to a polished cart UI without any code.
  • +Free-shipping progress bar and in-cart upsell blocks included at all paid tiers.
  • +Strong template library covering DTC, fashion, beauty, and food verticals.
  • +Good mobile-first design defaults — cart renders well on all devices out of the box.

Cons

  • No white-label tier — UpCart brand in the app listing; some UI elements reference UpCart in tooltips.
  • AI threshold copy and exit-intent personalization are absent — threshold copy is static text you configure manually.
  • No multi-armed bandit testing — A/B variant comparison requires a separate tool.
  • The $99.99/mo Enterprise tier is still per-merchant with no agency discount or reseller program.
Serving 20 merchants at $19.99–$99.99/mo = $400–$2,000/mo in tool costs with zero agency margin and zero white-labeling.

AfterSell

DTC brands that want a combined cart drawer + post-purchase upsell solution from a single vendor.

Free (up to 50 orders/mo)

$34.99/mo (Basic)

$299.99/mo (Enterprise)

Pros

  • +Cart drawer + post-purchase upsell in one tool — the only mainstream option that covers both pre-checkout and post-checkout conversion.
  • +AI product recommendation layer (affiliate-content aware) included at higher tiers.
  • +Good Shopify Checkout integration for post-purchase one-click upsells.
  • +Thank-you page customization included — adds value beyond just the cart drawer.

Cons

  • No white-label tier.
  • Post-purchase upsell and cart drawer are bundled — agencies who only want the cart drawer feature pay for post-purchase capability they may not use.
  • AI product recommendations are based on AfterSell's algorithm, not configurable to the agency's custom affinity model.
  • Per-merchant pricing with no agency tier or volume discount.
$299.99/mo Enterprise per merchant — for an agency serving 10 merchants on this tier, that's $3,000/mo with no margin and no brand customization.

iCart Cart Drawer

Budget-conscious single DTC merchants who want basic cart drawer and upsell features at the lowest per-merchant cost.

Free plan (limited)

$14.99/mo (Basic)

$99.99/mo (Enterprise)

Pros

  • +Lowest paid tier in the segment at $14.99/mo.
  • +In-cart upsell, cross-sell, and free-gift-with-purchase features at all paid tiers.
  • +Good customization of cart drawer layout within the app's design system.
  • +Volume discount available for developers (Shopify Partner program).

Cons

  • No white-label tier.
  • No AI copy generation — all threshold and upsell copy is manually entered.
  • No multi-armed bandit or variant testing.
  • UI customization is limited to the app's preset layout options — custom drawer designs require code modifications not supported by the app.
No AI or testing features at any tier — the tool is a static cart UI configurator, not an optimization platform.

Rebuy Engine

Mid-market to enterprise DTC brands ($3M–$50M GMV) that want the highest-quality AI recommendation layer across the full customer journey, not just the cart.

No free tier

$99/mo (Starter)

$499+/mo (Scale)

Pros

  • +Most sophisticated AI recommendation layer in the cart drawer segment — personalization based on purchase and browse history.
  • +Covers cart drawer, checkout upsell, post-purchase, email, and reorder landing pages in one platform.
  • +Deep Shopify Plus integration — works with Shopify Checkout Extensions and Shopify Scripts.
  • +Strong agency support with a dedicated partner program.

Cons

  • No white-label tier even in the Rebuy partner program — Rebuy brand stays.
  • Metered per-checkout pricing at higher tiers — a flash sale can spike costs unpredictably.
  • The Rebuy smart cart is opinionated in its design — significant CSS overrides required to match a merchant's specific brand aesthetic.
  • Overkill for small DTC brands under $500K GMV where the $99/mo floor is difficult to justify.
Metered per-checkout pricing above Starter tier — a single high-traffic day can add hundreds of dollars in unexpected fees.

The AI stack

The AI stack for a smart cart is intentionally lightweight and cost-minimized — the threshold copy and exit-intent messages are low-stakes, high-frequency generation tasks where DeepSeek V4 Flash's $0.0005 cost per generation is the obvious choice. Reserve Claude Haiku 4.5 for exit-intent recovery messages where tone quality affects a high-intent buyer's final decision.

01

Dynamic threshold copy generation

Generates personalized 'add $X for free shipping / gift / discount' copy that updates as the customer's cart total changes

DeepSeek V4 Flash

$0.14/$0.28 per M tokens

Default for all threshold copy generation — the cost advantage over any other model is decisive for high-frequency, low-stakes copy

+ At $0.0005 per copy generation (~300-token average prompt + 50-token output), a merchant with 10K cart opens/mo costs $5/mo in AI — trivial at any price point Threshold copy tone can be generic without detailed brand tone guidelines in the system prompt — requires per-merchant prompt calibration

GPT-5.4 nano

$0.20/$1.25 per M tokens

Premium merchants with complex threshold structures (multiple simultaneous promotions) where DeepSeek struggles to express the stacking logic clearly

+ Slightly more reliable instruction following on complex threshold conditions (free shipping + gift + discount stacking) 1.4× more expensive than DeepSeek V4 Flash for marginal copy-quality improvement

Our pick: Use DeepSeek V4 Flash as the universal default. If a merchant has complex threshold stacking (free shipping + gift-with-purchase + discount all activating at different thresholds), switch that merchant's config to GPT-5.4 nano.

02

Exit-intent recovery messages

Generates a one-sentence cart-save message when exit intent is detected, referencing the highest-value item in the cart

Claude Haiku 4.5

$1/$5 per M tokens

All exit-intent messages where conversion stakes are high — this is the buyer's last touchpoint before leaving

+ Best tone quality for the exit-intent moment — the message needs to feel personal, not algorithmic, to interrupt a leaving buyer effectively At $0.002 per exit-intent message, cost is 4× DeepSeek — acceptable given the high-conversion-value moment

DeepSeek V4 Flash

$0.14/$0.28 per M tokens

Budget-tier merchants where exit-intent is a checkbox feature rather than a primary conversion lever

+ At $0.00014 per message, cost is negligible; adequate for functional exit-intent copy Copy can feel formulaic ('Don't leave! Your cart is waiting.') without the warmth that Haiku brings

Our pick: Use Claude Haiku 4.5 for exit-intent messages at the $99+/mo tier. Use DeepSeek V4 Flash at the $49/mo base tier. The tone difference is worth $0.0015 per message for merchants who are using exit-intent as a primary conversion tool.

03

Multi-armed bandit variant testing

Continuously tests 3–5 threshold-copy variants per merchant and auto-allocates traffic to the best-performing variant using epsilon-greedy

Epsilon-greedy algorithm in Supabase Edge Function (custom code)

$0 (Edge Function compute)

All merchants — the variant testing framework is the most defensible differentiator versus static cart tools; implement it universally

+ No AI API cost — the bandit algorithm is pure statistics. DeepSeek V4 Flash generates the variant copy pool at campaign creation time (~$0.002 for 5 variants); the bandit runs for free thereafter Requires minimum 200–500 sessions per variant to reach statistical significance — new merchant deployments effectively run as random assignment for 2–3 weeks

Our pick: Generate 3–5 threshold-copy variants at merchant setup using DeepSeek V4 Flash ($0.002 total for the initial set). Run epsilon-greedy assignment in a Supabase Edge Function — each session reads the current variant weights from a cart_variants table and assigns accordingly. Update weights nightly based on add-to-cart and checkout conversion events.

Reference architecture

The architecture has two runtime surfaces: the Shopify Theme App Extension (client-side JavaScript running in the buyer's browser) and the backend API (Next.js Route Handler + Supabase Edge Functions). The Extension fires API calls to get threshold copy and bandit variant assignment; the backend handles copy generation, variant tracking, and conversion event ingestion. The hardest engineering challenge is reliable Shopify Extension compatibility — Shopify's online store 2.0 themes and Online Store 2.0 section schema change between theme updates, and the Extension must be tested against each merchant's active theme.

01

Merchant installs the Shopify app and completes onboarding

Shopify OAuth app installation + Next.js admin onboarding wizard

Standard Shopify OAuth installs the app and grants Admin API scope for reading product and cart data. The onboarding wizard captures: brand tone guidelines (tone_style: 'witty' | 'luxury' | 'urgent' | 'friendly'), free-shipping threshold, gift-with-purchase threshold, discount stack configuration, and brand color. These are stored in the merchants table in Supabase.

02

Merchant activates the cart drawer Extension on their theme

Shopify Theme App Extension block

The merchant activates the cart drawer Extension in their Shopify Theme Editor (Online Store → Themes → Customize → App blocks). The Extension replaces or augments the theme's default cart page/drawer. The Extension's JavaScript fetches configuration and variant assignments from the backend API on load.

03

Buyer adds item to cart — cart drawer opens

Theme App Extension JavaScript

The Extension intercepts the Shopify cart:open event. It reads the current cart total and line items from the Shopify global cart object (window.Shopify.cart). It fires a POST to /api/cart/threshold with { merchant_id, cart_total, cart_items } to get the current threshold copy and variant assignment.

04

Backend generates threshold copy and returns variant assignment

Next.js Route Handler /api/cart/threshold + Supabase Edge Function

The endpoint checks the merchant's variant table for the current epsilon-greedy assignment. For a new session (no variant cookie): assign to a variant using the current bandit weights (epsilon=0.1 random exploration, 0.9 exploitation of best variant). Return the assigned variant's threshold copy. If the copy hasn't been generated yet for this variant, call DeepSeek V4 Flash to generate it and cache in the cart_variants table.

05

Cart drawer renders with AI threshold copy and progress bar

Theme App Extension JavaScript (vanilla JS + CSS)

The Extension renders the threshold copy in the cart drawer's progress bar section. The copy updates dynamically as the buyer modifies cart contents — each update to cart total triggers a re-call to /api/cart/threshold (debounced at 500ms to avoid rapid-fire API calls). The progress bar fill is calculated client-side from cart total vs. threshold target.

06

Exit intent detected — recovery message displayed

Theme App Extension JavaScript (exit-intent detection)

On desktop: mouseleave event on the document fires when cursor moves to the top of viewport (buyer likely heading to close tab or navigate away). On mobile: popstate event fires on back-button press, or velocity-based scroll detection fires on rapid upward scroll. When triggered: POST to /api/cart/exit-intent with { merchant_id, top_cart_item_title, cart_total }. Claude Haiku 4.5 generates a one-sentence recovery message. Extension displays in an overlay modal with a 5-second timeout.

07

Conversion events ingested and bandit weights updated

Theme App Extension JavaScript → POST /api/cart/event

Three events are tracked: cart_open (session start), add_to_cart (after seeing threshold copy), checkout_start (strongest conversion signal). Each event is POSTed to the backend with { merchant_id, session_id, variant_id, event_type }. A nightly Supabase Edge Function aggregates events per variant, computes checkout_conversion_rate, and updates the epsilon-greedy weights in the cart_variants table.

08

Agency views multi-merchant analytics in the white-label admin

Next.js admin dashboard (agency-facing, white-labeled)

The admin dashboard shows: active merchant count, session volume by merchant, winning variant per merchant (with copy text + conversion rate), average checkout conversion lift vs. no-AI baseline, and AI cost tracker. Merchants can be added, configured, and have their variant tests reset from this single interface. The admin UI uses the agency's brand_color and logo — zero RapidDev branding.

Estimated cost per request

~$0.0005 per dynamic threshold copy generation (DeepSeek V4 Flash, ~300 in + 50 out); ~$0.002 per exit-intent recovery message (Claude Haiku 4.5)

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 running the platform for multiple Shopify merchants. Fixed costs are the hosting and database; variable costs scale with cart session volume across all merchants. Default assumes 20 merchants each generating 5,000 cart opens per month.

20 merchants
1200
5,000 sessions
500200,000
15 percent
540

Estimated monthly cost

$46.55

$559 per year

Supabase Pro (DB + Edge Functions + Auth)$25.00
Vercel Pro (Next.js API routes + admin dashboard)$20.00
DeepSeek V4 Flash threshold copy generation (per cart open, cached after first generation per variant)$0.05
Claude Haiku 4.5 exit-intent recovery message$1.50
Fixed: $45.00/moVariable: $1.55/mo

Calculator notes

  • Threshold copy is generated once per variant per merchant and cached in the cart_variants table — not per cart open. The $0.00001 per cart open figures the amortized cost of cache misses (new variants, cache expiry) across total session volume.
  • Exit-intent cost is the dominant variable cost — 15% exit intent rate × $0.002 per Haiku 4.5 call × 5,000 sessions = $1.50/merchant/mo. At 20 merchants, total exit-intent AI cost is $30/mo.
  • Total AI cost at default settings (20 merchants, 5K sessions each): approximately $35/mo — trivial versus $49–$99/mo per-merchant billing.
  • Shopify App Store fees (15–20% of subscription revenue) are excluded — only relevant if distributing through the Shopify App Store rather than direct agency billing.

Build it yourself with vibe-coding tools

By Sunday night you'll have a working AI smart cart backend: an agency admin dashboard managing merchant configs, a DeepSeek V4 Flash threshold copy API, a Haiku 4.5 exit-intent API, and a vanilla JS snippet that the merchant pastes into their Shopify theme — ready to demo to your first 3 clients.

Time to MVP

12–16 hours (1 weekend; Shopify Extension setup adds 3–4 hours)

Total cost to MVP

$25 Lovable Pro + ~$10 DeepSeek/Anthropic API credits + Shopify Partner account (free)

You'll need

Shopify Partner account (free) with a development store to test the cart drawer ExtensionDeepSeek API key (platform.deepseek.com — V4 Flash is available immediately on the API)Anthropic API key for Claude Haiku 4.5 (exit-intent messages)Supabase project (free tier sufficient for MVP)Lovable Pro subscription ($25/mo)

Starter prompt

Lovable Prompt

Build the backend and agency admin dashboard for a white-label AI smart shopping cart platform. Note: the Shopify Theme App Extension (the actual cart drawer UI) will be a separate Shopify CLI project — build only the backend API and agency admin dashboard here. Database schema (Supabase): - merchants table: id, agency_id, name, shopify_domain, shopify_access_token (encrypted), brand_color, tone_style ('witty'|'luxury'|'urgent'|'friendly'|'neutral'), free_shipping_threshold numeric, gift_threshold numeric, gift_description text, discount_threshold numeric, discount_copy text, created_at. RLS on agency_id. - cart_variants table: id, merchant_id, variant_name (e.g. 'A'|'B'|'C'), copy_text text (the generated threshold copy), conversion_events int DEFAULT 0, total_sessions int DEFAULT 0, conversion_rate numeric GENERATED, weight numeric DEFAULT 0.33, is_winner bool DEFAULT false, created_at. - cart_sessions table: id, merchant_id, session_id text, variant_id uuid, events jsonb (array of {type, timestamp}), created_at. Partitioned or TTL-deleted after 90 days. - agencies table: id, name, logo_url, brand_color, created_at. Agency admin pages (/admin/*): - /admin — overview: total merchants, total sessions this month, total checkout starts, AI cost estimate - /admin/merchants — list of merchants with current winning variant, session count, conversion rate. Add merchant button opens a form (domain, API key, tone style, threshold config) - /admin/merchants/[id] — merchant settings (all config fields), variant performance table (variant A/B/C with sessions, conversions, rate, current weight), 'Generate New Variant' button, 'Reset Test' button, embed code section (copy-paste snippet for their Shopify theme) - /admin/merchants/[id]/sessions — session log with variant, events, conversion flag API routes (Next.js App Router, all public — protected only by merchant_id validation): POST /api/cart/threshold - Body: { merchant_id: uuid, cart_total: number, session_id: string } - Logic: 1. Load merchant config from merchants table 2. Check if session_id already has a variant assigned in cart_sessions. If yes, return the same variant (sticky assignment). 3. If new session: select variant using epsilon-greedy (ε=0.1). Insert cart_sessions row with variant_id. 4. Load variant copy_text from cart_variants. If null (new variant never generated): call DeepSeek V4 Flash to generate it. 5. Calculate gap_to_threshold = merchant.free_shipping_threshold - cart_total 6. Return { variant_id, copy_text, gap_to_threshold, threshold_type } DeepSeek V4 Flash threshold copy generation: - System: 'You are a Shopify cart drawer copywriter. Generate one short (under 20 words), {tone_style}-toned free-shipping threshold message. Be specific — mention the exact dollar amount needed. Return only the copy text, no quotes.' - User: 'Cart total: ${cart_total}. Threshold: ${free_shipping_threshold}. Gap: ${gap}. Brand: {merchant_name}. Active promo: {gift_description or discount_copy if applicable}.' - Store result in cart_variants.copy_text POST /api/cart/exit-intent - Body: { merchant_id: uuid, session_id: string, top_item_title: string, cart_total: number } - Call Claude Haiku 4.5: 'Write one 15-word-max exit-intent message for a buyer leaving with {top_item_title} in their cart worth ${cart_total}. Tone: {tone_style}. Reference the item name. Return only the message.' - Return { message } POST /api/cart/event - Body: { merchant_id: uuid, session_id: string, variant_id: uuid, event_type: 'cart_open'|'add_to_cart'|'checkout_start' } - Append event to cart_sessions.events jsonb array - If event_type = 'checkout_start': increment cart_variants.conversion_events +1 - Always increment cart_variants.total_sessions on 'cart_open' Nightly Edge Function (update-variant-weights): - For each merchant: compute conversion_rate = conversion_events / total_sessions for each variant - Update weights: softmax over conversion_rates. If one variant has rate > others by >15% for >500 sessions: mark as winner. - Upsert cart_variants.weight Styling: Tailwind CSS. Agency admin: clean dark sidebar, data tables with recharts mini sparklines for conversion rates. Brand-agnostic — the agency's logo and brand_color from agencies table populate the admin header. Environment variables: NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, SUPABASE_SERVICE_ROLE_KEY, DEEPSEEK_API_KEY, ANTHROPIC_API_KEY.

Paste this into Lovable

Follow-up prompts (run in order)

  1. 1

    Build the Shopify Theme App Extension (separate project from Lovable — use Shopify CLI: 'shopify app generate extension --type ui_extension'). The extension renders a cart drawer as an App Block that replaces the default Shopify cart. It should: (1) listen for window Shopify cart:open event, (2) POST to your Next.js API for threshold copy and variant assignment, (3) render a progress bar with the AI-generated copy, (4) detect exit intent (mouseleave on desktop, scroll velocity on mobile), and (5) show the Haiku-generated recovery message in an overlay. Use vanilla JS and inline CSS only — no framework in the Extension.

  2. 2

    Add bundle discount suggestion: when a buyer's cart contains 2+ items from the same collection, call Claude Haiku 4.5 to suggest a 3-item bundle discount ('Add one more [collection name] item for 15% off your entire cart'). Add a bundle_discount_threshold field to the merchants config and a new /api/cart/bundle-suggest endpoint. Render the suggestion as a separate row in the cart drawer below the threshold bar.

  3. 3

    Add a 'copy performance analytics' page to the agency admin at /admin/analytics: recharts bar chart showing conversion rate by variant copy text across all merchants, sorted by performance. Add a 'Copy Insights' panel where Claude Haiku 4.5 summarizes which copy themes are winning ('Urgency-framed copy converts 23% better than gift-reference copy on average across your portfolio'). Run the summary weekly via a Trigger.dev job.

  4. 4

    Add Shopify webhook integration: install webhooks for carts/create and checkouts/create events on each merchant's store. Update cart_sessions in real-time when a Shopify checkout is created (more reliable than the Extension's POST /api/cart/event). This gives you server-side conversion tracking that works even when the buyer's browser blocks the client-side event POST. Handle webhook HMAC verification in the Route Handler.

Expected output

A working white-label smart cart backend: agency admin manages multiple merchant configs, the threshold copy API returns AI-generated variant text to the Shopify Extension, exit-intent messages are generated on demand, and conversion events feed the bandit weight updater — ready to connect to a Shopify Theme App Extension.

Known gotchas

  • !Shopify Theme App Extensions require Shopify CLI to develop and deploy — they cannot be scaffolded from Lovable. The Extension is a separate project from the Next.js backend; plan 3–4 hours to configure Shopify CLI, create the Extension, and deploy it to the Shopify Partner dashboard before merchants can install it.
  • !The epsilon-greedy bandit requires session stickiness: once a visitor is assigned to variant A, they must see variant A on every subsequent cart open in that session. Use a first-party cookie (not localStorage) to persist the assignment — localStorage is cleared between sessions and inconsistent across incognito windows.
  • !DeepSeek V4 Flash's threshold copy will occasionally generate copy that violates Shopify's advertising standards (guaranteed 'free' claims, pricing claims without the threshold being active) — implement a simple keyword filter on the generated copy that flags phrases like 'guaranteed', 'always free', and 'unlimited' for manual review before the variant is activated.
  • !FTC dynamic-pricing disclosure requirements mean any 'limited time' or 'today only' copy generated by the AI must actually be time-limited. Don't generate urgency copy without a genuine time constraint; false urgency claims in cart UI copy are a potential FTC violation.
  • !Shopify rate limits the Admin API to 2 calls/second for standard plans — the Extension should read cart state from window.Shopify.cart (client-side, no API call) rather than calling the Admin API on every cart update.
  • !Exit-intent detection on iOS Safari is unreliable — the popstate event doesn't fire consistently on back-button press. Use a combination of visibilitychange (fires when the tab is backgrounded) and beforeunload (fires on tab close, but not navigation) for a more reliable mobile exit signal.

Compliance & risk reality check

A cart drawer with AI-generated promotional copy operates in a regulated space: FTC rules on pricing and promotional claims apply to every copy variant the AI generates, and GDPR/CCPA consent requirements apply to the session tracking that powers the multi-armed bandit.

Good to know

FTC dynamic-pricing disclosure on AI-generated threshold copy

FTC's 2024 updated guidelines on unfair or deceptive pricing practices apply to AI-generated promotional copy in cart interfaces. Threshold copy that implies a discount or promotional price ('Add $8.40 to get 20% off') must reflect an actual discount from a genuine regular price. AI-generated urgency copy ('Today only!') must correspond to a real time-limited promotion. The FTC has specifically called out AI-generated marketing copy as an area of increased scrutiny in their 2025 AI enforcement guidance.

Mitigation: Implement a prompt constraint in the DeepSeek V4 Flash system prompt that prohibits time-limited urgency claims unless the merchant has configured an active promotion with an end date. Add a copy review step in the agency admin before a variant is activated for the first time — human review catches pricing claims that the AI generates incorrectly.

Important

GDPR/CCPA consent for cart-behavior session tracking

The multi-armed bandit requires storing a session identifier (cookie or server-side session ID) to assign and track variant performance. Under GDPR ePrivacy Directive, a cookie used for cart personalization purposes requires user consent in the EU unless it's strictly necessary for a service the user explicitly requested. The FTC and CCPA treat session-level behavioral tracking for marketing optimization as requiring opt-in consent for California users.

Mitigation: Integrate with the merchant's existing Consent Management Platform (CMP) — Shopify Consent API, Cookiebot, OneTrust — to check consent status before writing the variant-assignment cookie. If consent is not granted, fall back to the default (non-personalized) threshold copy and exclude the session from bandit tracking. Document this in the platform's GDPR-compliant data processing disclosure.

Critical

PCI-DSS scope avoidance via Shopify Checkout tokens

The cart drawer JavaScript runs in the context of a Shopify storefront and may be in proximity to checkout flows. Any modification to the checkout page or cart data that touches payment card information would place the platform in PCI DSS scope. The Extension must never read, store, or transmit payment card data or checkout tokens that include payment information.

Mitigation: Keep the Extension strictly in the cart phase (pre-checkout) and never inject JavaScript into the Shopify Checkout page itself. Shopify's Checkout Extensions policy prohibits third-party JavaScript on the checkout page without explicit Shopify Plus approval. The Extension's API calls must only include cart totals and product IDs — never customer payment data or checkout tokens.

Build vs buy: the real math

4–7 weeks

Custom build time

$13,000–$25,000

One-time investment

3–5 months

Breakeven vs buying

The buy path doesn't exist at the white-label level — every cart drawer tool (UpCart, AfterSell, iCart) requires per-merchant subscriptions with no reseller tier. An agency serving 20 merchants at $19.99–$99.99/mo pays $400–$2,000/mo with zero margin and zero brand ownership. At $49/mo per merchant (20 merchants), the custom build generates $980/mo in recurring revenue against $125/mo infra + $35/mo AI = $820/mo gross margin (83%). The $13K–$25K build cost breaks even in 16–30 months on $820/mo margin. The Lovable self-build ($25 + $50/mo infra + AI) reaches the same $820/mo margin almost immediately — the payback period is 3–5 months on the first 5 paying merchant clients. Unlike most SaaS builds, this one is low-maintenance after launch: DeepSeek copy generation is stateless, the bandit weights update automatically, and Shopify Extension compatibility only needs quarterly review.

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 Smart Shopping Cart Platform 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

4–7 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

4–7 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 smart shopping cart platform?

A RapidDev custom build runs $13,000–$25,000 for the full platform including Shopify Theme App Extension, multi-merchant admin dashboard, DeepSeek V4 Flash threshold copy API, Claude Haiku 4.5 exit-intent messages, and multi-armed bandit testing. The Lovable self-build path costs $25 (Lovable Pro) plus ~$10 in API credits for the backend — the Shopify Extension requires a separate Shopify CLI project that adds 3–4 hours. Ongoing infra + AI costs run $35–$60/mo at 20 merchants.

How long does it take to ship a smart cart platform?

The Lovable backend (API + admin dashboard) takes a weekend. The Shopify Theme App Extension is a separate 3–4 hour configuration project using Shopify CLI. A RapidDev custom build takes 4–7 weeks including the Extension, multi-merchant admin, bandit testing framework, and Stripe billing integration. The longest single task is Shopify Extension compatibility testing across common themes (Dawn, Prestige, Impulse, Focal) — budget 1 full week for this.

Can RapidDev build this for my CRO agency?

Yes — RapidDev has shipped 600+ applications including Shopify-integrated tools and AI copy generation pipelines. Start with a free 30-minute consultation at rapidevelopers.com to scope your merchant count, Shopify Plus requirements, and white-label branding needs.

What's the difference between this and the AI Cross-Sell & Upsell Tool?

The cross-sell tool handles the offer engine — which products to recommend for upselling based on cart contents and purchase history. The smart cart handles the UI layer — how the threshold bar looks, what the threshold copy says, when the exit-intent overlay appears, and how the multi-armed bandit optimizes copy variants. Many agencies bundle both as a combined 'cart optimization suite' that handles both offer selection and copy optimization.

How does the multi-armed bandit actually improve conversion?

The bandit starts with 3 copy variants (e.g., 'Add $8.40 for free shipping', 'You're $8.40 away from a free shipping unlock', 'Almost there! $8.40 more ships it free'). Over the first 2–3 weeks, it assigns 10% of sessions randomly to explore all variants and 90% to the current best performer. After 200–500 sessions per variant, the winning copy typically emerges with a statistically significant conversion rate advantage (commonly 5–20% higher add-to-cart rate for winning vs. losing copy). The winner is then locked until the merchant refreshes the test with new variants.

Does the smart cart work with all Shopify themes?

Shopify Theme App Extensions are compatible with all Online Store 2.0 themes (Dawn, Prestige, Impulse, Focal, and most paid themes from 2022+). Older 'vintage' themes (pre-2022) don't support App Blocks and require manual Liquid code injection — budget an extra 2–4 hours per merchant on a vintage theme. Test explicitly against each merchant's active theme before deploying to production.

How do I handle exit-intent detection on mobile?

Mobile browsers don't have a reliable 'cursor leaving viewport' event equivalent. Two patterns work: (1) visibilitychange event — fires when the user switches apps or backgrounds the tab, capturing the moment they're about to leave; (2) Scroll velocity detection — rapid upward scroll often precedes a back-navigation gesture. Implement both and show the exit-intent overlay on whichever fires first, with a 500ms debounce to prevent double-firing. Test on iOS Safari (the most restrictive mobile browser) and Android Chrome specifically — they handle these events differently.

RapidDev

Want the production version?

  • Delivered in 4–7 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.