Stripe Connection
The Stripe connection integrates your Stripe account with OpsTower, giving agents the ability to query subscriptions, analyze revenue, review charges, and inspect invoices. All operations are read-only.
Prerequisites
Section titled “Prerequisites”You need a Stripe account with API access. Both live mode and test mode keys are supported.
Credentials Required
Section titled “Credentials Required”To set up a Stripe connection, you need:
- API Key — a restricted API key with read-only permissions (recommended) or a secret key
How to Create a Restricted API Key
Section titled “How to Create a Restricted API Key”For best security, create a restricted key that only has read access:
- In your Stripe account, go to Settings > Developers > API Keys.
- Click Create restricted key.
- Name it something like “OpsTower Read Only”.
- Set Read permission for the following resources:
- Balance and Balance Transactions — for revenue analysis
- Charges — for payment success/failure tracking
- Customers — for customer context
- Invoices — for billing history
- Subscriptions — for MRR and churn analysis
- Set None for all other resources.
- Click Create key and copy the key (starts with
rk_live_orrk_test_).
While OpsTower also accepts standard secret keys (sk_live_, sk_test_), restricted keys are strongly recommended because they limit the blast radius if the key is ever compromised. A restricted read-only key cannot create charges, modify subscriptions, or perform any write operations on your Stripe account.
Setting Up the Connection in OpsTower
Section titled “Setting Up the Connection in OpsTower”- In OpsTower, navigate to Connections in the sidebar.
- Click Add Connection and select Stripe.
- Enter your API Key.
- Click Test Connection to verify your credentials.
- Click Save to create the connection.
What Agents Can Do with Stripe
Section titled “What Agents Can Do with Stripe”Once connected and enabled on an agent, the agent can:
- Query subscriptions — list active, canceled, past-due, and trialing subscriptions with automatic MRR calculation, plan details, and billing periods
- Query revenue — analyze balance transactions for gross revenue, fees, and net income over any time range
- Query charges — review payment attempts including successful, failed, and refunded charges with failure reasons
- Query invoices — inspect invoices by status (paid, open, draft, void) with amounts due, paid, and outstanding
All monetary amounts from Stripe are in the smallest currency unit (e.g., cents for USD). Agents automatically convert these to readable dollar amounts in their responses.
Use Cases
Section titled “Use Cases”- Daily founder report: Include MRR, new subscriptions, churn, and failed payments alongside product analytics
- Revenue investigation: “Why did MRR drop this week?” — the agent queries canceled subscriptions and correlates with product data
- Payment health monitoring: Track failed charge rates and identify customers with past-due subscriptions
- Invoice auditing: Review outstanding invoices and billing trends
Troubleshooting
Section titled “Troubleshooting”- Authentication failed: Verify your API key is correct. Restricted keys start with
rk_live_(live mode) orrk_test_(test mode). - Permission denied on resource: If using a restricted key, ensure the relevant resource has Read permission. The error message from Stripe will indicate which permission is missing.
- No data returned: If using a test mode key (
rk_test_), only test mode data will be returned. Switch to a live mode key for production data. - Rate limited: Stripe allows 100 requests/second in live mode and 25 requests/second in test mode. OpsTower’s periodic queries are well within these limits.