Billflow
  • Quick Start
  • Setup
    • First Time Setup
      • Connect & Setup Stripe
      • Invite Team Members
      • Create Your First Billing Page
      • Embed The Billing Page
      • Activate Live Payments
  • Billing Pages
    • Plan Picker
    • Checkout Form
    • Customer Portal
    • Pricing Page
    • Invoice Portal
  • How-to's
    • Setup Pricing
      • Flat-rate Subscriptions
      • Free Trial
      • Unit-based
      • Meter-based
      • Setup Fees
      • One-Time Payment
      • Payment Plans (Subscription Schedules)
      • Complex Pricing
      • Add-ons
    • Connect to SaaS
      • Using Stripe Webhooks
    • Change Style
      • Plan Picker Style Templates
      • Customer Portal Style Templates
      • Pricing Page Style Templates
      • Checkout Form Style Templates
    • Update Pricing
    • Use Coupons
    • Enable Quantity Management
    • Enterprise Sales Flow
    • Cancellations/Payment Failures
      • Set up Cancellation Feedback
      • Configure Dunning Emails
    • Automated emails
    • Internationalization
      • Support multiple currencies
      • Support multiple languages
    • Upgrade to new Billing Pages
    • Record Usage
    • VAT & Taxes
    • Indian Recurring Payments
  • No-code Integrations
    • No-code App Builders
      • Bubble
        • How to connect Stripe webhooks to Bubble
      • Webflow
      • WordPress
        • Add Widgets
        • Advanced Usage
        • Useful Plugins
      • Notion
      • Drupal
    • Rewardful
    • ChurnKey
  • Developer Docs
    • Embed Configurations
      • Plan Picker Configs
      • Checkout Form Configs
      • Customer Portal Configs
      • Pricing Page Configs
      • Invoice Portal Configs
    • Handling Events
    • Languages & Frameworks
    • Customize Elements
    • Versions & Beta Testing
  • Help
    • Managing Account & Team
      • Reset Your Password
      • Manage Team Members
    • Frequently Asked Questions
    • Changelog
Powered by GitBook
On this page
  • Overview
  • Events needed
  • Setting up Stripe to send events to your app

Was this helpful?

  1. How-to's
  2. Connect to SaaS

Using Stripe Webhooks

Listening for Stripe webhooks

PreviousConnect to SaaSNextChange Style

Last updated 4 years ago

Was this helpful?

Overview

In order to keep your database in sync with Stripe subscription events, we need to listen to Stripe webhooks. When free trials end, cancellations, upgrades, and downgrades come through you will be notified and change the user status in your system. This allows to you restrict access, change functionality, or provide notifications to the users, whether the changes are made by the user from the Customer Portal, or by an Admin from the Stripe Dashboard. Here's what we'll go over:

Events needed. Stripe provides tons of events, but we only need to listen to some to complete our billing flow.

If you are using a platform plugin, this step could be different for you. Make sure to check out the for specific instructions.

Events needed

Here's a list of our recommended events to listen to. Read for a full list of Stripe available events, and for more information on implementing Stripe webhook listener on your app.

Necessary

Event Name

Description

Occurs whenever a customer is signed up for a new plan. Use it to ensure the data was populated in your user system by the handleResponse method.

Occurs whenever a customer's subscription ends. Use this to update the user's subscription status.

Occurs whenever a subscription changes (e.g., switching from one plan to another, or changing the status from trial to active). Use this to update the user's subscription status for upgrades/downgrades and trial ends.

Nice to haves

Event Name

Description

Occurs whenever a new source is created for a customer. Use for sending notifications to your user.

Occurs whenever a card or source will expire at the end of the month. Use for sending notifications to your user.

Occurs whenever a source's details are changed. Use for sending notifications to your user.

Occurs three days before a subscription's trial period is scheduled to end, or when a trial is ended immediately (using trial_end=now). If you have a free trial, use for sending notifications to your user.

Occurs whenever an invoice payment attempt fails, due either to a declined payment or to the lack of a stored payment method. Use for sending notifications to your user or restricting access.

Setting up Stripe to send events to your app

You can add your app as an endpoint from the . You should set up an 'Account' type webhook endpoint and configure the events listed above. For more details on setting up your app as an endpoint, read .

integrations
here
here
Stripe Dashboard
here
customer.subscription.created
customer.subscription.deleted
customer.subscription.updated
customer.source.created
customer.source.expiring
customer.source.updated
customer.subscription.trial_will_end
invoice.payment_failed