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

# Connect payment provider

> Link your payment provider so Retain can sync subscriptions, renewals, and revenue alongside your product data.

Open **[Integrations](https://retain.so/dashboard/integrations)** in the Retain dashboard, choose your provider, and follow the on-screen steps.

After you connect a payment provider, Retain ingests billing events (subscriptions, renewals, upgrades, cancellations, and more) automatically and ties them to your users.

## Matching users from payment provider

Connecting a payment provider **creates or updates customers in Retain** automatically from your billing data.

Retain matches customers from your payment provider to users in your product using a shared identifier.

Use one of these approaches so revenue and in-app behavior stay on the same customer:

1. **Same email** - The customer email from your payment provider must be the same as the one used in [`identify`](/docs/guides/identify) on Retain. Matching email addresses will link billing events with [`track`](/docs/guides/track) activity.

   **Customer from your payment provider:**

   ```json theme={"theme":"vesper"}
   {
     "id": "cus_456",
     "email": "jane@example.com"
   }
   ```

   **Identifing the user on Retain**:

   ```typescript theme={"theme":"vesper"}
   retain.identify({
     userId: "user_789",
     email: "jane@example.com",
   });
   ```

2. **Same `userId` in metadata** - Store your application’s **`userId`** (the same value used in [`identify`](/docs/guides/identify)) in the customer metadata of your payment provider. This ensures billing events are always linked to the correct user, even if the email is different.

   **Customer from your payment provider:**

   ```json theme={"theme":"vesper"}
   {
     "id": "cus_123",
     "email": "billing@email.com",
     "metadata": {
       "userId": "user_abc123"
     }
   }
   ```

   **Identifing the user on Retain**:

   ```typescript theme={"theme":"vesper"}
   retain.identify({
     userId: "user_abc123",
     email: "product@email.com",
   });
   ```

   Product and billing emails can differ. Matching `userId` links both sides.

## Native connectors

* **Stripe**
* **Polar**
* **Paddle** (coming soon)
* **Lemon Squeezy** (coming soon)

## Next steps

<Card title="What should I track?" icon="bullseye" href="/docs/plan" horizontal>
  Choose product events to track.
</Card>
