- Hero mockup: enhanced 3D perspective and shadow - Testimonials: illustrated SVG avatars - Growth pricing card: visual prominence (scale, gradient, badge) - Most Popular badge: repositioned to avoid overlapping heading - Nav: added Log In link next to Start Free Trial - Fixed btn-primary text colour on anchor tags (white on blue) - Fixed cursor: default on all non-interactive elements - Disabled user-select on non-form content to prevent text caret
7.9 KiB
Stripe Price Setup Guide
This guide walks you through creating the three Stripe Price objects for TenderRadar's subscription plans.
Overview
You need to create 3 recurring prices in your Stripe Dashboard:
- Starter: £39/month
- Growth: £99/month
- Pro: £249/month
Each price will generate a unique Price ID that must be added to your .env file.
Step-by-Step Instructions
1. Log in to Stripe Dashboard
Visit https://dashboard.stripe.com and sign in with your Stripe account.
Note: Use Test Mode during development (toggle in top-right corner).
Switch to Live Mode when ready for production.
2. Navigate to Products
In the left sidebar, click:
- More+ → Product Catalogue → Products
OR - Directly visit: https://dashboard.stripe.com/products
3. Create Starter Plan (£39/month)
- Click + Add product (blue button, top-right)
- Fill in the form:
- Name:
TenderRadar Starter - Description (optional):
Starter tier with basic features - Pricing model:
Standard pricing - Price:
39.00 - Currency:
GBP (£) - Billing period:
Monthly - Usage is metered: Leave unchecked
- Name:
- Click Save product
- On the product page, you'll see a Pricing section with your new price
- Click on the price row to expand details
- Copy the Price ID (starts with
price_...) — Example:price_1AbCdEfGhIjKlMnO - Save this Price ID for the next step
4. Create Growth Plan (£99/month)
Repeat the process:
- Click + Add product
- Fill in:
- Name:
TenderRadar Growth - Description (optional):
Growth tier with advanced features - Price:
99.00 - Currency:
GBP (£) - Billing period:
Monthly
- Name:
- Click Save product
- Copy the Price ID from the new price
5. Create Pro Plan (£249/month)
Repeat again:
- Click + Add product
- Fill in:
- Name:
TenderRadar Pro - Description (optional):
Pro tier with unlimited features - Price:
249.00 - Currency:
GBP (£) - Billing period:
Monthly
- Name:
- Click Save product
- Copy the Price ID
6. Update Your .env File
Open /home/peter/tenderpilot/.env and replace the placeholder Price IDs:
# Before:
STRIPE_PRICE_STARTER=price_starter_placeholder
STRIPE_PRICE_GROWTH=price_growth_placeholder
STRIPE_PRICE_PRO=price_pro_placeholder
# After (example):
STRIPE_PRICE_STARTER=price_1AbCdEfGhIjKlMnO
STRIPE_PRICE_GROWTH=price_1PqRsTuVwXyZaBcD
STRIPE_PRICE_PRO=price_1EfGhIjKlMnOpQrS
Important: Use the actual Price IDs from your Stripe Dashboard.
7. Get Your API Keys
Still in Stripe Dashboard:
- Click Developers (left sidebar)
- Click API keys (under Developers)
- You'll see two keys:
- Publishable key (starts with
pk_test_...in test mode) - Secret key (starts with
sk_test_...in test mode, click Reveal test key)
- Publishable key (starts with
Copy both keys and update your .env:
STRIPE_SECRET_KEY=sk_test_YOUR_ACTUAL_SECRET_KEY
STRIPE_PUBLISHABLE_KEY=pk_test_YOUR_ACTUAL_PUBLISHABLE_KEY
Security Warning: Never commit the
.envfile to version control!
Keep your Secret Key private — it has full access to your Stripe account.
8. Set Up Webhook Endpoint
Webhooks allow Stripe to notify your server about subscription events (payments, cancellations, etc.).
Development (Localhost Testing)
Install Stripe CLI:
# Mac/Linux:
brew install stripe/stripe-cli/stripe
# Windows:
# Download from https://github.com/stripe/stripe-cli/releases
Forward webhooks to your local server:
stripe login
stripe listen --forward-to localhost:3456/api/billing/webhook
This outputs a webhook signing secret (starts with whsec_...). Copy it and update .env:
STRIPE_WEBHOOK_SECRET=whsec_YOUR_LOCAL_WEBHOOK_SECRET
Leave the CLI running while testing.
Production (Live Server)
- In Stripe Dashboard, go to Developers → Webhooks
- Click + Add endpoint
- Fill in:
- Endpoint URL:
https://your-domain.com/api/billing/webhook - Description (optional):
TenderRadar production webhook - Events to send: Select these 4 events:
checkout.session.completedcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_failed
- OR select Receive all events (simpler but more traffic)
- Endpoint URL:
- Click Add endpoint
- On the webhook details page, click Signing secret → Reveal
- Copy the signing secret (starts with
whsec_...) - Update production
.env:STRIPE_WEBHOOK_SECRET=whsec_YOUR_PRODUCTION_WEBHOOK_SECRET
9. Restart Your Server
After updating .env:
cd /home/peter/tenderpilot
pm2 restart all # If using PM2
# OR
pkill -f 'node.*server.js'
npm start &
10. Test the Integration
Register a Test User
curl -X POST http://localhost:3456/api/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"password": "testpass123",
"company_name": "Test Company"
}'
Save the returned token.
Create a Checkout Session
curl -X POST http://localhost:3456/api/billing/checkout \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"plan": "starter",
"successUrl": "http://localhost:3000/success",
"cancelUrl": "http://localhost:3000/cancel"
}'
This returns a url — open it in your browser to test the payment flow.
Use Stripe Test Cards
In Test Mode, use these card numbers:
- Success:
4242 4242 4242 4242 - Decline:
4000 0000 0000 0002 - Requires 3D Secure:
4000 0025 0000 3155
Any future expiry date and any CVC will work.
Check Subscription Status
curl -X GET http://localhost:3456/api/billing/subscription \
-H "Authorization: Bearer YOUR_TOKEN_HERE"
Should return subscription details after successful checkout.
Common Issues
"Invalid plan: starter"
- Cause: Price ID not set in
.envor typo in plan name - Fix: Verify
STRIPE_PRICE_STARTERis set correctly and plan parameter is lowercase
"Webhook signature verification failed"
- Cause: Wrong
STRIPE_WEBHOOK_SECRET - Fix:
- For localhost: Ensure Stripe CLI is running (
stripe listen ...) - For production: Copy signing secret from webhook endpoint in Dashboard
- For localhost: Ensure Stripe CLI is running (
"No such customer"
- Cause: Customer ID doesn't exist in Stripe
- Fix: This is usually a database sync issue — check
subscriptionstable
Payment succeeds but no subscription in database
- Cause: Webhook not firing or webhook handler error
- Fix: Check Stripe Dashboard → Developers → Events for webhook delivery status
Pricing Summary
| Plan | Monthly Price | Annual Equivalent | Price ID Env Var |
|---|---|---|---|
| Starter | £39 | £468 | STRIPE_PRICE_STARTER |
| Growth | £99 | £1,188 | STRIPE_PRICE_GROWTH |
| Pro | £249 | £2,988 | STRIPE_PRICE_PRO |
All plans include a 14-day free trial (configured in code, not Stripe).
Next Steps
- ✅ Create the 3 Price objects in Stripe Dashboard
- ✅ Copy Price IDs to
.env - ✅ Get API keys and add to
.env - ✅ Set up webhook endpoint
- ✅ Restart server
- ✅ Test with Stripe test cards
- 🚀 Deploy to production with live keys
Resources
- Stripe Dashboard: https://dashboard.stripe.com
- Stripe API Docs: https://stripe.com/docs/api
- Test Cards: https://stripe.com/docs/testing
- Stripe CLI: https://stripe.com/docs/stripe-cli
- Webhooks Guide: https://stripe.com/docs/webhooks
Questions? Check the other documentation files:
STRIPE_SETUP.md— Complete integration overviewBILLING_API_EXAMPLES.md— API testing examplesSTRIPE_INTEGRATION_SUMMARY.md— High-level summary