Skip to main content

Lemon Squeezy Quick Start (Copy-Paste Guide)

Time to complete: 15-20 minutes


✅ Checklist

Follow these steps in order:

  • Step 1: Create Lemon Squeezy account
  • Step 2: Create product with license keys
  • Step 3: Get API credentials
  • Step 4: Set up webhook
  • Step 5: Configure environment variables
  • Step 6: Test with test purchase
  • Step 7: Verify email delivery
  • Step 8: Go live!

Step 1: Create Account (2 mins)

  1. Go to: https://lemonsqueezy.com
  2. Click "Get Started"
  3. Sign up with email
  4. Verify email
  5. Complete onboarding

Step 2: Create Product (5 mins)

In Lemon Squeezy Dashboard:

  1. Click "Products""+ New Product"

  2. Fill in:

    • Name: PhotoFlow SEO - Site License

    • Price: 99.00 USD

    • Billing: Annual subscription (recurring)

    • Description:

      AI-powered alt text, captions, and ImageObject schema for photo galleries.

      Includes:
      • Automatic SEO-optimized alt text
      • AI-generated captions
      • ImageObject schema for search engines
      • Priority email support
      • All updates while active
  3. CRITICAL: Scroll to "License Keys" section

    • Toggle ON
    • Format: Custom
    • Prefix: pswp_prod_
    • Length: 32
    • Activation limit: Unlimited
  4. Click "Save Product"

  5. Copy Product ID from URL:

    https://app.lemonsqueezy.com/products/[THIS_NUMBER]

Step 3: Get API Credentials (3 mins)

API Key:

  1. Click Settings (gear icon)
  2. Click "API" tab
  3. Click "+ Create API Key"
  4. Name: PhotoSwipe Pro API
  5. Permissions: Check all
  6. Click "Create"
  7. COPY AND SAVE THE KEY (starts with eyJ...)

Store ID:

  1. Still in Settings → API
  2. Look at top for "Store ID"
  3. Copy the number (e.g., 12345)

Step 4: Set Up Webhook (3 mins)

  1. Settings → "Webhooks" tab
  2. Click "+ Add endpoint"
  3. Fill in:
    • URL: For now, use: https://webhook.site (get a temporary URL)
    • Later change to: https://photoflowseo.com/api/webhooks/lemonsqueezy
  4. Click "Generate" for secret
  5. COPY THE SECRET (starts with whsec_...)
  6. Select events:
    • order_created
    • subscription_created
    • subscription_updated
    • subscription_cancelled
    • license_key_created
  7. Click "Create webhook"

Step 5: Configure Environment (5 mins)

Create .env file:

cd /Users/JJR/photo_swipe

# Generate download secret
openssl rand -hex 32
# Copy the output - you'll use it below

Create .env file with your values:

# PASTE YOUR ACTUAL VALUES HERE (from steps above)

LEMON_SQUEEZY_API_KEY=eyJ... # From Step 3
LEMON_SQUEEZY_STORE_ID=12345 # From Step 3
LEMON_SQUEEZY_PRODUCT_ID=67890 # From Step 2
LEMON_SQUEEZY_WEBHOOK_SECRET=whsec_... # From Step 4

# Email (set to resend after you configure it)
EMAIL_PROVIDER=resend
RESEND_API_KEY=re_... # Get from resend.com (see below)

# Download security (paste output from openssl command above)
DOWNLOAD_SECRET=[paste_64_char_hex_here]

# Site
SITE_URL=http://localhost:3001
ALLOWED_ORIGINS=http://localhost:3001

# AI (already have this)
OPENROUTER_API_KEY=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
AI_MODEL=openai/gpt-4o-mini

# Server
PORT=4001
NODE_ENV=development

Step 6: Set Up Email (Resend.com) (5 mins)

Why Resend?

  • Simple API
  • $20/month for 100k emails
  • Great deliverability
  • Easy domain verification

Quick Setup:

  1. Go to: https://resend.com
  2. Sign up with email
  3. Click "Domains""+ Add Domain"
  4. Enter: photoflowseo.com
  5. Add the DNS records shown to your domain (in your DNS provider)
  6. Wait for verification (usually instant)
  7. Click "API Keys""Create API Key"
  8. Copy the key (starts with re_...)
  9. Add to .env as RESEND_API_KEY

For Development (No Email Yet):

Leave EMAIL_PROVIDER empty or set to mock:

# EMAIL_PROVIDER=mock  # Will log emails to console instead

Step 7: Test Everything (5 mins)

Start the API server:

cd /Users/JJR/photo_swipe
PORT=4001 npm run api

You should see:

PhotoSwipe Pro API listening on port 4001
Health check: http://localhost:4001/health
Webhook: http://localhost:4001/api/webhooks/lemonsqueezy

Make a Test Purchase:

  1. In Lemon Squeezy, toggle "Test Mode" (top right - orange banner)
  2. Go to your product
  3. Click "Get checkout link"
  4. Copy the link
  5. Open in incognito/private window
  6. Purchase with test card:
    • Card: 4242 4242 4242 4242
    • Expiry: 12/25
    • CVC: 123
    • Email: test@example.com

Check Webhook:

  1. Check your API server console
  2. Should see:
    📨 Webhook received: order_created
    📧 [MOCK] License email would be sent to: test@example.com
    License Key: pswp_prod_test123...

If Using Resend:

Check test@example.com inbox for license email!


Step 8: Update Webhook URL (Production)

For Local Development with ngrok:

# Install ngrok
brew install ngrok

# Expose local server
ngrok http 4001

# Copy HTTPS URL (e.g., https://abc123.ngrok.io)
# Update webhook in Lemon Squeezy to:
# https://abc123.ngrok.io/api/webhooks/lemonsqueezy

For Production:

  1. Deploy your API server (Vercel, Railway, etc.)
  2. Update webhook URL to:
    https://photoflowseo.com/api/webhooks/lemonsqueezy

✅ You're Done!

Test the full flow:

  1. Make test purchase
  2. Receive email with license key
  3. Click download link
  4. Install package
  5. Use Pro features

Switch off Test Mode to accept real payments!


🆘 Having Issues?

Webhook not firing?

  • Check webhook logs in LS dashboard
  • Verify URL is accessible
  • Test with curl:
    curl https://your-domain.com/api/webhooks/lemonsqueezy

Email not sending?

  • Check Resend dashboard for delivery status
  • Verify domain is verified
  • Look in spam folder
  • Check server logs

Can't download package?

  • Run: npm run build-pro
  • Check: ls releases/
  • Should see: photoswipe-pro-5.4.4.tgz

📞 Next Steps

  1. Review full setup guide: docs/LEMON-SQUEEZY-SETUP.md
  2. Test customer portal: http://localhost:3001/customer-portal
  3. Deploy to production
  4. Configure real domain email
  5. Go live! 🚀