Stripe Product Setup Guide
This guide walks you through setting up all products and prices in your Stripe Dashboard.
Prerequisites
- Stripe account (test mode for development)
- Access to Stripe Dashboard: https://dashboard.stripe.com
- Backend environment variables configured
Product 1: GovFit Platform Access
Create Product
- Navigate to Products → Add product
- Fill in details:
- Name: GovFit Platform Access
- Description: Annual subscription to the GovFit platform with 1 credit per month
- Statement descriptor: GOVFIT PLATFORM
- Unit label: Subscription
Create Price
- Click Add another price
- Configure pricing:
- Price: $12,000 USD
- Billing period: Yearly
- Billing interval: Monthly (billed as $1,000/month)
- Price lookup key:
govfit_platform_access - Usage type: Licensed (not metered)
Add Metadata
Click Add metadata under product settings:
Key: credits Value: 1
Key: frequency Value: monthly
Key: productType Value: govfit
Product 2: 1-Credit Pack
Create Product
- Name: 1-Credit Pack
- Description: Single credit for signal access
- Statement descriptor: 1-CREDIT PACK
Create Prices
One-Time Purchase
- Price: $650 USD
- Type: One-time
- Lookup key:
creditpack_1_onetime - Metadata:
credits: 1
frequency: onetime
productType: creditpack
rolloverLimit: 4
Monthly Subscription
- Price: $618 USD
- Billing period: Monthly
- Lookup key:
creditpack_1_monthly - Metadata:
credits: 1
frequency: monthly
productType: creditpack
rolloverLimit: 4
Product 3: 4-Credit Pack
Create Product
- Name: 4-Credit Pack
- Description: 4 credits with volume discount
- Statement descriptor: 4-CREDIT PACK
Create Prices
One-Time Purchase
- Price: $2,000 USD ($500/credit)
- Type: One-time
- Lookup key:
creditpack_4_onetime - Metadata:
credits: 4
frequency: onetime
productType: creditpack
rolloverLimit: 10
Monthly Subscription
- Price: $1,800 USD (10% discount)
- Billing period: Monthly
- Lookup key:
creditpack_4_monthly - Metadata:
credits: 4
frequency: monthly
productType: creditpack
rolloverLimit: 10
Product 4: 12-Credit Pack
Create Product
- Name: 12-Credit Pack
- Description: 12 credits with volume discount
- Statement descriptor: 12-CREDIT PACK
Create Prices
One-Time Purchase
- Price: $5,000 USD ($416/credit)
- Type: One-time
- Lookup key:
creditpack_12_onetime - Metadata:
credits: 12
frequency: onetime
productType: creditpack
rolloverLimit: 30
Monthly Subscription
- Price: $4,250 USD (15% discount)
- Billing period: Monthly
- Lookup key:
creditpack_12_monthly - Metadata:
credits: 12
frequency: monthly
productType: creditpack
rolloverLimit: 30
Product 5: 28-Credit Pack
Create Product
- Name: 28-Credit Pack
- Description: 28 credits with maximum volume discount
- Statement descriptor: 28-CREDIT PACK
Create Prices
One-Time Purchase
- Price: $10,000 USD ($357/credit)
- Type: One-time
- Lookup key:
creditpack_28_onetime - Metadata:
credits: 28
frequency: onetime
productType: creditpack
rolloverLimit: 50
Monthly Subscription
- Price: $8,000 USD (20% discount)
- Billing period: Monthly
- Lookup key:
creditpack_28_monthly - Metadata:
credits: 28
frequency: monthly
productType: creditpack
rolloverLimit: 50
Webhook Configuration
1. Create Webhook Endpoint
Navigate to Developers → Webhooks → Add endpoint
2. Enter Endpoint URL
Test Mode (Development):
https://api-dev.civstart.ventures/stripe/webhook
Test Mode (Staging):
https://api-staging.civstart.ventures/stripe/webhook
Live Mode (Production):
https://api.civstart.ventures/stripe/webhook
3. Select Events to Listen To
Select the following events:
-
checkout.session.completed -
customer.subscription.created -
customer.subscription.updated -
customer.subscription.deleted -
invoice.paid -
invoice.payment_failed
4. Copy Signing Secret
After creating the webhook, copy the Signing secret (starts with whsec_...) and add it to your environment variables:
STRIPE_WEBHOOK_SECRET=whsec_...
Testing in Test Mode
Test Card Numbers
Stripe provides test cards for different scenarios:
Successful Payment:
Card: 4242 4242 4242 4242
Expiry: Any future date (e.g., 12/34)
CVC: Any 3 digits
ZIP: Any 5 digits
Payment Requires Authentication (3D Secure):
Card: 4000 0027 6000 3184
Payment Declined:
Card: 4000 0000 0000 0002
Insufficient Funds:
Card: 4000 0000 0000 9995
Testing Webhook Events
- Go to Developers → Webhooks → Select your webhook
- Click Send test webhook
- Choose event type and send
Simulating Subscription Scenarios
Cancel Subscription:
# In Stripe CLI or Dashboard
stripe subscriptions cancel sub_xxx
Simulate Invoice Payment:
stripe invoices pay in_xxx
Switching to Live Mode
When ready for production:
1. Activate Your Account
- Complete Stripe account activation
- Submit business information
- Verify bank account
2. Create Products in Live Mode
- Toggle to Live mode in Stripe Dashboard
- Recreate all products and prices (same structure as test mode)
- Important: Lookup keys must match exactly
3. Update Environment Variables
Replace test keys with live keys:
STRIPE_SECRET_KEY=sk_live_...
STRIPE_PUBLISHABLE_KEY=pk_live_...
STRIPE_WEBHOOK_SECRET=whsec_... # From live mode webhook
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live_...
4. Create Live Webhook
- Create webhook endpoint in live mode
- Use production URL:
https://api.civstart.ventures/stripe/webhook - Select same events as test mode
- Copy new signing secret
5. Test Live Integration
- Use a real card with a small amount
- Verify webhook events are received
- Check subscription is created in database
- Verify credits are allocated correctly
Product Summary Table
| Product | One-Time | Monthly | Credits | Rollover Limit |
|---|---|---|---|---|
| GovFit Platform | - | $1,000/mo ($12k/yr) | 1 | - |
| 1-Credit Pack | $650 | $618 | 1 | 4 |
| 4-Credit Pack | $2,000 | $1,800 | 4 | 10 |
| 12-Credit Pack | $5,000 | $4,250 | 12 | 30 |
| 28-Credit Pack | $10,000 | $8,000 | 28 | 50 |
Price Lookup Keys Reference
Copy these exact strings when creating prices:
govfit_platform_access
creditpack_1_onetime
creditpack_1_monthly
creditpack_4_onetime
creditpack_4_monthly
creditpack_12_onetime
creditpack_12_monthly
creditpack_28_onetime
creditpack_28_monthly
Troubleshooting
Products Not Showing in Checkout
- Verify lookup keys match exactly (case-sensitive)
- Check that prices are active (not archived)
- Ensure you're in the correct mode (test/live)
Metadata Not Saving
- Add metadata at the Price level, not just the Product
- Verify metadata keys and values have no trailing spaces
- Refresh the page and check again
Webhook Not Receiving Events
- Check endpoint URL is correct and accessible
- Verify webhook secret is correctly configured
- Check that selected events include required ones
- Look for failed deliveries in webhook logs
API Testing with Postman/Curl
Create Checkout Session
curl -X POST https://api-dev.civstart.ventures/stripe/create-checkout-session \
-H "Authorization: Bearer YOUR_CLERK_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"priceId": "price_xxx",
"successUrl": "https://app.civstart.ventures/success",
"cancelUrl": "https://app.civstart.ventures/cancel"
}'
Get Subscriptions
curl https://api-dev.civstart.ventures/stripe/subscriptions \
-H "Authorization: Bearer YOUR_CLERK_TOKEN"
Get Billing History
curl https://api-dev.civstart.ventures/stripe/billing-history?limit=10 \
-H "Authorization: Bearer YOUR_CLERK_TOKEN"
Support Resources
- Stripe Documentation: https://stripe.com/docs
- Stripe Dashboard: https://dashboard.stripe.com
- Stripe Support: https://support.stripe.com
- Test Mode Guide: https://stripe.com/docs/testing
Last Updated: December 2, 2024