Stripe Integration
Connect Stripe to LostChurn for automatic failed payment recovery.
Stripe is LostChurn's primary integration and offers the deepest feature support. You can connect via OAuth for the fastest setup or use restricted API keys for more granular control over permissions.
Prerequisites
- An active Stripe account (any plan, including Stripe's free tier)
- Access to the Stripe Dashboard with admin or developer permissions
- A LostChurn account with at least one workspace created
If you plan to test the integration before going live, ensure you have access to Stripe's test mode (toggled in the top-right corner of the Stripe Dashboard).
Connection Steps
Option A: OAuth (Recommended)
OAuth is the fastest way to connect Stripe. LostChurn requests only the permissions it needs and Stripe handles credential management automatically.
- In your LostChurn dashboard, navigate to Settings > Integrations.
- Click Connect Stripe.
- You will be redirected to Stripe's OAuth authorization page. Review the requested permissions and click Connect my Stripe account.
- Stripe redirects you back to LostChurn. You will see a confirmation message with your Stripe account name and ID.
- LostChurn automatically creates the required webhook endpoint in your Stripe account. No manual webhook setup is needed with OAuth.
Option B: Restricted API Key
If your organization requires manual control over API key permissions, you can connect with a restricted key instead.
- In the Stripe Dashboard, go to Developers > API Keys.
- Click Create restricted key.
- Name the key
LostChurnand grant the following permissions:- Charges: Read
- Customers: Read and Write
- Invoices: Read and Write
- Payment Intents: Read and Write
- Subscriptions: Read and Write
- Events: Read
- Webhook Endpoints: Read and Write
- Click Create key and copy the key (it starts with
rk_live_orrk_test_). - In your LostChurn dashboard, go to Settings > Integrations > Stripe and click Connect with API Key.
- Paste the restricted key and click Save.
Webhook Configuration
If you connected via OAuth, LostChurn automatically registers the webhook endpoint. If you used an API key, you need to set up the webhook manually.
Manual Webhook Setup
- In the Stripe Dashboard, go to Developers > Webhooks.
- Click Add endpoint.
- Set the endpoint URL to:
https://webhooks.lostchurn.com/v1/stripe - Under Events to send, select the following events:
invoice.payment_failedinvoice.payment_succeededinvoice.payment_action_requiredcustomer.subscription.deletedcustomer.subscription.updatedcustomer.subscription.pausedcustomer.subscription.resumedcharge.failedcharge.succeededcharge.refundedcharge.dispute.createdpayment_intent.payment_failedpayment_intent.succeededpayment_method.updatedpayment_method.detached
- Click Add endpoint.
- On the endpoint detail page, click Reveal under Signing secret. Copy the secret (it starts with
whsec_). - In your LostChurn dashboard, go to Settings > Integrations > Stripe and paste the webhook signing secret into the Webhook Secret field.
Webhook Signing Secret
LostChurn uses the webhook signing secret to verify that incoming events genuinely originated from Stripe. This prevents spoofed or tampered webhook payloads from triggering recovery actions. Never share your webhook signing secret or commit it to version control.
Verify Connection
After connecting, verify that events flow correctly:
- In the Stripe Dashboard, go to Developers > Webhooks and select the LostChurn endpoint.
- Click Send test webhook.
- Select
invoice.payment_failedas the event type and click Send test webhook. - In your LostChurn dashboard, go to Events and confirm the test event appears within a few seconds. It will be labeled with a
testbadge. - Alternatively, use the Stripe CLI to send test events from your terminal:
stripe trigger invoice.payment_failed
A successful connection shows a green Connected badge on the Stripe card in Settings > Integrations and the test event appears in your Events feed with all fields parsed correctly.
Supported Events
| Stripe Event | LostChurn Action |
|---|---|
invoice.payment_failed | Creates a failed payment record, triggers retry evaluation |
invoice.payment_succeeded | Marks recovery as successful, stops active dunning |
invoice.payment_action_required | Sends 3D Secure or SCA authentication email to customer |
customer.subscription.deleted | Records churn event, triggers reactivation campaign if configured |
customer.subscription.updated | Updates subscription status and metadata |
customer.subscription.paused | Records pause event for analytics |
customer.subscription.resumed | Records resume event, stops pause-related campaigns |
charge.failed | Creates failed charge record, maps to parent invoice if applicable |
charge.succeeded | Confirms charge recovery |
charge.refunded | Records refund for revenue reporting |
charge.dispute.created | Flags disputed charge, pauses retry and dunning |
payment_intent.payment_failed | Creates failed payment record for PaymentIntents API users |
payment_intent.succeeded | Confirms PaymentIntent recovery |
payment_method.updated | Triggers immediate retry of pending failures on updated payment method |
payment_method.detached | Flags subscriptions at risk due to removed payment method |
Provider-Specific Notes
Test Mode vs. Live Mode
Stripe provides completely separate test and live environments. LostChurn respects this separation:
- Test mode keys (starting with
sk_test_orrk_test_) connect to Stripe's sandbox. All events, retries, and dunning emails operate in test mode only. Dunning emails are sent but clearly marked as test emails. - Live mode keys (starting with
sk_live_orrk_live_) process real payments. Retries will charge real payment methods.
You can connect both test and live mode simultaneously. LostChurn shows them as separate connections in the dashboard.
Stripe CLI Testing
For local development and testing, you can forward Stripe webhook events to a local LostChurn instance using the Stripe CLI:
stripe listen --forward-to localhost:3000/v1/stripeThis is particularly useful for testing custom recovery campaigns before deploying them.
API Version
LostChurn targets Stripe API version 2024-12-18.acacia. Stripe automatically translates events to your account's configured API version. If you experience issues with event payloads, check that your Stripe account API version is 2023-10-16 or later under Developers > API Version.
Rate Limits
LostChurn respects Stripe's rate limits of 100 requests per second in live mode and 25 requests per second in test mode. Retry attempts are automatically throttled and distributed across time windows to stay well within these limits. If you have a Stripe Scale or custom plan with higher rate limits, contact LostChurn support to adjust your throughput settings.
Idempotency
All retry requests made by LostChurn include an idempotency key derived from the original payment intent or invoice ID. This guarantees that a retry is never accidentally duplicated, even if there is a network interruption between LostChurn and Stripe.
Multi-Currency Support
LostChurn fully supports Stripe's multi-currency invoicing. Failed payment amounts, recovery metrics, and revenue dashboards are all displayed in the original transaction currency. Summary statistics can be viewed in your configured base currency using Stripe's exchange rates.