> ## 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.

# Paddle Integration

> Sync revenue data from Paddle to power segments and automations

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

## What is Paddle?

[Paddle](https://paddle.com) is a complete payments infrastructure for SaaS companies. It handles payments, subscriptions, tax compliance, and more as a Merchant of Record, so you don't have to worry about sales tax, VAT, or payment processing complexities.

## Connecting Paddle

Paddle requires manual API key and webhook setup. Here's how to connect:

### Step 1: Get Your Paddle API Key

1. Go to your [Paddle Dashboard](https://vendors.paddle.com)
2. Navigate to **Developer Tools → Authentication**
3. Create a new **API Key**
4. Copy the API key (format: `pdl_live_xxxxxxxxx` or `pdl_test_xxxxxxxxx`)

<Warning>
  Your API key is only shown once. Store it securely before closing the dialog.
</Warning>

### Step 2: Find Your Seller ID

1. In the Paddle Dashboard, go to **Settings**
2. Your **Seller ID** is displayed at the top (a numeric ID like `123456`)
3. Copy this ID for later

### Step 3: Set Up Webhooks in Paddle

1. In Paddle, go to **Developer Tools → Notifications**
2. Click **Create destination**
3. Select **Webhook** as the destination type
4. Enter your Sequenzy webhook URL:
   ```
   https://api.sequenzy.com/webhooks/paddle/{your-company-id}
   ```
   <Note>
     You can find this URL in Sequenzy when connecting Paddle—it's automatically shown in the connection modal.
   </Note>
5. Select these events to listen for:
   * `subscription.created`
   * `subscription.updated`
   * `subscription.canceled`
   * `subscription.paused`
   * `subscription.resumed`
   * `subscription.activated`
   * `subscription.trialing`
   * `subscription.past_due`
   * `transaction.completed`
   * `transaction.payment_failed`
   * `adjustment.created`
6. Click **Save** to create the notification destination
7. Copy the **Secret Key** from the notification destination settings

### Step 4: Connect in Sequenzy

1. Go to **Settings → Integrations** in Sequenzy
2. Click **Connect** next to Paddle
3. Enter your:
   * **Seller ID** (from Step 2)
   * **API Key** (from Step 1)
   * **Webhook Secret Key** (from Step 3)
4. Click **Connect Paddle**

Sequenzy will immediately begin receiving webhook events from Paddle.

## 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` subscriptions count toward MRR.

## Automatic Tags

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

| Tag            | Applied When                             |
| -------------- | ---------------------------------------- |
| `customer`     | Has an active subscription               |
| `cancelled`    | Subscription set to cancel at period end |
| `churned`      | Subscription has ended                   |
| `saas.monthly` | On a monthly billing interval            |
| `saas.yearly`  | On a yearly billing interval             |

These tags update automatically whenever subscription status changes via webhooks.

## Tracked Events

When you connect Paddle, these events are automatically tracked for use in automations:

| Event                   | Triggered When                                      |
| ----------------------- | --------------------------------------------------- |
| `saas.purchase`         | New subscription created or transaction completed   |
| `saas.purchase_monthly` | Monthly subscription purchase                       |
| `saas.purchase_yearly`  | Yearly subscription purchase                        |
| `saas.trial_started`    | Subscription enters trial period                    |
| `saas.cancelled`        | Subscription set to cancel                          |
| `saas.churn`            | Subscription canceled or paused                     |
| `saas.payment_failed`   | Transaction payment failed or subscription past due |
| `saas.refund`           | Adjustment (refund/chargeback) created              |

## Using Revenue Data

### Building 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 = cancelled AND mrr >= 100` — At-risk high-value customers needing attention
* `tag = saas.yearly AND mrr >= 100` — Yearly enterprise 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 cancels

## How Matching Works

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

If a Paddle customer doesn't have an email in the webhook or doesn't match any subscriber, the event is acknowledged but no action is taken.

## Troubleshooting

### Webhooks Not Arriving

1. Verify your webhook URL is correct in Paddle notification settings
2. Check that you've selected the correct events
3. Check Paddle's notification logs for failed delivery attempts
4. Ensure your Sequenzy webhook endpoint is accessible

### Invalid Webhook Signature

If webhooks are failing with signature errors:

1. Verify you copied the complete webhook secret from Paddle
2. Re-create the notification destination in Paddle and update the secret in Sequenzy
3. Ensure you're using the correct secret (each destination has its own secret)

### Customer Email Not Found

Paddle webhooks include customer data with email addresses. If events are being acknowledged but subscribers aren't being updated:

1. Ensure the customer email in Paddle matches a subscriber in Sequenzy
2. Check that customers have valid email addresses in Paddle
