SaasCore Docs
  • Get Started
  • Configuration
    • Database
    • Stripe
      • Product ID and Price ID
      • API keys
      • Stripe Webhook
    • Emails
      • Cron Jobs
    • Claudinary
    • Chat plugin
    • Upstash Redis
    • OAuth with Google and GitHub
    • Subscription types and plans
    • Affiliate program
    • Google Analytics Api
  • Landing page
    • Header
    • Hero
      • Discount
      • AvatarCircles
    • Other components
  • Authentication Flow
    • For Admins
    • For Clients
      • OAuth
      • Credentials
    • For Affiliates
  • Payments
    • Payment Flow Scenarios
      • Scenario 1: Registered Client
      • Scenario 2: Direct Subscription from Home Page
      • Upgrading/Downgrading/Canceling Subscriptions
    • Pricing Table
  • Component Protection
  • Pending ...
Powered by GitBook
On this page
  • 1. Configure Webhook in Stripe Dashboard
  • Next steps:
  • Select the events you we wanna listen for ,which are :
  • Then, Save the webhook endpoint.
  • 2. Retrieve Webhook Secret
  1. Configuration
  2. Stripe

Stripe Webhook

PreviousAPI keysNextEmails

Last updated 9 months ago

1. Configure Webhook in Stripe Dashboard

  • Log in to your Stripe Dashboard.

  • Go to Developers > Webhooks.

  • Click + Add endpoint.

  • Enter Endpoint URL.

Url Format : https://domain.com/api/stripe-webhook

If you want to test in development mode, you'll need to create a webhook in test mode. Since using localhost can be inconvenient, you can use a proxy to obtain an HTTPS link. A good option for this is the ngrok service, which is free.

  • Download ngrok: Get it from .

  • Sign up: Create an account on their website to get an API key.

  • Setup: Follow the instructions here: .

Make sure to replace port 80 with your actual port (likely 3000). When you run the command ngrok http 3000, you'll receive an HTTPS link. You can use this link to access your site and create a webhook in test mode.

When you're ready to test in live mode, Switch to Live Mode in Stripe Dashboard and follow the same steps to set up your webhook.

Next steps:

Select the events you we wanna listen for ,which are :

  • customer.subscription.created

  • customer.subscription.deleted

  • customer.subscription.updated

  • payment_intent.succeeded

Then, Save the webhook endpoint.

2. Retrieve Webhook Secret

  • After setting up the webhook, click on the endpoint to view its details.

  • Stripe provides a Signing Secret for each webhook endpoint. This secret is used to verify that incoming requests are from Stripe.

  • Copy the Signing Secret (which starts with whsec_) and paste it into your .env file next to

    STRIPE_WEBHOOK_SECRET variable.

ngrok.com/download
ngrok setup guide