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

# Stripe Integration

> Sync revenue data from Stripe to power segments and automations

Connect your Stripe account to automatically sync revenue metrics for all your subscribers. This enables powerful segmentation based on MRR and LTV.

## Connecting Stripe

1. Go to **Settings → Integrations**
2. Click **Connect** next to Stripe
3. Authorize Sequenzy to access your Stripe account
4. Review the Stripe setup step and save your sync settings

## Setup Options

Before the first sync starts, you can control how Stripe data should flow into Sequenzy:

* **Products to sync**: You choose which Stripe products count as relevant. For paid customers, Sequenzy syncs people who made a payment in one of those products.
* **Sync users without any payment ever**: You can keep Stripe users with a real trial or subscription in sync before their first payment. Customers created from abandoned payment pages stay excluded. If you also selected products, those users still need to be tied to one of the selected products.
* **Products to watch in webhooks**: You can limit webhook-driven updates to a subset of the synced products. Products removed from sync are automatically disabled here too.
* **Lists for new subscribers**: You choose which lists new Stripe-synced subscribers should join. The default is your workspace **Default Lists** setting. Switch to **Specific lists** to target a curated set, or select nothing to keep Stripe-synced subscribers out of every list. Existing subscribers are never moved by this setting.
* **Extra metadata to carry over**: You can pick suggested metadata keys from sampled Stripe customer and subscription records, or add any custom keys you want to copy into subscriber attributes.

If Stripe is already connected, open **Settings → Integrations** and click the gear icon next to Stripe to update these settings later.

## Discount Code Automations

Sequences can include dynamic discount steps that create Stripe coupons and subscriber-specific promotion codes when each subscriber reaches the step, before later emails send. These steps require write access to your Stripe account.

If you connected Stripe before discount code support was added, reconnect Stripe from **Settings → Integrations** so Sequenzy can request the updated coupon and promotion-code permissions.

### Initial Sync

When you connect Stripe, Sequenzy performs a full sync of your entire customer base. This means:

* **Eligible customers** are matched to subscribers by email based on your Stripe setup settings
* **MRR and LTV** are calculated for each matched subscriber
* **Tags are applied** based on current subscription status
* **Historical data** is available immediately—no waiting period

The initial sync processes customers in batches, so large customer bases are handled efficiently without API rate limits.

## Synced Attributes

When connected, Sequenzy adds these attributes to each subscriber matched by email:

| Attribute | Type   | Description                                                                 |
| --------- | ------ | --------------------------------------------------------------------------- |
| `mrr`     | Number | Monthly Recurring Revenue in dollars (normalized from any billing interval) |
| `ltv`     | Number | Lifetime Value - total payments minus refunds                               |

### MRR Calculation

MRR is normalized from any billing interval:

* **Monthly**: Used as-is
* **Yearly**: Divided by 12
* **Weekly**: Multiplied by 52, then divided by 12
* **Daily**: Multiplied by 365, then divided by 12

Only `active` and `trialing` subscriptions count toward MRR.

### LTV Calculation

LTV sums all successful charges for a customer, minus any refunds. This gives you the true lifetime value accounting for partial refunds.

One-time purchases made through Stripe Checkout or Payment Links are included
when the Checkout Session is attached to a Stripe Customer. Guest Checkout
Sessions without a Stripe Customer are not part of the customer-scoped revenue
sync.

## Automatic Tags

Sequenzy automatically applies tags to subscribers based on their Stripe subscription status:

| Tag            | Applied When                                    |
| -------------- | ----------------------------------------------- |
| `customer`     | Has an active or past\_due subscription         |
| `trial`        | Currently in a trial period                     |
| `past-due`     | Payment failed, subscription past due           |
| `cancelled`    | Subscription set to cancel at period end        |
| `churned`      | Subscription has ended (no active subscription) |
| `saas.monthly` | On a monthly billing interval                   |
| `saas.yearly`  | On a yearly billing interval                    |

These tags update automatically whenever subscription status changes via webhooks.

## Using Revenue Data

### Complex Segments

With MRR and LTV synced as numeric attributes, you can create sophisticated segments:

**Revenue-based segments:**

* `mrr >= 100` — High MRR customers
* `ltv > 1000` — Lifetime high-value customers
* `mrr >= 50 AND mrr < 200` — Mid-tier customers

**Combining with tags:**

* `tag = churned AND ltv > 500` — High-value churned customers (win-back targets)
* `tag = past-due AND mrr >= 100` — At-risk high-value customers needing attention
* `tag = trial AND mrr = 0` — Trial users who haven't converted yet
* `tag = saas.yearly AND mrr >= 100` — Yearly enterprise customers

**Combining with engagement:**

* `mrr >= 50 AND opened_emails_last_30_days = 0` — Paying but disengaged customers
* `ltv > 500 AND clicked_emails_last_30_days > 0` — Engaged high-value customers

### Automations

Trigger automations when revenue attributes change:

* Send a thank-you email when `ltv` exceeds a threshold
* Trigger a win-back sequence when a subscriber gets the `churned` tag
* Notify your team when a high-value customer's payment fails (`past-due` tag)

Stripe lifecycle webhooks and revenue syncs can also trigger built-in events:

| Event                  | Triggered when                                                      |
| ---------------------- | ------------------------------------------------------------------- |
| `saas.cancelled`       | A subscription is scheduled to cancel                               |
| `saas.trial_cancelled` | A trialing subscription is set to cancel before it converts to paid |
| `saas.churn`           | A subscription ends and the customer no longer has active access    |
| `saas.payment_failed`  | A subscription invoice payment fails                                |

## Manual Sync

To re-sync revenue data at any time:

1. Go to **Settings → Integrations**
2. Find your connected Stripe account
3. Click **Sync Revenue**

The sync processes all Stripe customers and updates matching subscribers. Large customer bases are processed in batches automatically.

## How Matching Works

Subscribers are matched by email address (case-insensitive). A Stripe customer with email `User@Example.com` will match a subscriber with email `user@example.com`.

If a Stripe customer doesn't have an email or doesn't match any subscriber, they're skipped during sync.

## Default Segments

When you connect Stripe, Sequenzy automatically creates three segments to help you get started:

* **Customers (Low MRR)**: Subscribers with `mrr < 50` who have the `customer` tag
* **High Spenders**: Subscribers with `ltv > 500`
* **Churned High Spenders**: Subscribers with the `churned` tag and `ltv > 500`

You can customize or delete these segments at any time.
