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

# Stripe

> Sync billing data read-only and trigger automations on Stripe events

export const Prompt = ({text, variant = 'accent'}) => {
  const [copied, setCopied] = useState(false);
  const handleCopy = async () => {
    try {
      await navigator.clipboard.writeText(text);
      setCopied(true);
      setTimeout(() => setCopied(false), 2000);
    } catch {}
  };
  const clipboardIcon = <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
            <title>Copy</title>
            <rect x="9" y="9" width="13" height="13" rx="2" ry="2" />
            <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
        </svg>;
  const checkIcon = <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
            <title>Copied</title>
            <polyline points="20 6 9 17 4 12" />
        </svg>;
  const promptIcon = <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style={{
    flexShrink: 0,
    opacity: 0.4
  }}>
            <title>Prompt</title>
            <path d="M20 2H2v20h2V4h16v12H6v2H4v2h2v-2h16V2zM6 7h12v2H6zm8 4H6v2h8z" />
        </svg>;
  return <div className={`prompt prompt-${variant}`} style={{
    marginTop: '12px',
    marginBottom: '12px'
  }}>
            {promptIcon}
            <span className="prompt-text">{text}</span>
            <button className="prompt-copy" onClick={handleCopy} title="Copy to clipboard" type="button">
                {copied ? checkIcon : clipboardIcon}
            </button>
        </div>;
};

The Stripe integration syncs a read-only mirror of your billing data into Modem: customers, subscriptions, products and prices, invoices, charges, disputes, and refunds. Billing events become [automation](/features/automations) triggers, and the Modem Agent can query billing data alongside your conversations and act on what it finds.

<Info>
  Access is **read-only**. Modem connects through an official Stripe App using OAuth. There are no API keys to copy, and you can revoke
  access from your Stripe dashboard at any time. Modem never sees card numbers or payment credentials.
</Info>

## Prerequisites

* Administrator access to the Stripe account you want to connect
* Admin or owner role in your Modem organization

## Setup

<Steps>
  <Step title="Start the connection">
    Go to **Settings** → **Integrations** → **Stripe** in your Modem dashboard and click **Connect Stripe**.
  </Step>

  <Step title="Install the Modem app">
    You'll be redirected to Stripe to install the Modem app on your account. Review the read-only permissions and approve the install.
  </Step>
</Steps>

After installation, Modem automatically begins a historical backfill of your billing data and starts receiving new billing events in real time. The settings page shows **Initial sync in progress** until the backfill completes.

## What Gets Synced

Modem keeps a read-only mirror of the following Stripe objects, updated in real time via webhooks with automatic reconciliation:

* **Customers**: names and emails, so billing activity can be matched to Modem [people](/guides/people) and companies
* **Subscriptions**: status, plan, trial dates, and cancellation state
* **Products and prices**: so automations and the agent can name the plan and amount involved
* **Invoices**: status, amounts, due dates, and payment attempts
* **Charges and refunds**: payment outcomes and failure codes
* **Disputes**: status, reason, and evidence deadlines

<Note>If your install grants test-mode access only, the settings page shows a **Test mode** badge on the connection.</Note>

## Automation Triggers

Connecting Stripe adds billing events as [automation](/features/automations) triggers. When an event fires, its details are automatically added to your automation's prompt as context.

| Trigger                  | Fires when                           |
| ------------------------ | ------------------------------------ |
| Customer is created      | A new customer appears in Stripe     |
| Subscription starts      | A new subscription is created        |
| Subscription is canceled | A subscription is canceled           |
| Trial is ending          | A subscription trial is about to end |
| Payment fails            | An invoice payment attempt fails     |

The initial backfill never fires automation triggers, so connecting an account with years of history won't flood your channels.

### Example automations

<Prompt text="When a subscription is canceled, review this customer's recent conversations and post a churn analysis to #retention" />

<Prompt text="When a trial is ending, check for open topics from this customer and alert #sales" />

<Prompt text="When a payment fails, alert #billing with the invoice details and any recent conversations with this customer" />

## Agent Capabilities

The Modem Agent can query your synced billing data alongside conversations, topics, people, and companies, and act on what it finds: posting summaries, alerting channels, or creating tickets.

### Example prompts

<Prompt text="Which paying customers reported bugs this month?" />

<Prompt text="List subscriptions that canceled in the last 30 days and summarize what each customer was talking about beforehand" />

<Prompt text="How much MRR is on trials ending in the next two weeks?" />

<Prompt text="File a ticket for the bug our highest-revenue customer reported last week, and note their plan in the description" />

## Troubleshooting

<AccordionGroup>
  <Accordion title="The settings page shows 'Initial sync in progress'">
    The historical backfill runs in the background after connecting and can take a while for accounts with a lot of history. New billing
    events are processed in real time even while the backfill is running.
  </Accordion>

  <Accordion title="The connection shows an error or asks to reconnect">
    Stripe access tokens are refreshed automatically. If the connection shows an error or a reconnect prompt, click **Reconnect** on
    **Settings** → **Integrations** → **Stripe** to re-authorize. This is safe and won't duplicate data.
  </Accordion>

  <Accordion title="Automations aren't firing on billing events">
    Verify the automation is **Enabled** and its trigger matches the event you expect. Note that historical data imported during the
    initial backfill never fires triggers. Only new events after connecting do.
  </Accordion>

  <Accordion title="Billing data looks stale">
    Data updates in real time via webhooks, with a periodic reconciliation pass that catches anything missed. If a specific object looks
    out of date for more than a few minutes, contact [support@modem.dev](mailto:support@modem.dev).
  </Accordion>
</AccordionGroup>

## Disconnecting

To disconnect Stripe:

1. Go to **Settings** → **Integrations** → **Stripe**
2. Click **Disconnect**

This revokes Modem's access to your Stripe account and stops new data from syncing. You can also uninstall the Modem app directly from your Stripe dashboard under **Settings** → **Installed apps**. Historical data remains in Modem after disconnecting.

## Related

<CardGroup cols={2}>
  <Card title="Automations" icon="https://mintcdn.com/modem-844d7a4a/Wr2r4IRr97lNQiQb/icons/bot-bolt.svg?fit=max&auto=format&n=Wr2r4IRr97lNQiQb&q=85&s=dda761a2f7042ebc27c668cc644df76c" href="/features/automations" width="22" height="22" data-path="icons/bot-bolt.svg">
    Run the agent on a schedule or when billing events fire.
  </Card>

  <Card title="The Modem Agent" icon="https://mintcdn.com/modem-844d7a4a/Wr2r4IRr97lNQiQb/icons/bot.svg?fit=max&auto=format&n=Wr2r4IRr97lNQiQb&q=85&s=2496f9106cb54fa9f4e27ad1f8f3a171" href="/features/agent" width="22" height="22" data-path="icons/bot.svg">
    Query your data and take action from one conversation.
  </Card>

  <Card title="Companies & People" icon="https://mintcdn.com/modem-844d7a4a/Wr2r4IRr97lNQiQb/icons/contact.svg?fit=max&auto=format&n=Wr2r4IRr97lNQiQb&q=85&s=727cb0ef6c8547993c6acfdaa30bd837" href="/guides/people" width="24" height="24" data-path="icons/contact.svg">
    How Modem models the people and companies behind your revenue.
  </Card>
</CardGroup>
