---
title: "Connect Stripe"
description: "Show a customer's Stripe plan, invoices and failed payments next to the conversation, and let Kai answer billing questions."
url: https://help.gleap.ai/fr/articles/352-connect-stripe
collection: "Apps and integrations"
updated: 2026-11-22
language: fr
alternates: [en]
---

# Connect Stripe

Show a customer's Stripe plan, invoices and failed payments next to the conversation, and let Kai answer billing questions.

The Stripe integration puts billing context where support happens. A teammate opening a ticket sees what the customer pays for, their invoices and any failed payment, without switching to Stripe. Kai can answer billing questions from the same data and make the changes you allow. Only project admins can connect it, and it needs the Team plan or higher. Each project takes one Stripe account.

### Connect it

1.  Go to **Settings → Apps** and click **Add app**.
    
2.  Pick **Stripe**. Under **What should Stripe do?**, keep the jobs you want ticked and click **Continue with Stripe**.
    
3.  If the dialog offers **Connect with Stripe**, sign in to Stripe, pick the account and approve Gleap's permissions there. No key is stored that way.
    
4.  Otherwise, paste a restricted key into **Stripe restricted key** and click **Connect**. Under the key field, the switch **Match contacts by company domain when no Stripe customer has their exact email.** is on by default. More on it below.
    

![Stripe uses selection in the Pied Piper demo project.](https://staticfiles.gleap.io/p613b5dd730aed737108f87ab/5d6I9fiC03ll5xKJYyw0jI6rOju79BdVaQRCTJvgrZdG70lUgKp5CpQ3SL1tOenhav6vicSsAEO.png)

![Stripe restricted-key setup with the credential left empty in the Pied Piper demo project.](https://staticfiles.gleap.io/p613b5dd730aed737108f87ab/pBZ7zfBg9ePKLY5rnvrzqlxWF0jIKjNHc5Ro18mYuhVoj1qizvUWKYQdbchEfFGXhd6IsPb8EP8.png)

Gleap checks a key with Stripe before saving it. A publishable key, or a key that may not read customers, is refused with a message saying what to fix. Once it's connected, click **Done**. The Stripe card then shows in the sidebar of every ticket whose contact matches a Stripe customer.

> **Warning:** Use a restricted key rather than a full secret key, with only the permissions below. Lookups alone need read access to Customers, Subscriptions and Invoices.

<table style="min-width: 50px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p>Access</p></th><th colspan="1" rowspan="1"><p>Stripe resources</p></th></tr><tr><td colspan="1" rowspan="1"><p>Write</p></td><td colspan="1" rowspan="1"><p>Customers, Subscriptions, Invoices, Charges and Refunds, Customer portal</p></td></tr><tr><td colspan="1" rowspan="1"><p>Read</p></td><td colspan="1" rowspan="1"><p>Payment Intents, Payment Methods, Products, Prices, Coupons</p></td></tr></tbody></table>

### How a contact is matched to a Stripe customer

For the card in the inbox, three steps, in order:

1.  If the contact carries `stripeCustomerId` (a claim of the signed identity token, or custom data), that customer is used.
    
2.  Otherwise Gleap searches Stripe for a customer with exactly the same email address.
    
3.  If that finds nothing and the email is on a company domain, not a free provider like gmail.com, it searches for customers at that domain.
    

The domain step helps in B2B, where the person writing in is often not the one who pays. It's on by default. To turn it off, switch off **Match contacts by company domain when no Stripe customer has their exact email.** in the connect dialog or later in the Stripe settings.

Sending the customer id is still the reliable route. Put it in the signed identity token your backend creates for the logged-in user, as the `stripeCustomerId` claim. Kai then finds the customer directly, and the browser can't change it.

```javascript
// On your server, after the user logged in
const token = jwt.sign(
  { userId: String(user.id), email: "ada@example.com", stripeCustomerId: "cus_ABC123" },
  process.env.GLEAP_IDENTITY_SECRET,
  { algorithm: "HS256", keyid: process.env.GLEAP_IDENTITY_KEY_ID, expiresIn: "1h" }
);

// In your app
await Gleap.setUserJwt(token);
```

How to create the key and sign the token is in [Identify users and send attributes and events](https://help.gleap.ai/en/articles/230-identify-users-and-send-attributes-and-events.md).

### What you see

The customer, a failed payment if there is one, their subscriptions with status and renewal date, and their latest invoices. **Open in Stripe** jumps to the customer in Stripe, and keys from test mode show a **Test** badge.

The card also offers the billing actions you allow, such as **Portal link**, **Retry payment**, **Cancel at period end** or **Refund**. Each change goes through a confirm dialog and is logged on the ticket.

### Decide what Kai and your team may do

1.  Go to **Settings → Apps** and open Stripe.
    
2.  Under **Billing actions**, click **Open Apps** and set each action to **Allow**, **Ask first** or **Never**.
    
3.  Optionally, add a coupon id under **Retention discount**. It's the only discount Kai may offer, to customers about to cancel.
    

Every action that changes something starts as **Ask first**: the customer confirms on a card in the chat, or a teammate approves. Refunds can also take an **up to** limit. With **Allow** and a limit, Kai refunds on its own up to that amount and never more.

### Who counts as verified

Kai shows billing details in the chat only to a verified customer who is tied to their Stripe customer. Everyone else gets the billing portal link by email, sent to the billing email on file. Kai never uses the company-domain match, and never matches on details the customer typed.

With signed sessions on, you choose what verifies a customer under **Settings → Security → Customer identity → Customer authentication**. Each channel has one rule for identified users and one for leads and visitors. A channel set to **Default** follows the default rule:

-   **Messenger, identified users:** by default a signed login (the identity token your app sends) counts, and anyone without one can confirm an email code. You can require the signed login only.
    
-   **Leads and visitors, and every other channel:** they carry no signature, so the default rule applies, which is the email code unless you change it.
    

A verified customer is tied to their Stripe customer by the signed `stripeCustomerId`, by the signed user id in the **User id in Stripe metadata** field (the metadata key on your Stripe customers that holds your user id), or by the exact email they confirmed with the code.

Without signed sessions, only signed-in users whose user id Gleap verifies count, through the `stripeCustomerId` claim or the **User id in Stripe metadata** field. The email code doesn't unlock billing details there.

### The email code

When the rule allows the code, Kai asks for it in the conversation and Gleap sends 6 digits to the email on the contact. With no email on file, Kai can't verify the customer. The code is valid for 10 minutes, allows 3 attempts, and a new one can be sent every 30 seconds. How the customer enters it depends on the channel:

-   **Messenger:** a **Verify email** card in the chat.
    
-   **Email, WhatsApp, Instagram, Facebook, Slack and Telegram:** the customer replies in the thread with the 6 digits.
    
-   **Phone and Discord:** not supported yet.
    

Once confirmed, the customer stays verified for 30 minutes, as long as the contact's email doesn't change.

### When nothing shows

Usually the contact has no email address, or their email in Gleap isn't the one on the Stripe account. A work address in your product and a personal one in billing is enough to break the match. Putting `stripeCustomerId` in the identity token removes the guesswork.

> **Info:** Data is read from Stripe when the card loads, not copied into Gleap. Gleap keeps it for up to five minutes per contact; the reload button on the card fetches it again.

### Related

-   [Connect Chargebee](https://help.gleap.ai/en/articles/353-connect-chargebee.md)
    
-   [Identify users and send attributes and events](https://help.gleap.ai/en/articles/230-identify-users-and-send-attributes-and-events.md)
    
-   [Browse every integration and what it does](https://help.gleap.ai/en/articles/351-browse-every-integration-and-what-it-does.md)
