Skip to main content

Lemon Squeezy Setup Status

✅ Completed Steps

1. Environment Setup

  • API Key: Configured (eyJ0eXAiOiJKV1QiLCJhbGc...)
  • Download Secret: Generated (6b74fc98991add5fd043f1d2964a165f...)
  • API Server: Running on port 4001
  • Health Check: http://localhost:4001/health ✓

2. Code Integration

  • Webhook Handler: server/lemonsqueezy/webhook.js
  • License Provider: src/pro/licensing/LemonSqueezyProvider.js
  • Email Templates: HTML + plain text ready
  • Pro Package Build: npm run build-pro
  • Customer Portal: Live at /customer-portal
  • Download System: Secure package downloads

⏳ Next Steps Required

1. Get Store ID (2 minutes)

Where: Lemon Squeezy → Settings → API → Top of page Action: Copy the numeric Store ID (e.g., 12345) Update: Replace YOUR_STORE_ID_HERE in .env

2. Create Product (5 minutes)

Where: Lemon Squeezy → Products → + New Product Required Settings:

  • Name: PhotoFlow SEO - Site License
  • Price: $99.00 USD
  • Billing: Annual subscription
  • License Keys: ✅ ENABLED
    • Format: Custom
    • Prefix: pswp_prod_
    • Length: 32
    • Activation limit: Unlimited

Get Product ID: Copy from URL https://app.lemonsqueezy.com/products/[PRODUCT_ID]

3. Set Up Webhook (3 minutes)

Where: Lemon Squeezy → Settings → Webhooks → + Add endpoint Settings:

  • URL: http://localhost:4001/api/webhooks/lemonsqueezy (for testing)
  • Events: order_created, subscription_created, license_key_created
  • Generate Secret: Copy the webhook secret

For Production: Update URL to https://photoflowseo.com/api/webhooks/lemonsqueezy

4. Test Purchase (5 minutes)

Steps:

  1. Enable Test Mode in Lemon Squeezy
  2. Make test purchase with card: 4242 4242 4242 4242
  3. Check API server console for webhook
  4. Verify license key generation

🔧 Current Configuration

Environment Variables Set:

LEMON_SQUEEZY_API_KEY=eyJ... ✅
LEMON_SQUEEZY_STORE_ID=YOUR_STORE_ID_HERE ⏳
LEMON_SQUEEZY_PRODUCT_ID=YOUR_PRODUCT_ID_HERE ⏳
LEMON_SQUEEZY_WEBHOOK_SECRET=YOUR_WEBHOOK_SECRET_HERE ⏳
DOWNLOAD_SECRET=6b74fc98991add5fd043f1d2964a165f... ✅

API Endpoints Ready:

  • GET /health - Server health check
  • POST /api/webhooks/lemonsqueezy - Webhook handler
  • GET /api/license/health - License service health
  • POST /api/license/activate - License activation
  • POST /api/license/validate - License validation
  • GET /api/download/latest - Get latest package info
  • GET /api/download/download/:version - Secure download

🧪 Testing Commands

Test API Server:

# Check health
curl http://localhost:4001/health

# Test license health
curl http://localhost:4001/api/license/health

# Test download info
curl http://localhost:4001/api/download/latest

Test Webhook (after setting up):

# Simulate webhook
curl -X POST http://localhost:4001/api/webhooks/lemonsqueezy \
-H 'Content-Type: application/json' \
-H 'X-Signature: test' \
-d '{"meta":{"event_name":"order_created"},"data":{}}'

📊 Ready for Production

Once you complete the 4 steps above:

  1. Accept Payments: Lemon Squeezy checkout
  2. Deliver Licenses: Automated email with license key
  3. Package Downloads: Secure .tgz file delivery
  4. License Validation: Real-time activation/validation
  5. Customer Portal: Self-service license management

Estimated time to go live: 15-20 minutes


🆘 Need Help?

Quick Reference:

  • Store ID: Settings → API → Top of page
  • Product ID: Products → [Your Product] → Copy from URL
  • Webhook Secret: Settings → Webhooks → Generate secret
  • Test Mode: Toggle in top-right corner of Lemon Squeezy

Guides:

  • Quick Setup: docs/QUICK-START-LEMON-SQUEEZY.md
  • DNS Issues: docs/DNS-SETUP-FOR-LEMON-SQUEEZY.md
  • Full Setup: docs/LEMON-SQUEEZY-SETUP.md