Stripe Integration

Track customer churn by connecting your Stripe account to SeggWat.

Overview

The Stripe integration allows you to automatically track customer cancellations from your Stripe subscriptions. When a customer cancels their subscription, SeggWat captures the event along with the cancellation reason and any comments they provide.

Features

  • Automatic churn tracking - Cancellation events are captured in real-time via webhooks
  • Cancellation reasons - See why customers are leaving (too expensive, missing features, etc.)
  • Customer comments - Capture verbatim feedback from departing customers
  • Churn analytics - View trends, statistics, and breakdowns in the Insights dashboard
  • Owner notifications - Get notified when customers leave feedback with their cancellation

Setup Instructions

Step 1: Open the Stripe Integration

  1. Navigate to your project in SeggWat
  2. Go to Integrations in the sidebar
  3. Click on the Stripe integration card

Step 2: Copy the Webhook URL

In the Stripe integration modal, you'll see a unique webhook URL for your project:

https://seggwat.com/hooks/stripe/{your-project-key}

Click the Copy button to copy this URL to your clipboard.

Step 3: Configure Stripe Webhook

  1. Open your Stripe Dashboard
  2. Go to DevelopersWebhooks
  3. Click Add endpoint
  4. Paste the webhook URL from SeggWat
  5. Under Select events, click Select events
  6. Search for and enable:
    • customer.subscription.deleted
  7. Click Add endpoint

Step 4: Copy the Signing Secret

After creating the webhook in Stripe:

  1. Click on the webhook you just created
  2. Under Signing secret, click Reveal
  3. Copy the secret (starts with whsec_)
  4. Return to SeggWat and paste it in the Signing Secret field
  5. Click Save Secret

Viewing Churn Data

Once configured, churn data appears in two places:

Insights → Churn Tab

Navigate to Insights and click the Churn tab to see:

  • Total cancellations - All-time count
  • Monthly trends - This month vs. last month with percentage change
  • Cancellation reasons - Visual breakdown of why customers churn
  • Recent cancellations - List of recent events with customer details and comments

Notifications

Project owners receive notifications when customers include comments with their cancellations. This helps you quickly respond to actionable feedback.

Cancellation Reasons

Stripe captures cancellation feedback through the cancellation_details.feedback field. SeggWat maps these to the following categories:

Reason Description
Too Expensive Customer finds the price too high
Missing Features Product lacks features the customer needs
Switched Service Customer moved to a competitor
Low Quality Customer is unhappy with product quality
Too Complex Product is too difficult to use
Unused Customer no longer needs the product
Customer Service Issues with support experience
Other Custom reason provided by customer

Testing the Integration

You can test the webhook using Stripe CLI:

bash
# Install Stripe CLI if needed
brew install stripe/stripe-cli/stripe

# Login to your Stripe account
stripe login

# Trigger a test event
stripe trigger customer.subscription.deleted

This will send a test webhook to your endpoint and help verify the integration is working.

Troubleshooting

Webhook Not Receiving Events

  1. Verify the webhook URL is correct in Stripe
  2. Ensure the signing secret matches (starts with whsec_)
  3. Check that customer.subscription.deleted event is enabled
  4. Verify your webhook endpoint is showing in the Stripe dashboard

Integration Shows "Pending"

The status changes to "Active" after the first successful webhook is received. You can:

  • Wait for a real cancellation
  • Use Stripe CLI to trigger a test event (see Testing section above)
  • Check the Stripe dashboard for webhook delivery attempts

Invalid Secret Error

If you see a secret validation error:

  1. Re-copy the secret from Stripe (click "Reveal" to see the full secret)
  2. Ensure no extra spaces before or after the secret
  3. The secret should start with whsec_

Signature Verification Failed

If webhook signature verification fails:

  1. Ensure you're using the correct signing secret for this specific webhook endpoint
  2. Check that the webhook is pointing to the correct URL
  3. Verify no proxy or middleware is modifying the request body

Data Privacy

SeggWat only stores:

  • Subscription ID (for deduplication)
  • Customer ID (if provided by Stripe)
  • Cancellation reason and comment
  • Timestamp

We do not store payment information, card details, or access your Stripe billing data.

Reward Discounts

Create Stripe coupons and promo codes directly from your SeggWat feedback dashboard to reward subscribers who take the time to submit valuable feedback.

How It Works

  1. A subscriber submits feedback or suggests a feature idea and opts in to receive a discount
  2. Their Stripe subscription ID is stored with the feedback or idea
  3. From the feedback or idea detail page your team can create a coupon and optionally auto-apply it to that subscription in one click

Setup: Add a Stripe Restricted API Key

You need a Stripe restricted key so SeggWat can create coupons and apply them to subscriptions:

  1. In your Stripe Dashboard, go to DevelopersAPI keys
  2. Click Create restricted key
  3. Set the following permissions:
    • Coupons → Write
    • Promotion codes → Write
    • Subscriptions → Write (required for auto-applying discounts)
  4. Click Create key and copy the generated key
  5. In SeggWat, open the Stripe integration modal
  6. Scroll down to the Discount API Key section and paste the key
  7. Click Save API Key — SeggWat will validate it against the Stripe API immediately

Collecting the Subscription ID

There are two ways to pass the subscription ID, depending on where the subscriber interacts with your product:

Feedback Widget

The widget shows a "Get a discount on future bills" consent checkbox only when it knows the user's Stripe subscription ID. Pass it after the user logs in:

html
<script src="https://seggwat.com/static/widgets/v1/seggwat-feedback.js"
        data-project-key="your-project-key"></script>
<script>
  // Call after authentication — pass the user's Stripe subscription ID
  SeggwatFeedback.setSubscriptionId('sub_1abc...');
</script>

When the user checks the consent box and submits, SeggWat stores the subscription ID alongside the feedback so your team can act on it. See the widget installation guide for details.

Feature Portal (Ideas)

For feature suggestions on the public portal, include subscription_id in the authentication token payload:

javascript
const token = generateSeggwatToken(
  user.id,
  user.email,
  process.env.SEGGWAT_PROJECT_KEY,
  process.env.SEGGWAT_SIGNING_SECRET,
  user.stripeSubscriptionId  // Stripe subscription ID (sub_...)
);

When present in the token, consent is implied — the subscriber's ID is automatically stored with any ideas they suggest through the portal.

Creating a Discount from Feedback or Ideas

  1. Open any feedback item or feature idea in the dashboard
  2. Scroll to the Reward with Stripe Discount section (only visible when a Stripe API key is configured)
  3. Configure the discount:
    • Name — Internal label for the coupon (not customer-facing)
    • Percentage Off — Discount amount between 1% and 100%
    • Duration — Once, Forever, or Repeating (specify number of months)
    • Custom Code — Optional promo code string; auto-generated if left empty
    • Max Redemptions — Limit how many times the code can be redeemed
  4. Click the create button:
    • Create & Apply Discount — when a subscription ID is present, applies the coupon directly to the subscription (takes effect on the next billing cycle)
    • Create Discount — generates a redeemable promo code you can share manually with the customer

Multiple Payment Providers

You can connect both Stripe and Polar to the same project. SeggWat will aggregate churn data from all connected payment providers, and the provider source is shown for each cancellation event.

Next Steps

Navigation