Frequently Asked Question
Complete Guide: Setting Up Stripe Account and Getting API Keys
Last Updated 11 months ago
Step 1: Create Your Stripe Account
- Visit Stripe's website
- Go to stripe.com
- Click "Start now" or "Sign up"
- Fill out the registration form
- Enter your email address
- Create a strong password
- Provide your full name
- Select your country
- Verify your email
- Check your email inbox for a verification message from Stripe
- Click the verification link to confirm your account
- Complete your business information
- Business type (individual, company, non-profit, etc.)
- Business details (name, address, phone number)
- Tax ID or Social Security Number
- Bank account information for payouts
Step 2: Get Your Publishable Key and Secret Key
Retrieving Your Keys
- Log into your Stripe Dashboard
- Go to dashboard.stripe.com
- Sign in with your credentials
- Navigate to API Keys
- In the left sidebar, click "Developers"
- Select "API keys"
- Find Your Keys
- Publishable key: Starts with
pk_test_(test mode) orpk_live_(live mode) - Secret key: Starts with
sk_test_(test mode) orsk_live_(live mode) - Click "Reveal test key" or "Reveal live key" to view the secret key
- Publishable key: Starts with
- Copy and Store Safely
- Copy both keys to a secure location
- Never commit secret keys to version control
- Use environment variables in your applications
Step 3: Set Up Webhook Secret
What are Webhooks?
Webhooks allow Stripe to notify your application when events occur in your account (payments, refunds, etc.).
Creating a Webhook Endpoint
- Go to Webhooks Section
- In the Stripe Dashboard, click "Developers"
- Select "Webhooks"
- Add New Endpoint
- Click "Add endpoint"
- Enter your endpoint URL (e.g.,
https://yourdomain.com/stripe/webhook) - Select the events you want to listen for (or select "Send all events")
- Configure the Webhook
- Choose your API version
- Add a description (optional)
- Click "Add endpoint"
Getting Your Webhook Secret
- Access the Webhook
- Click on the webhook you just created from the webhooks list
- Find the Signing Secret
- In the webhook details page, look for "Signing secret"
- Click "Reveal" to show the webhook secret
- It will start with
whsec_
- Copy the Secret
- Copy this secret key
- Store it securely with your other API keys
Step 4: Test Mode vs Live Mode
Test Mode (Development)
- Use test keys that start with
pk_test_andsk_test_ - No real money is processed
- Use test card numbers for testing
Live Mode (Production)
- Use live keys that start with
pk_live_andsk_live_ - Real money transactions occur
- Requires completed account verification
Step 5: Testing Your Setup
Test Cards for Development
- Successful payment: 4242 4242 4242 4242
- Declined payment: 4000 0000 0000 0002
- Requires authentication: 4000 0027 6000 3184
Webhook Testing
- Use Stripe CLI for local webhook testing
- Check webhook logs in the Stripe Dashboard
- Verify signature validation in your code
Common Issues and Solutions
Issue: Can't find API keys
- Solution: Make sure you're in the correct mode (test/live) and have the proper permissions
Issue: Webhook not receiving events
- Solution: Check your endpoint URL, ensure it's publicly accessible, and verify the selected events
Issue: Authentication errors
- Solution: Verify you're using the correct secret key and it matches your environment
Next Steps
After obtaining your keys:
- Log in to your admin dashboard
- Click on "Payment Gateways"
- Select "Stripe"
- Enter the details and save changes