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

# Connect Stripe to your AI agent

> Connect Stripe so your AI agent can securely show customers their subscriptions, invoices, and billing details

The Chatbase Stripe integration connects your Stripe account to your AI agent, so signed-in customers can check their subscription, review invoices, change plans, and update billing details in the chat bubble on your website. It's built for subscription businesses, such as SaaS products, memberships, and online services, that bill customers through Stripe. Once Stripe is connected, you choose what the AI agent can do by enabling [Stripe Actions](https://chatbase.co/docs/user-guides/chatbot/actions/stripe-action.md).

Integrating Stripe with Chatbase lets your AI agent access and display key billing information directly to customers. The AI agent can securely retrieve and show subscriptions and invoice history, which streamlines common billing inquiries and gives customers a clear view of their payment status, all within the chat.

> [card] What you can do:
>
> Answer "what am I paying?", "when does it renew?", and "was my payment processed?" instantly, from live Stripe data, without a human touching the ticket.

## What customers can do once Stripe is connected

Connecting Stripe doesn't change what your AI agent does on its own. Each capability is a [Stripe Action](https://chatbase.co/docs/user-guides/chatbot/actions/stripe-action.md) that you create and enable:

| Stripe Action | What customers can do | Example request |
| - | - | - |
| [Get subscription information](https://chatbase.co/docs/user-guides/chatbot/actions/stripe-action.md#1-get-subscription-information) | See their current plan, status, billing cycle, and pricing | "When does my subscription renew?" |
| [Get invoice history](https://chatbase.co/docs/user-guides/chatbot/actions/stripe-action.md#2-get-invoice-history) | Review invoices, payment details, and billing records | "Was my payment processed?" |
| [Manage subscriptions](https://chatbase.co/docs/user-guides/chatbot/actions/stripe-action.md#3-manage-subscriptions) | Upgrade, downgrade, add a payment method, or cancel | "I want to upgrade my plan" |
| [Change billing information](https://chatbase.co/docs/user-guides/chatbot/actions/stripe-action.md#4-change-billing-information) | Update their billing address, email, or phone number | "I need to update my billing address" |

Get subscription information and Get invoice history only read data from Stripe. Manage subscriptions and Change billing information change data in Stripe, so they deserve the most testing before you turn them on.

## Example: a customer asks when their plan renews

A customer signed in to your website opens the chat bubble and asks, "When does my subscription renew?"

1. Your site has already identified the customer with [identity verification](https://chatbase.co/docs/developer-guides/website-integration/identity-verification.md), so Chatbase knows their user ID.
2. Chatbase matches that user ID to the customer's contact record, which holds their Stripe account ID.
3. The AI agent calls the Get subscription information Action, which reads only that customer's subscription from Stripe.
4. The AI agent replies with the renewal date and plan details from live Stripe data. No one on your team has to open a ticket.

If the customer isn't signed in, or their contact record has no Stripe account, the AI agent has no Stripe customer to look up, so the Action can't run.

## Security and permissions

Stripe Actions are built so each customer sees and changes only their own billing data:

* **Customers must be identified.** Every Stripe Action reads or writes the signed-in customer's own Stripe record, matched through their contact record. Anonymous visitors can't use them.
* **Stripe IDs stay hidden from the AI agent.** When you pass Stripe account IDs in an identity verification token, the AI agent can't see them, but it can use them to run Stripe Actions. See [Identity verification](https://chatbase.co/docs/developer-guides/website-integration/identity-verification.md).
* **You choose how much access Chatbase gets.** The [Stripe app](#method-1-install-the-stripe-app) is the recommended way to connect. It has read and write access, because Actions such as Manage subscriptions and Change billing information update customers and subscriptions. A [restricted API key](#method-2-connect-with-a-restricted-api-key) lets you grant only the permissions the Actions you use need. If a key doesn't grant what an Action needs, that Action can return no data.
* **Compliance.** Chatbase is SOC 2 Type II, GDPR, and HIPAA compliant, and Stripe is one of the [HIPAA compliant integrations](https://chatbase.co/docs/user-guides/workspace/hipaa-compliance.md#hipaa-compliant-integrations).

## Before you start

* A Chatbase account with an AI agent. If you haven't built one yet, [create a free Chatbase account](https://www.chatbase.co/auth/signup) and follow [Your first AI agent](https://chatbase.co/docs/user-guides/quick-start/your-first-agent.md).
* A Stripe account you can authorize, or a restricted API key from it.

## Connection methods

| Method | When to use it |
| - | - |
| [Install the Stripe app](#method-1-install-the-stripe-app) | The recommended option for most stores |
| [Connect with a restricted API key](#method-2-connect-with-a-restricted-api-key) | When you want granular control over the permissions Chatbase gets |

## Method 1: Install the Stripe app

**1. Open the Stripe integration**

1. Head to your [dashboard](https://www.chatbase.co/dashboard/) and click the AI agent you wish to integrate with Stripe.
2. Click **Integrations** in the left sidebar.
3. Click **Connect** under the Stripe card.

![The Connect button on the Stripe card in Integrations](https://mintcdn.com/chatbase/bO49Edenw4JMFhBZ/user-guides/integrations/images/stripe/integrations-stripe.png?fit=max\&auto=format\&n=bO49Edenw4JMFhBZ\&q=85\&s=f16c6f36d335e358f53ab4dbf8542e95)

**2. Authorize Chatbase**

You'll be asked to authorize Chatbase to access your Stripe account.

![Authorizing Chatbase to access Stripe](https://mintcdn.com/chatbase/kU-6NVMb2BBkym9H/user-guides/integrations/images/stripe/stripe-install-chatbase.png?fit=max\&auto=format\&n=kU-6NVMb2BBkym9H\&q=85\&s=f2d7da7d567f0d01762a83180f9aef42)

After clicking **Continue**, choose the account you want to connect.

![Choosing which Stripe account to connect](https://mintcdn.com/chatbase/kU-6NVMb2BBkym9H/user-guides/integrations/images/stripe/stripe-select-account.png?fit=max\&auto=format\&n=kU-6NVMb2BBkym9H\&q=85\&s=9a0d447c186f93ee3506dcc92d123626)

**3. Confirm the connection**

If all goes well, you're redirected back to Chatbase with a message saying **Stripe integration successful**.

**4. Add Stripe accounts to your contacts**

Add Stripe account IDs to your customers' contact records. See [Contacts](https://chatbase.co/docs/user-guides/chatbot/contacts/uploading-contacts.md) for details.

## Method 2: Connect with a restricted API key

Connecting with a restricted API key gives you more control, letting you choose exactly which Stripe permissions Chatbase can access.

**1. Open the Stripe integration**

Go to **Integrations** and select **Stripe**.

**2. Choose restricted API key**

Click **Connect**, then select **Use a restricted API key**.

**3. Configure permissions in Stripe**

Create a restricted API key in Stripe and grant the permissions the Actions you plan to use need. Chatbase lists them for the Actions you pick on the connect page.

| Action | Stripe permissions |
| - | - |
| Get subscription information | Subscriptions: Read, Products: Read, Payment Methods: Read |
| Get invoice history | Invoices: Read |
| Change billing information | Customers: Read and Write |
| Manage subscriptions | Customers: Read and Write, Subscriptions: Read and Write, Products: Read, Prices: Read, Payment Methods: Read, Payment Intents: Read, Invoices: Read, Setup Intents: Write |

**4. Connect the key**

Copy the restricted API key from Stripe and use it to complete the connection in Chatbase.

> [!NOTE]
>
> Connecting through the Stripe app is still the recommended option. Use a restricted API key when you want more granular control over the permissions granted to Chatbase.

> [!TIP]
>
> Test the integration from your live site, signed in as an identified customer, and confirm the AI agent can retrieve that customer's subscription details.

## Setup checklist

Use this list to go from a connected Stripe account to Stripe Actions working on your site:

1. Connect Stripe with the [Stripe app](#method-1-install-the-stripe-app) or a [restricted API key](#method-2-connect-with-a-restricted-api-key).
2. Set up [identity verification](https://chatbase.co/docs/developer-guides/website-integration/identity-verification.md) on your website so signed-in customers are identified to your AI agent.
3. Make sure each customer's [contact](https://chatbase.co/docs/user-guides/chatbot/contacts/contacts-overview.md) holds their Stripe account ID. Identity verification can add it for you when you include `stripe_accounts` in the token: a list of entries, each with a `label` and a `stripe_id` or `stripe_email`.
4. Create the [Stripe Actions](https://chatbase.co/docs/user-guides/chatbot/actions/stripe-action.md) you want under **Build > Actions**, and write a clear **When to use** for each.
5. Turn each Action on for the **Chat Bubble** channel, the only channel Stripe Actions support.
6. Test in the [Playground](https://chatbase.co/docs/user-guides/chatbot/playground.md#chat-as-user) with **Chat as user** and the **User ID** of a contact with a valid Stripe account.
7. [Publish](https://chatbase.co/docs/user-guides/chatbot/versions.md) your changes, then test from your live site, signed in as a real customer.

## Limitations

* **Stripe Actions need an authenticated customer.** Each customer must be identified, and matched to a contact record holding their `stripe_accounts`.
* **In the Playground, they only run through Chat as user.** Start the conversation with [Chat as user](https://chatbase.co/docs/user-guides/chatbot/playground.md#chat-as-user) and a **User ID** that matches a contact with a valid `stripe_accounts` entry. **Action Preview** and **Compare** can't identify a customer, so the Actions don't run there.

## Frequently asked questions

> [accordion] What can my AI agent do with Stripe?
>
> With [Stripe Actions](https://chatbase.co/docs/user-guides/chatbot/actions/stripe-action.md) enabled, it can show a signed-in customer their subscription and invoice history, change or cancel their plan, add a payment method, and update their billing details. You choose which of these Actions to turn on.

> [accordion] Should I use the Stripe app or a restricted API key?
>
> The Stripe app is the recommended option for most businesses. Use a restricted API key when you want granular control over exactly which Stripe permissions Chatbase gets.

> [accordion] Can customers who aren't signed in use Stripe Actions?
>
> No. Stripe Actions need an identified customer whose contact record holds a valid Stripe account ID. Set up [identity verification](https://chatbase.co/docs/developer-guides/website-integration/identity-verification.md) so your site identifies signed-in customers to your AI agent.

> [accordion] Which channels support Stripe Actions?
>
> Only the **Chat Bubble** on your website. Every other channel is incompatible with Stripe Actions.

> [accordion] Which plans include Stripe Actions?
>
> Connecting Stripe needs the Basic plan or higher. Stripe Actions count toward your plan's Action limit: up to 8 Actions on Basic and up to 12 on Business. On Enterprise, the limit is customizable.

> [accordion] Do Stripe Actions use extra message credits?
>
> Yes. A reply that triggers an Action costs twice the model's usual message credits. See [Credit usage](https://chatbase.co/docs/user-guides/chatbot/actions/actions-overview.md#credit-usage).

## Next steps

> [card] [Stripe Actions](https://chatbase.co/docs/user-guides/chatbot/actions/stripe-action.md)
>
> Enable the Actions that let customers check their subscription, review invoices, change plans, and update billing details from the chat.


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