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)
- Go to: https://lemonsqueezy.com
- Click "Get Started"
- Sign up with email
- Verify email
- Complete onboarding
Step 2: Create Product (5 mins)
In Lemon Squeezy Dashboard:
Click "Products" → "+ New Product"
Fill in:
Name:
PhotoFlow SEO - Site LicensePrice:
99.00USDBilling: 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
CRITICAL: Scroll to "License Keys" section
- Toggle ON
- Format: Custom
- Prefix:
pswp_prod_ - Length: 32
- Activation limit: Unlimited
Click "Save Product"
Copy Product ID from URL:
https://app.lemonsqueezy.com/products/[THIS_NUMBER]
Step 3: Get API Credentials (3 mins)
API Key:
- Click Settings (gear icon)
- Click "API" tab
- Click "+ Create API Key"
- Name:
PhotoSwipe Pro API - Permissions: Check all
- Click "Create"
- COPY AND SAVE THE KEY (starts with
eyJ...)
Store ID:
- Still in Settings → API
- Look at top for "Store ID"
- Copy the number (e.g.,
12345)
Step 4: Set Up Webhook (3 mins)
- Settings → "Webhooks" tab
- Click "+ Add endpoint"
- Fill in:
- URL: For now, use:
https://webhook.site(get a temporary URL) - Later change to:
https://photoflowseo.com/api/webhooks/lemonsqueezy
- URL: For now, use:
- Click "Generate" for secret
- COPY THE SECRET (starts with
whsec_...) - Select events:
- ✅
order_created - ✅
subscription_created - ✅
subscription_updated - ✅
subscription_cancelled - ✅
license_key_created
- ✅
- 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:
- Go to: https://resend.com
- Sign up with email
- Click "Domains" → "+ Add Domain"
- Enter:
photoflowseo.com - Add the DNS records shown to your domain (in your DNS provider)
- Wait for verification (usually instant)
- Click "API Keys" → "Create API Key"
- Copy the key (starts with
re_...) - Add to
.envasRESEND_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:
- In Lemon Squeezy, toggle "Test Mode" (top right - orange banner)
- Go to your product
- Click "Get checkout link"
- Copy the link
- Open in incognito/private window
- Purchase with test card:
- Card:
4242 4242 4242 4242 - Expiry:
12/25 - CVC:
123 - Email:
test@example.com
- Card:
Check Webhook:
- Check your API server console
- 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:
- Deploy your API server (Vercel, Railway, etc.)
- Update webhook URL to:
https://photoflowseo.com/api/webhooks/lemonsqueezy
✅ You're Done!
Test the full flow:
- Make test purchase
- Receive email with license key
- Click download link
- Install package
- 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
- Review full setup guide:
docs/LEMON-SQUEEZY-SETUP.md - Test customer portal: http://localhost:3001/customer-portal
- Deploy to production
- Configure real domain email
- Go live! 🚀