Step 2 of 4

Set Up Payments

Connect Stripe so your store can accept credit card payments securely.

You'll need a Stripe account and your store URL (from Step 3, or add it later) · Estimated time: 5–10 min

1. Get Your Stripe Keys

  1. Go to Stripe Dashboard → API keys
  2. Make sure you're in Live mode — look for the toggle switch in the top-right corner of the page. It should say "Live" (not "Test")
  3. You'll see two keys listed. Click the copy icon next to each one:
You'll seeSave it as
Publishable key (starts with pk_live_)NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
Secret key (starts with sk_live_)STRIPE_SECRET_KEY

Test mode vs Live mode: Keys starting with pk_test_ are for testing only — no real money is charged. Switch to Live mode when you're ready to accept real payments.

2. Set Up Webhooks

Webhooks are automatic notifications — when a customer pays, Stripe sends a message to your store so it can create the order automatically. You just need to tell Stripe where to send these messages.

  1. Go to Stripe Dashboard → Webhooks
  2. Click Add destination
  3. Select the events you want to listen to. Use the search field to find each event by name:
    • checkout.session.completed
    • customer.subscription.created
    • customer.subscription.updated
    • customer.subscription.deleted
    • invoice.payment_succeeded
    • invoice.payment_failed
  4. Click Continue
  5. Choose Webhook endpoint as the destination type, then click Continue
  6. Fill in the destination details:
    • Destination name: You can keep the auto-generated name or choose your own
    • Endpoint URL: Your store URL followed by /api/stripe/webhook
    https://yourstore.com/api/stripe/webhook
  7. Click Create destination
  8. Copy the Signing secret (starts with whsec_) — save it as STRIPE_WEBHOOK_SECRET

Tip: If you don't have your domain yet, come back to this step after deploying on Vercel. You'll use the Vercel URL instead (e.g. your-project.vercel.app/api/stripe/webhook).

Checklist

  • Publishable key copied
  • Secret key copied
  • Webhook endpoint created
  • Webhook signing secret copied

Was this step clear?