> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crovver.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> How Crovver handles payment provider events to keep subscriptions in sync.

Crovver automatically registers and handles webhook events from your payment provider. When you connect a provider in the Crovver dashboard, the webhook endpoint is registered for you — no manual setup in Stripe required.

## How It Works

When you configure a payment provider in **Settings → Payment Providers**, Crovver registers its webhook endpoint with that provider automatically. All subscription lifecycle events flow through Crovver's webhook handler, which keeps your subscription states up to date.

## Events Processed

| Event                           | What Crovver Does                                        |
| ------------------------------- | -------------------------------------------------------- |
| `checkout.session.completed`    | Activates subscription (`pending` → `active` or `trial`) |
| `customer.subscription.created` | Links provider subscription ID to Crovver record         |
| `customer.subscription.updated` | Handles trial end, plan changes                          |
| `customer.subscription.deleted` | Cancels subscription                                     |
| `invoice.payment_succeeded`     | Renews billing period                                    |
| `invoice.payment_failed`        | Moves subscription to `past_due`                         |

## Idempotency

Crovver deduplicates webhook events using the provider event ID. Replaying events is safe.

## Do I Need to Configure Anything?

No. Crovver registers and handles webhooks for you when you connect a payment provider — there's no endpoint to set up, no signing secret to manage, and nothing to deploy. Subscription state stays in sync automatically.
