Frequently Asked Question

Complete Guide: Setting Up Stripe Account and Getting API Keys
Last Updated 11 months ago

Step 1: Create Your Stripe Account

  1. Visit Stripe's website
  2. Fill out the registration form
    • Enter your email address
    • Create a strong password
    • Provide your full name
    • Select your country
  3. Verify your email
    • Check your email inbox for a verification message from Stripe
    • Click the verification link to confirm your account
  4. 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

  1. Log into your Stripe Dashboard
  2. Navigate to API Keys
    • In the left sidebar, click "Developers"
    • Select "API keys"
  3. Find Your Keys
    • Publishable key: Starts with pk_test_ (test mode) or pk_live_ (live mode)
    • Secret key: Starts with sk_test_ (test mode) or sk_live_ (live mode)
    • Click "Reveal test key" or "Reveal live key" to view the secret key
  4. 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

  1. Go to Webhooks Section
    • In the Stripe Dashboard, click "Developers"
    • Select "Webhooks"
  2. 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")
  3. Configure the Webhook
    • Choose your API version
    • Add a description (optional)
    • Click "Add endpoint"

Getting Your Webhook Secret

  1. Access the Webhook
    • Click on the webhook you just created from the webhooks list
  2. 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_
  3. 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_ and sk_test_
  • No real money is processed
  • Use test card numbers for testing

Live Mode (Production)

  • Use live keys that start with pk_live_ and sk_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:

  1. Log in to your admin dashboard
  2. Click on "Payment Gateways"
  3. Select "Stripe"
  4. Enter the details and save changes

Please Wait!

Please wait... it will take a second!