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

# Stripe webhooks

> Use Stripe webhooks to keep Zite updated when checkout, invoices, and subscriptions change.

## How it works

Stripe events often happen after checkout. A payment can fail, an invoice can be paid, or a customer can cancel a subscription in Stripe. Use webhooks so Stripe can tell Zite when those changes happen.

In Zite, a webhook starts a workflow that can update your database, change access, send email, alert support, or refresh a dashboard.

<Frame>
  <img src="https://mintcdn.com/zite/z4nCHDxMynWAmLKe/help/images/how-to-build/webhooks/webhooks.webp?fit=max&auto=format&n=z4nCHDxMynWAmLKe&q=85&s=30c12fee6bb7f8779ee90a161cc98d7f" alt="Webhooks view showing webhook triggers in Zite" style={{ width: "100%" }} width="2557" height="1197" data-path="help/images/how-to-build/webhooks/webhooks.webp" />
</Frame>

For the full webhook setup flow, see [Configuring Webhooks](/help/platform/how-to-build/webhooks).

## Set up Stripe webhooks

<Steps>
  <Step title="Create the webhook in Zite">
    You can create the webhook from chat or from the Webhooks tab.

    In chat, ask Zite to create a webhook workflow for Stripe subscription events.

    ```text theme={null}
    Create a Stripe webhook for subscription lifecycle events. Update the
    Stripe subscriptions table when checkout completes, a subscription changes
    or is canceled, an invoice is paid, or payment fails.
    ```

    You can also open `Workflows`, switch to `Webhooks`, describe the webhook you want, and click `Set it up`.

    <Frame>
      <img src="https://mintcdn.com/zite/P6ByF29dGP4M78NQ/help/images/how-to-build/webhooks/create-webhook-from-tab.png?fit=max&auto=format&n=P6ByF29dGP4M78NQ&q=85&s=e1b53d59a0160c886b0494ff07a33efc" alt="Create a webhook trigger directly from the Webhooks tab" style={{ width: "100%" }} width="2302" height="1162" data-path="help/images/how-to-build/webhooks/create-webhook-from-tab.png" />
    </Frame>

    Zite creates a webhook-triggered workflow and shows a webhook URL when it is waiting for an event.
  </Step>

  <Step title="Copy the Zite webhook URL">
    Copy the webhook URL from Zite. You can also find it later in `Workflows` -> `Webhooks`.
  </Step>

  <Step title="Add an event destination in Stripe">
    In Stripe, open `Workbench` -> `Webhooks` and create a new event destination.

    <Frame>
      <img src="https://mintcdn.com/zite/P6ByF29dGP4M78NQ/help/images/stripe/add-destination.webp?fit=max&auto=format&n=P6ByF29dGP4M78NQ&q=85&s=161547f5dbec7b4ddee194548f770e75" alt="Stripe Webhooks page with the Add destination button highlighted" style={{ width: "100%" }} width="2159" height="1681" data-path="help/images/stripe/add-destination.webp" />
    </Frame>
  </Step>

  <Step title="Select subscription events">
    Select these five events:

    * `checkout.session.completed`
    * `customer.subscription.updated`
    * `customer.subscription.deleted`
    * `invoice.paid`
    * `invoice.payment_failed`

    <Frame>
      <img src="https://mintcdn.com/zite/P6ByF29dGP4M78NQ/help/images/stripe/select-events.webp?fit=max&auto=format&n=P6ByF29dGP4M78NQ&q=85&s=f6b9a2d481fe486cfeadec952fb9d7ae" alt="Stripe event selection screen with selected events and your account destination scope" style={{ width: "100%" }} width="2284" height="1589" data-path="help/images/stripe/select-events.webp" />
    </Frame>
  </Step>

  <Step title="Choose webhook endpoint">
    Choose `Webhook endpoint` as the destination type.

    <Frame>
      <img src="https://mintcdn.com/zite/P6ByF29dGP4M78NQ/help/images/stripe/destination-type.webp?fit=max&auto=format&n=P6ByF29dGP4M78NQ&q=85&s=ab550afcbd29de3718951e20eda5e8c1" alt="Stripe destination type screen with Webhook endpoint selected" style={{ width: "100%" }} width="3000" height="1921" data-path="help/images/stripe/destination-type.webp" />
    </Frame>
  </Step>

  <Step title="Configure the destination">
    Paste the Zite webhook URL into the endpoint URL field. Add a destination name for internal reference, and add a description if helpful. Choose `Your account` unless you operate a Stripe Connect platform and need connected-account events.

    <Frame>
      <img src="https://mintcdn.com/zite/P6ByF29dGP4M78NQ/help/images/stripe/your-destination.webp?fit=max&auto=format&n=P6ByF29dGP4M78NQ&q=85&s=c7b46659c3b1a3e849f70cb3c45b40e1" alt="Stripe destination configuration screen with endpoint URL and destination name fields" style={{ width: "100%" }} width="2372" height="1684" data-path="help/images/stripe/your-destination.webp" />
    </Frame>

    Stripe's Dashboard steps are documented in [Receive Stripe events in your webhook endpoint](https://docs.stripe.com/webhooks).
  </Step>

  <Step title="Review and publish">
    Open the workflow Zite created. Confirm that it updates the subscriptions table, saves the Stripe event ID, and handles duplicates.

    Publish the app before relying on the webhook for live subscription changes.
  </Step>
</Steps>

## Subscription events to select

For subscription lifecycle updates, select these Stripe events.

| Stripe event                    | Use it in Zite to                                                          |
| ------------------------------- | -------------------------------------------------------------------------- |
| `checkout.session.completed`    | Create the first customer or subscription record after checkout.           |
| `customer.subscription.updated` | Update plan, quantity, trial, cancellation, current period, or status.     |
| `customer.subscription.deleted` | Mark the subscription as canceled and update access.                       |
| `invoice.paid`                  | Mark the subscription as paid or active and keep access enabled.           |
| `invoice.payment_failed`        | Mark the subscription as past due, notify the customer, and alert support. |

For one-off payments, start with `checkout.session.completed` and add refund, dispute, or payment events only if your app needs to react after checkout.

Learn more in Stripe's guide to [using webhooks with subscriptions](https://docs.stripe.com/billing/subscriptions/webhooks).

<Warning>
  Stripe can retry webhook events and send related events close together. Store the Stripe event ID so the same event is not processed twice.
</Warning>

<p className="zite-related-topics-heading">Related topics</p>

<div className="zite-related-topics">
  <a href="/help/platform/how-to-build/webhooks">Configuring Webhooks</a>
  <a href="/help/integrations/stripe-subscriptions">Subscriptions</a>
  <a href="/help/database/overview">Zite Database</a>
  <a href="/help/platform/workflows/overview">Workflows</a>
</div>
