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

# Stripe integration

> Sync contacts and send emails triggered by events in Stripe.

<Info>
  Our Stripe integration lets you:

  * Create and update contacts
  * Send events to trigger workflows
</Info>

Our Stripe integration is built on top of [Incoming webhooks](/integrations/incoming-webhooks) and runs via the Loops app for Stripe.

You can sync your Stripe customer data to Loops for customer and invoice-related events and trigger emails with [workflows](/workflows).

## Supported events

We accept the following Stripe events:

* `charge.dispute.created`
* `charge.dispute.closed`
* `checkout.session.async_payment_succeeded`
* `checkout.session.async_payment_failed`
* `checkout.session.completed`
* `customer.created`
* `customer.updated`
* `customer.deleted`
* `customer.subscription.created`
* `customer.subscription.paused`
* `customer.subscription.resumed`
* `customer.subscription.trial_will_end`
* `customer.subscription.deleted`
* `invoice.paid`
* `invoice.payment_failed`
* `invoice.upcoming`
* `quote.finalized`
* `quote.accepted`
* `quote.canceled`

<Tip>
  If you cannot see some of these events in the Stripe settings page, please install Loops's Stripe app. Click **Connect to Stripe** at the top of the page.
</Tip>

[Stripe webhook docs](https://docs.stripe.com/webhooks)

If you send other events, they will be ignored.

<Info>
  If you would like to see more events supported, please let us know by sending
  a message to [our support team](https://app.loops.so/settings?page=support). Please keep in mind only
  events that contain an email address are able to be processed.
</Info>

## Synced data

We sync the following Stripe data to your Loops contacts for every incoming event:

* Email address
* First and last name (optional)

We use the email addresses of Stripe customers to match contacts in your Loops audience. If the email address is not found in Loops, we will create a new contact.

The `customer.deleted` event can be used to delete or unsubscribe your Stripe customers from your Loops audience.

## Install the Loops app in Stripe

To get started, install the Loops Stripe app from [Settings -> Stripe](https://app.loops.so/settings?page=stripe). Click **Connect to Stripe** and follow the installation steps provided by Stripe. You will be redirected back to Loops when you are done.

## Configure events

You can select and configure the Stripe events you want to be sent to Loops.

For each event, you can choose to trigger workflows via [events](/events) as well as update customer data like assigning a user group and syncing customer names.

Make sure to click **Save** to save your changes.

## Testing Stripe webhooks

You can test a `customer.*` webhook by creating a new customer in the [Customers](https://dashboard.stripe.com/customers) page in Stripe.

You can also use the Stripe CLI tool to mimic events, by using the [`trigger` command](https://docs.stripe.com/cli/trigger).

You can see all sent webhooks by going to **Developers -> Webhooks** and then clicking on an endpoint.

On Loops' end, You will see new contacts appear in your [Audience](https://app.loops.so/audience) page, and triggered events in the [Events](https://app.loops.so/settings?page=events) page.

## Examples

Here are some examples of how you can send data from Stripe to Loops to sync contacts and trigger useful emails to your customers.

### Syncing customers to Loops

Create or update contacts in your Loops audience when a customer is created or updated in Stripe.

1. Install the Loops app in Stripe.
2. In Loops, make sure `customer.created` and `customer.updated` are toggled on on the Stripe settings page.
3. If you want to sync customer names, open the **Sync additional data** section and toggle on **Full name**.

### Send an email to all new Stripe customers

Send an email from Loops when a new customer is created in Stripe.

1. Create a new workflow in Loops using our **Stripe - New Customer** template.
2. For the workflow trigger, select **Event received** and then select **Stripe** from the first dropdown and **customer.created** from the second dropdown.
3. Toggle on `customer.created` on the Stripe settings page.

### Send an email to Stripe Checkout customers

Send an email from Loops when a customer pays via Stripe Checkout.

1. Create a new workflow in Loops using our **Stripe - Payment Successful** template.
2. For the workflow trigger, select **Event received** and then select **Stripe** from the first dropdown and **checkout.session.completed** from the second dropdown.
3. Toggle on `checkout.session.completed` on the Stripe settings page.

### Successful payment email

Send an email from Loops when an invoice is paid in Stripe.

1. Create a new workflow in Loops using our **Stripe - Payment Successful** template.
2. For the workflow trigger, select **Event received** and then select **Stripe** from the first dropdown and **invoice.paid** from the second dropdown.
3. Toggle on `invoice.paid` on the Stripe settings page.

### Failed payment email

Send an email from Loops when an invoice payment fails in Stripe.

1. Create a new workflow in Loops using our **Stripe - Payment Failed** template.
2. For the workflow trigger, select **Event received** and then select **Stripe** from the first dropdown and **invoice.payment\_failed** from the second dropdown.
3. Toggle on `invoice.payment_failed` on the Stripe settings page.

### Subscription created email

Send an email from Loops when a new subscription is created in Stripe.

1. Create a new workflow in Loops.
2. For the workflow trigger, select **Event received** and then select **Stripe** from the first dropdown and **customer.subscription.created** from the second dropdown.
3. Add an email node to the workflow and create your email.
4. Toggle on `customer.subscription.created` on the Stripe settings page.

### Quote accepted email

Send an email from Loops when a quote is accepted in Stripe.

1. Create a new workflow in Loops.
2. For the workflow trigger, select **Event received** and then select **Stripe** from the first dropdown and **quote.accepted** from the second dropdown.
3. Add an email node to the workflow and create your email.
4. Toggle on `quote.accepted` on the Stripe settings page.
