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
- Go to Stripe Dashboard → API keys
- 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")
- You'll see two keys listed. Click the copy icon next to each one:
| You'll see | Save 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.
- Go to Stripe Dashboard → Webhooks
- Click Add destination
- Select the events you want to listen to. Use the search field to find each event by name:
checkout.session.completedcustomer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_succeededinvoice.payment_failed
- Click Continue
- Choose Webhook endpoint as the destination type, then click Continue
- 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 - Click Create destination
- Copy the Signing secret (starts with
whsec_) — save it asSTRIPE_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?