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

# Stripe

> Query Stripe payments, customers, invoices and subscriptions live from Explore and AI agents

The Stripe [live data source](https://docs.lightdash.com/integrations/live-data-sources) reads the charges, customers, invoices, subscriptions, refunds, disputes and balance transactions in one Stripe account.

## Before you start

* **A restricted API key** with the permissions below, from **Developers** → **API keys** in Stripe. Sandbox keys work too.

## Scopes

Give the key **Read** access to these resources.

| Resource | Why |
| - | - |
| **Charges**, **Refunds**, **Disputes** | Read payments, for **Charges**, **Refunds** and **Disputes** |
| **Customers**, **Invoices**, **Subscriptions** | Read billing, for **Customers**, **Invoices** and **Subscriptions** |
| **Balance transactions** | Reads money movements, for **Balance transactions** |

## Connect Stripe

[Add a live data source](https://docs.lightdash.com/integrations/live-data-sources/set-up-and-manage.md#connect-a-live-data-source), select **Stripe**, and enter the **Restricted API key**.

![The Add Stripe source dialog, with a Scopes card listing Charges, Refunds, Disputes, Customers, Invoices, Subscriptions and Balance transactions, an Authentication card with the Restricted API key field and a Test button, a Details card with the Name and Explore prefix fields, and the Add source button](https://mintcdn.com/lightdash/wHG54BS1PoXJYrUr/images/integrations/live-data-sources/stripe-config.png?fit=max\&auto=format\&n=wHG54BS1PoXJYrUr\&q=85\&s=97c82556be96ae82519c6f5c93899eba)

## Semantic layer

Amounts are in each record's currency, in whole units such as dollars or yen. Times are in UTC. Records come newest first.

### Charges

Charges in Stripe, one row per payment attempt, with its outcome and card

| Field | Description |
| - | - |
|  Charge ID | Stripe's ID for the charge, starting `ch_` |
|  Created | When the charge was created, in UTC |
|  Amount | Amount charged, in the currency’s whole units |
|  Amount refunded | Amount refunded so far, including partial refunds |
|  Currency | Three-letter ISO code, lowercase, such as `usd` |
|  Status | `succeeded`, `pending` or `failed` |
|  Paid | Whether the charge succeeded or was authorized for a later capture |
|  Captured | Whether the charge was captured |
|  Fully refunded | Whether the whole charge was refunded; a partial refund leaves it `false` |
|  Disputed | Whether the charge was disputed |
|  Customer ID | The customer charged, starting `cus_` |
|  Payment intent ID | The payment intent the charge belongs to, starting `pi_` |
|  Description | Free text the charge was created with |
|  Failure code | Why a failed charge failed, such as `card_declined` |
|  Failure message | Stripe’s explanation of the failure |
|  Outcome type | `authorized`, `manual_review`, `issuer_declined`, `blocked` or `invalid` |
|  Outcome reason | Why the charge was declined or blocked, such as `generic_decline` or `highest_risk_level` |
|  Risk level | Radar’s risk level: `normal`, `elevated` or `highest` |
|  Payment method type | `card`, `sepa_debit`, `us_bank_account` and so on |
|  Card brand | `visa`, `mastercard`, `amex` and so on; empty for other methods |
|  Card country | Two-letter country code of the card’s issuer |
|  Receipt email | Email the receipt was sent to |
|  Count | Number of charges that match the filters |

### Customers

Customers in Stripe, one row per customer

| Field | Description |
| - | - |
|  Customer ID | Stripe's ID for the customer, starting `cus_` |
|  Created | When the customer was created, in UTC |
|  Email | The customer’s email |
|  Name | The customer’s full name or business name |
|  Phone | The customer’s phone number |
|  Description | Free text kept on the customer |
|  Currency | The currency the customer is billed in; empty until it is first charged |
|  Balance | Credit (negative) or amount owed (positive) applied to the next invoice, in the currency’s whole units |
|  Delinquent | Whether the customer’s latest invoice or charge failed or is overdue |
|  Country | Two-letter country code of the customer’s address |
|  Count | Number of customers that match the filters |

### Invoices

Invoices in Stripe, one row per invoice, with what it is due and what was paid

| Field | Description |
| - | - |
|  Invoice ID | Stripe's ID for the invoice, starting `in_` |
|  Number | The number printed on the invoice; empty for drafts |
|  Created | When the invoice was created, in UTC |
|  Status | `draft`, `open`, `paid`, `uncollectible` or `void` |
|  Currency | Three-letter ISO code, lowercase, such as `usd` |
|  Customer ID | The customer billed, starting `cus_` |
|  Customer email | The customer’s email when the invoice was finalized |
|  Customer name | The customer’s name when the invoice was finalized |
|  Subscription ID | The subscription that billed it, starting `sub_`; empty for one-off invoices |
|  Billing reason | Why it was created, such as `subscription_create`, `subscription_cycle` or `manual` |
|  Collection method | `charge_automatically` or `send_invoice` |
|  Subtotal | Total before discounts and taxes |
|  Total | Total after discounts and taxes |
|  Amount due | What the customer owes once credit is applied |
|  Amount paid | What has been paid so far |
|  Amount remaining | What is still owed |
|  Payment attempts | How many times Stripe tried to collect payment |
|  Due date | When payment is due, in UTC; empty for invoices charged automatically |
|  Paid at | When the invoice was paid, in UTC |
|  Period start | Start of the period the invoice covers, in UTC |
|  Period end | End of the period the invoice covers, in UTC |
|  Count | Number of invoices that match the filters |

### Subscriptions

Subscriptions in Stripe, one row per subscription, with its status and price

| Field | Description |
| - | - |
|  Subscription ID | Stripe's ID for the subscription, starting `sub_` |
|  Created | When the subscription was created, in UTC |
|  Status | `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, `unpaid` or `paused` |
|  Customer ID | The customer subscribed, starting `cus_` |
|  Currency | Three-letter ISO code, lowercase, such as `usd` |
|  Collection method | `charge_automatically` or `send_invoice` |
|  Start date | When the subscription started, in UTC |
|  Trial start | When its trial started, in UTC |
|  Trial end | When its trial ends or ended, in UTC |
|  Cancels at period end | Whether it is set to cancel when the current period ends |
|  Canceled at | When it was canceled, in UTC; for a cancellation at period end, when that was asked for |
|  Ended at | When it ended, in UTC |
|  Cancellation reason | `cancellation_requested`, `payment_failed` or `payment_disputed` |
|  Latest invoice ID | Its most recent invoice, starting `in_` |
|  Price ID | The price it bills, starting `price_`; empty when it has several items |
|  Count | Number of subscriptions that match the filters |

### Refunds

Refunds in Stripe, one row per refund

| Field | Description |
| - | - |
|  Refund ID | Stripe's ID for the refund, starting `re_` |
|  Created | When the refund was created, in UTC |
|  Amount | Amount refunded, in the currency’s whole units |
|  Currency | Three-letter ISO code, lowercase, such as `usd` |
|  Status | `pending`, `requires_action`, `succeeded`, `failed` or `canceled` |
|  Reason | `duplicate`, `fraudulent`, `requested_by_customer` or `expired_uncaptured_charge` |
|  Charge ID | The charge refunded, starting `ch_` |
|  Payment intent ID | The payment intent refunded, starting `pi_` |

### Disputes

Disputes in Stripe, one row per chargeback or inquiry, with its deadline

| Field | Description |
| - | - |
|  Dispute ID | Stripe's ID for the dispute, starting `du_` |
|  Created | When the dispute was opened, in UTC |
|  Amount | Amount disputed, in the currency’s whole units |
|  Currency | Three-letter ISO code, lowercase, such as `usd` |
|  Status | `needs_response`, `under_review`, `won`, `lost` and the `warning_` states of inquiries |
|  Reason | The cardholder’s reason, such as `fraudulent`, `product_not_received` or `duplicate` |
|  Evidence due by | Deadline to submit evidence, in UTC |
|  Charge refundable | Whether the disputed charge can still be refunded |
|  Card brand | `visa`, `mastercard`, `amex` and so on |
|  Charge ID | The charge disputed, starting `ch_` |
|  Payment intent ID | The payment intent disputed, starting `pi_` |

### Balance transactions

Every movement of money in the Stripe balance, one row each, with its fee and net

| Field | Description |
| - | - |
|  Balance transaction ID | Stripe's ID for the transaction, starting `txn_` |
|  Created | When the transaction was created, in UTC |
|  Available on | When the funds become available to pay out, in UTC |
|  Amount | Gross amount, in the currency’s whole units |
|  Fee | Fees Stripe took, in the currency’s whole units |
|  Net | Amount less fees, in the currency’s whole units |
|  Currency | Three-letter ISO code of the balance, lowercase, such as `usd` |
|  Type | `charge`, `refund`, `payout`, `adjustment`, `stripe_fee` and about 60 more |
|  Reporting category | Stripe’s grouping for reports, such as `charge`, `refund`, `dispute` or `fee` |
|  Status | `available` or `pending` |
|  Description | What the transaction is for |
|  Source ID | The object that moved the money, such as a charge (`ch_`) or refund (`re_`) |
|  Exchange rate | Rate used to convert into the balance currency; empty when none was needed |

## Limits

| Limit | Value |
| - | - |
| Most rows per query | 1,000 |
| Filter conditions per query | 10, with a date range counting as two |
| Filters | Dates, IDs and a few fields such as status and currency, one value each |
| Count | Can't be split by a field |
| Region | Charges, Customers, Invoices and Subscriptions aren't available to Stripe accounts in India |


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