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

# Stripe webhooks and Zapier

> Send Stripe payments to Cometly with webhooks or Zapier, so each payment and trial is tied to the ad behind it when the direct integration falls short.

A Stripe webhook sends a specific Stripe event (a new payment, a trial, a subscription conversion) to Cometly the moment it happens. This guide shows you how to send Stripe payments to Cometly with webhooks, and trials too, so each one arrives as an event (an action Cometly tracks, such as a purchase or a new trial).

Once your Stripe payments and trials are in Cometly, each one can be tied back to the ad or channel that brought in the customer. That lets you see which campaigns produce paying customers and trials, not only clicks or leads.

> [!NOTE]
>
> Webhooks and Zapier are not the recommended way to connect Stripe to Cometly. Use the [direct Stripe integration](https://docs.cometly.com/integrations/platforms/stripe.md) where you can. For more complex events that you cannot set up with the direct integration, use Stripe webhooks as an alternative.

This guide walks you through setting up Stripe webhooks to track:

* [New payments](#new-payments)
* [New trials](#new-trials)

If you prefer Zapier, jump to [Zapier (for Stripe payments)](#zapier-for-stripe-payments).

## Before you begin

* **Email is required for tracking.** Make sure a lead opt-in form earlier in your funnel collects emails. Without a captured email, Stripe events cannot be attributed properly.
* **Using Stripe Checkout?** Make sure your [forms collect email addresses](https://docs.cometly.com/getting-started/form-tracking.md) so conversions are tracked accurately.

## Step 1: Create the event in Cometly

1. In the sidebar, click **Events Manager**, then click **Create Event**. (You can also create the event from **Setup**, in the step **Create conversion events**.)

   ![Events Manager page on the Events tab with the Create Event button boxed at the top right](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/01.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=318ec5fafb7140c5c3abb1b21855d78d)

2. Under **App / Integration**, choose **Webhooks**. If you cannot find it in the list, click **Select Webhooks** below the field.

   ![Create Event dialog with Webhooks chosen under App / Integration (1) and the Select Webhooks link below the field (2)](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/02.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=7a193728cf32c5535db3d33e01f8347b)

3. Under **Events**, choose the event you want to track, or click **Create New Event**:

   * **New payments**: select **Purchase** (it is counted in Gross Revenue automatically).
   * **New trials**: select **Start Trial**.

   ![Events picker in the Create Event dialog listing Create New Event and the standard events, with Purchase boxed](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/03.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=3fd16d7636c4d817452f480f772656aa)

4. Click **Create**. The event appears in the Events Manager with the status **Draft**.

5. In the event's row, click **Configure**. On the **Receive Data** step, click **Copy** next to **Your webhook URL**. You need this URL in Step 2.

   ![Receive Data step for a Purchase webhook with the webhook URL, an arrow on the Copy button and the Check for Data button](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/04.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=720e3b0e86032142b53ae58e6dd7904d)

## Step 2: Add the webhook to Stripe

1. Log in to your **Stripe Dashboard**.

2. Click **Developers** in the bottom-left menu.

   ![Stripe Dashboard home with Developers boxed at the bottom left of the sidebar](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/05.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=f48fb9b19c023075b650c35ebcac834f)

3. In the menu that opens, click **Webhooks** under **Workbench**.

   ![Stripe Developers menu open with Webhooks boxed under the Workbench heading](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/06.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=6b8e0e999cdaf0fc9c76ffbfdf126f93)

4. Click **+ Add destination**.

   ![Stripe Workbench on the Webhooks tab with the Add destination button boxed](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/07.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=992665e70a7507ace424928d5d6e08f5)

5. Stripe asks for the events first, on the **Select events** step. Pick the event as described in the section below for the event you are setting up: [New payments](#new-payments) or [New trials](#new-trials). You can set up either one or both.

6. When you reach the **Configure your destination** step, paste the webhook URL from Step 1 into the **Endpoint URL** box.

   ![Stripe Configure destination step with a Cometly webhook URL in the boxed Endpoint URL field](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/08.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=b3e333fcd51de863103b775c996cf7be)

> [!WARNING]
>
> Each Cometly event gets its own webhook. In Stripe, make sure each webhook is linked to **only one Stripe event** to avoid mapping issues later.

## New payments

Tracks successful payments for any payment method (credit cards, ACH, wire, Affirm, Klarna and so on).

* **Stripe event**: `invoice.paid`

### Select the `invoice.paid` event in Stripe

1. Search for *invoice paid*.

2. Select `invoice.paid`.

3. Click **Continue**.

   ![Stripe Select events step with invoice.paid typed in the search (1), the invoice.paid checkbox ticked (2) and the Continue button (3)](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/10.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=5627cd0ad6351fa3b9e31d995362f63b)

4. On the **Configure your destination** step, with the webhook URL in the **Endpoint URL** box, click **Create destination**.

   ![Stripe Configure destination step listening to invoice.paid, with the Create destination button boxed](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/11.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=bd2013327ef325f2fbf2550f5a7e06cf)

### Check for data in Cometly

1. Go back to the webhook in Cometly. If you left the page, open **Events Manager**, find the event with the status **Draft** and click **Configure** in its row.

   ![Events Manager with Events Manager marked in the sidebar (1) and the Configure button on the Draft Purchase webhook row (2)](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/12.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=394b75421f0ee0e49da7550fbe6e05ab)

2. Click **Check for Data**. Cometly checks for a few seconds.

   If no data shows up, don't worry. Click **Save & Return When Data is Ready**, then come back and click **Check for Data** again once Stripe has sent an event.

3. When a recent record from Stripe appears, click it to select it and check that the data is there. Then click **Continue With Selected Record**.

   ![Receive Data step with one received request selected (1) and the Continue With Selected Record button (2)](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/13.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=dacb5d2e5e3101fd555e00495a1bbbdf)

### Map the fields

On the **Configure Mapping** step, match the Stripe data to Cometly fields. **Email** and **Event Time** are required and already listed. Click **Add Field** to add the others.

1. **Email**: select `data.object.customer_email`.
2. **Event Time**: leave it on **The time we receive the event**.
3. **Amount**: select `data.object.amount_paid`. The next section shows how to move the decimal point so the amount is correct.
4. **Full Name**: select `data.object.customer_name`.

![Configure Mapping step with four numbered rows: Email, Event Time, Amount and Full Name mapped to Stripe invoice fields](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/14.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=e98aed55a3bda534a4331e4c8d802c86)

### Format the amount

In this example the payment was for 500, but the amount arrives as `50000`. Use the formatting options to move the decimal point two places.

1. In the **Amount** row, click **Formatting Options**.

   ![Amount row with Formatting Options open and an arrow on the second button, whose tooltip reads Increase decimal places](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/15.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=21db418715655f71aa901aa4a7819a2b)

2. Click the **Increase decimal places** button twice. It is the second button in the row, and its name shows when you hover over it. Each click moves the decimal point one place to the left. If you click once too often, click **Decrease decimal places** to step back.

3. Check the value under **Formatted**. It should now read `500.00`. Click **Save & Continue**.

   ![Amount row showing Formatted: 500.00 (1) and the Save and Continue button (2)](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/18.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=ce26b2d6f9d4c5951072c14dbb301268)

### Filter for paid invoices

On the **Filtering** step, Cometly has already added a filter that skips events with an empty email. Keep it, and add a second filter so only successful payments are processed.

1. Click **Add Another Filter**. (The button reads **Add Filters** when the list is empty.)

2. Type `status` in the search box and select `data.object.status`.

   ![Filtering step with status typed in the filter search (1) and data.object.status with the value paid in the results (2)](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/19.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=b0049abb7b2539e952cfce61d53a7721)

3. Choose the condition **(text) contains**, enter `paid` and click **Done**.

   ![Filter condition list with (text) contains selected and paid entered (1), and the Done button (2)](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/20.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=71720697c82bcc925bccb0a7ce3f3eac)

4. Review your filters and click **Activate**.

   ![Filtering step with the email and data.object.status filters both passing and the Activate button boxed](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/21.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=b101a86670a900b89402397f91ac7501)

Cometly now processes only successful payments (where the `status` contains "paid") and ignores the rest. In the Events Manager, the switch in the event's **Status** column is on, which shows the webhook is processing new payments from Stripe.

![Events Manager row for the Purchase webhook event with the switch in the Status column on and boxed](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/34.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=cb9239595a3bb945ffa1f82d12df7b9e)

## New trials

Tracks when a customer starts a trial subscription.

* **Stripe event**: `invoice.paid`. The filters at the end of this section keep only trial starts: a \$0 invoice with the billing reason `subscription_create`.

Before you start, repeat Step 1 with the **Start Trial** event and Step 2 with that event's webhook URL.

### Select the `invoice.paid` event for trials

1. Search for *invoice paid*.

2. Select `invoice.paid`.

3. Click **Continue**.

4. On the **Configure your destination** step, with the webhook URL in the **Endpoint URL** box, click **Create destination**.

### Check for trial data in Cometly

1. Go back to the webhook in Cometly. If you left the page, open **Events Manager**, find the **Start Trial** event with the status **Draft** and click **Configure** in its row.

   ![Events Manager table with an arrow on the Configure button of the Draft Start Trial webhook row](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/24.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=91d793cb44d04d0ce9c6ec123b68bd1e)

2. Click **Check for Data**. Cometly checks for a few seconds.

   If no data shows up, don't worry. Click **Save & Return When Data is Ready**, then come back and click **Check for Data** again once Stripe has sent an event.

3. When a recent record from Stripe appears, click it to select it and check that the data is there. Then click **Continue With Selected Record**.

### Map the trial fields

On the **Configure Mapping** step, match the Stripe data to Cometly fields. Click **Add Field** to add **Full Name**.

1. **Email**: select `data.object.customer_email`.
2. **Event Time**: leave it on **The time we receive the event**.
3. **Full Name**: select `data.object.customer_name`.

![Configure Mapping step for Start Trial with three numbered rows: Email, Event Time and Full Name](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/26.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=f92f0bebea37bceaec665962fe8c83c7)

Click **Save & Continue**.

### Filter for new trials

On the **Filtering** step, keep the filter Cometly added for the email and add two more.

1. Click **Add Another Filter**, type `billing` in the search box and select `data.object.billing_reason`.

   The record you selected must show `subscription_create` for this field, like in the image below. If it does not, create a trial on your end (or wait for the next one) so you can map a record that has it.

   ![Filtering step with billing typed in the filter search (1) and data.object.billing\_reason with the value subscription\_create in the results (2)](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/27.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=5d88cd8cca6d2e7886db384abe39c6ea)

2. Choose the condition **(text) contains**, enter `subscription_create` and click **Done**. This keeps only invoices created by a new subscription.

   ![Filter condition list with (text) contains selected and subscription\_create entered (1), and the Done button (2)](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/28.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=ae755160a2febb5428b7dc647bc254b9)

3. Click **Add Another Filter** again and select `data.object.amount_paid`. Choose the condition **(text) is**, enter `0` and click **Done**. This keeps only new subscriptions with a \$0 invoice, which means they are trials.

4. Click **Activate**.

   ![Filtering step with the email, billing\_reason and amount\_paid filters all passing, the amount\_paid filter marked (1) and the Activate button (2)](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/stripe-webhooks/29.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=e3270a3c118768c0c1ea03e2ecae6ca5)

In the Events Manager, the switch in the event's **Status** column is on, which shows the webhook is processing new trial events from Stripe.

## Zapier (for Stripe payments)

If you prefer Zapier for tracking new payments, follow these steps. To connect Cometly in Zapier you need a Cometly API token: see the [Zapier integration](https://docs.cometly.com/integrations/zapier.md).

[Video: send Stripe payments to Cometly with Zapier](https://player.vimeo.com/video/830811146)

1. Create a new Zap and choose **Stripe** as your trigger.

2. Choose **New Payment** as the event for Stripe.

3. For your first action, select **Filter**. The filter makes sure only successful payments are sent to Cometly.

4. In the **Filter setup & testing** section, set the filter to continue only if **Status** **(Text) Exactly matches** `succeeded`.

5. Click **Continue**, test the filter and go to the next step.

6. Choose **Cometly** as the next action and configure it to send payment events to Cometly.

   You must include the following fields: Event Time, Email, Amount and Event.

   * **Event**: select `purchase` *(required)*
   * **Event Time**: type `now` *(required)*
   * **Email**: choose the email from the Stripe trigger *(required)*
   * **Full Name**: choose the full name from the Stripe trigger *(recommended)*
   * **Amount**: choose the amount from the Stripe trigger *(recommended)*

7. Test and **publish** your Zap.

## Check it worked

In **Events Manager**, each webhook event you activated shows a switch that is turned on in the **Status** column. After the next payment or trial in Stripe (or after you test the Cometly step in your Zap), open the **Events Log** tab: the event appears there within 60 seconds, with **SUCCESS** in the **Details** column. Test data sent before you activated a webhook event is not processed, so wait for a new one.

## Frequently asked questions

### How long does it take for Stripe webhook events to show up in Cometly?

The event shows in the Events Log within 60 seconds of being sent. It can take up to 15 minutes to appear in the reporting areas, such as the Report Builder or Ads Manager.

### Why do my Stripe payments show up in Cometly without an ad source?

Cometly needs an email address to connect a Stripe payment to the visitor who clicked your ad. Make sure a form earlier in your funnel collects the customer's email, so Cometly has already seen that email on your site when the payment arrives. For other causes, see [Understanding No Source in reports](https://docs.cometly.com/support/troubleshooting/sources/no-source.md).

### How do I track Stripe refunds or canceled subscriptions in Cometly?

Use the direct Stripe integration: it has ready-made triggers for **New Refund** and **Canceled Subscription**, along with new subscriptions, new customers and first payments. You pick the trigger when you configure the event, with no webhook to add in Stripe. See [Stripe](https://docs.cometly.com/integrations/platforms/stripe.md).

## Next steps

* [Use the Events Log to confirm Stripe events arrive](https://docs.cometly.com/support/troubleshooting/general/event-log.md)
* [Map fields, add filters and activate a webhook event](https://docs.cometly.com/integrations/webhooks.md)
* [Connect the direct Stripe integration](https://docs.cometly.com/integrations/platforms/stripe.md)
* [Track first-time and recurring Stripe payments with Zapier](https://docs.cometly.com/integrations/guides/stripe-first-vs-recurring-payments-zapier.md)
* [Send conversions back to your ad platforms](https://docs.cometly.com/getting-started/send-conversions.md)

Still have questions or need a hand? We're happy to help. Reach our team at [support@cometly.com](mailto:support@cometly.com).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.