Revenue Intelligence · Setup Guide

Stripe Integration

Follow these steps to configure your Stripe integration with ThriveStack Revenue Intelligence.


Before you begin

Prerequisites

Required Access to the Stripe account
Required Stripe Account ID

1 Set up the Stripe connector

Open the ThriveStack Revenue setup page and complete the connector configuration:

1

Map Environments

Map your Stripe environment to your Application environment in ThriveStack.

2

Basic Configuration

Add account details and Stripe key required to sync your Stripe data.

3

Test your Stripe Connection

Test the configuration that you have set up.

4

Start Ingestion

Trigger the data sync from your Stripe account to your app environment in ThriveStack.

5

Test and save

Save and validate the connection.

2 Get Account ID & Secret Key

1

Get Account ID from URL

In the Stripe dashboard, copy your Account ID from the URL (begins with acct_...).
Example: https://dashboard.stripe.com/acct_1A2b3C4d5EfGhIjKlMn0pQrS

2

Create Restricted Secret Key

Create a new Restricted Secret Key with custom permissions.

Open Stripe API Keys

How to create a Restricted Secret Key (Read-only):

  1. In the Stripe Dashboard, open Developers from the left sidebar, then go to API keys.
  2. Click + Create restricted key.
  3. Add the key name and URL: https://app.thrivestack.ai.
  4. Set Read access for the following resources:
customers invoices invoice_items invoice_line_items plans prices products subscriptions subscriptions_items balance_transactions transactions charges disputes refunds payment_intent
  1. Click Create restricted key.
  2. Copy the generated token for the newly created key from the Restricted Keys list.

See the video below for a visual reference on creating the restricted key.

How to create a Stripe restricted key

3 Enable Correlation between Product and Revenue

Add a group_id metadata field to each Stripe customer — this must match the group_id sent in your product telemetry so ThriveStack can link revenue to product usage. View product telemetry reference

Provide this prompt to an AI assistant with access to your codebase. The AI will review the ThriveStack Instrumentation Guide and automatically add the group_id metadata to your Stripe customers.

Cursor
Copilot
Claude
Windsurf
Lovable
You are a ThriveStack revenue intelligence installation wizard.
Read https://docs.thrivestack.ai/ai-setup/revenue/llms.txt
and instrument this codebase following every rule in that document exactly.
The revenue source to instrument is Stripe.
The account identifier key to use is "group_id".
  1. Open your AI coding tool with your project
  2. Paste the prompt above into the chat
  3. Review suggested changes before applying

Creating new Stripe customers

curl https://api.stripe.com/v1/customers \
  -u sk_test_YOUR_SECRET_KEY: \
  -d "email=customer@example.com" \
  -d "metadata[group_id]=<account_id_from_product_telemetry>"

Updating existing Stripe customers

curl https://api.stripe.com/v1/customers/<CUSTOMER_ID> \
  -u sk_test_YOUR_SECRET_KEY: \
  -d "metadata[group_id]=<account_id_from_product_telemetry>"

Reference: Stripe Customer API docs

Verify: Run the flow in your application where a customer is created in Stripe. Then open the customer record in the Stripe Dashboard — scroll to the Metadata panel on the right and confirm group_id is present.
Stripe customer Metadata panel showing group_id

Next steps

Once your Stripe connection is active, instrument your billing code so ThriveStack can link revenue to product usage.