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

# Stripe

In this section, we present how to connect Stripe to MindsDB.

[Stripe](https://stripe.com/) is a financial technology company that provides a set of software and payment processing solutions for businesses and individuals to accept payments over the internet. Stripe is one of the leading payment gateway and online payment processing platforms.

Data from Stripe can be utilized within MindsDB to train AI models and chatbots based on customers, products, and payment intents, and make relevant predictions and forecasts.

## Prerequisites

Before proceeding, ensure the following prerequisites are met:

1. Install MindsDB locally via [Docker](/setup/self-hosted/docker) or [Docker Desktop](/setup/self-hosted/docker-desktop).
2. To connect Stripe to MindsDB, install the required dependencies following [this instruction](/setup/self-hosted/docker#install-dependencies).
3. Install or ensure access to Stripe.

## Connection

This handler was implemented using [stripe-python](https://github.com/stripe/stripe-python), the Python library for the Stripe API.

There is only one parameter required to set up the connection with Stripe:

* `api_key`: a Stripe API key.

<Tip>
  You can find your API keys in the Stripe Dashboard. [Read more](https://stripe.com/docs/keys).
</Tip>

To connect to Stripe using MindsDB, the following CREATE DATABASE statement can be used:

```sql theme={null}
CREATE DATABASE stripe_datasource
WITH ENGINE = 'stripe',
PARAMETERS = {
  "api_key": "sk_..."
};
```

## Usage

Now, you can query the data in your Stripe account (customers, for example) as follows:

```sql theme={null}
SELECT * FROM stripe_datasource.customers
```

You can run more advanced queries to fetch specific customers in a defined order:

```sql theme={null}
SELECT  name, email
FROM stripe_datasource.customers
WHERE currency = 'inr'
ORDER BY name
LIMIT 5
```

### Supported tables

The following tables are supported by the Stripe handler:

* `customers`
* `products`
* `payment_intents`
