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

# Stripe

> Each completed payment or paid invoice in Stripe creates the Contact of whoever paid and their Company.

## What it brings into Brein

When a customer pays, Brein creates or fills in their **Contact** and their **Company** (by the domain of their work email). If you ask at connect time, it also opens an **Opportunity**. Brein does not mark anything as won: it only records the person and what happened.

| From Stripe | Goes to |
| - | - |
| Customer name | Contact name |
| Customer email | Contact email |
| Customer phone | Contact phone |

## Connect it

Stripe generates its own signing secret, so the order changes: the address first, the secret after.

<Steps>
  <Step title="In Brein">
    Go to **Settings → Integrations → Connect → Stripe** and copy the **address**.
  </Step>

  <Step title="In Stripe">
    Open **Workbench**, go to the **Webhooks** tab and create an event destination. Paste the address and choose the events below.
  </Step>

  <Step title="Copy the signing secret">
    On the destination you created, the signing secret starts with `whsec_`. Click **Reveal secret** and copy it.
  </Step>

  <Step title="Paste it in Brein">
    In the Integration, paste the secret and save. Until you paste it, Brein rejects every notice for this Integration.
  </Step>
</Steps>

## Which events to choose

* `checkout.session.completed`: a completed payment.
* `invoice.paid`: a paid invoice.

Brein ignores any other event you check.

## Limits

* Brein takes the person from the payment's customer data (`customer_details`) or from the invoice (`customer_name`, `customer_email`, `customer_phone`). A payment with no email or phone arrives as **no person**.
* If the person pays with a free email, the Contact is created but the Company is not.
* When you change or rotate the secret in Stripe, paste the new one in Brein. The old one stays valid for 24 hours.

More about results, how people are recognized and privacy: [Integrations](/integrations). Source: [Stripe webhooks](https://docs.stripe.com/webhooks).


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