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

# RevenueCat App

> Install the official RevenueCat app to send Dodo Payments subscriptions, one-time purchases, refunds, and lost disputes to RevenueCat as external purchases.

## What the RevenueCat app does

The RevenueCat app sends Dodo Payments subscriptions, one-time purchases, refunds, and lost disputes to RevenueCat through the RevenueCat External Purchases API. RevenueCat entitlements, Customer History, charts, and integrations then show the web purchases that customers make with Dodo Payments.

## Before you start

* You are an owner or an admin of the Dodo Payments business.
* The RevenueCat External Purchases API is a private beta. RevenueCat must enable it for your project. If the **External** source is not available, contact RevenueCat support.
* In RevenueCat, add an app of type **External** to your project. Copy the app-specific secret key of that External app. Don't use a project-level secret key or a public key.
* In RevenueCat, create products with identifiers that match your Dodo Payments product IDs, and attach them to entitlements. If the identifiers differ, use the **Product map** setting.
* Ask RevenueCat support to enable three flags on your RevenueCat project: purchase metadata, payment objects in exports, and strict refund matching.

## Identify your customers

RevenueCat needs an app user ID for each purchase. Pass the same app user ID that your app gives to `Purchases.configure` in the `metadata` of the checkout session or the subscription, under the key `revenuecat_app_user_id`. You can change the key in the settings.

```typescript expandable theme={null}
const session = await client.checkoutSessions.create({
  product_cart: [{ product_id: 'pdt_xxx', quantity: 1 }],
  metadata: {
    revenuecat_app_user_id: 'your-app-user-id',
  },
});
```

If an event has no app user ID, Dodo Payments skips it. It never guesses the user. To skip the metadata, set **RevenueCat app user ID** to **Dodo customer ID**.

## Install, connect, and configure

**1. Install the app**

Open **Apps**, then **Explore**. Open **RevenueCat** (publisher **Dodo Payments**) and select **Install**.

**2. Connect RevenueCat**

Select **Connect**, paste the secret API key, and select **Connect**. Dodo Payments does not check the key when you connect. If the key is wrong, the connection shows as broken after the first event.

**3. Choose the settings**

Open the **Configure** tab, set the options, and select **Save**.

## Settings

| Setting | What it does | Default |
| - | - | - |
| Sync subscriptions | Send subscription events. | On |
| Sync one-time purchases | Send one-time purchases. | On |
| Sync refunds and lost disputes | Send refunds and lost disputes. | On |
| End access on a full refund | End access after a full refund. This also applies to lost disputes and to refunds that add up to the full amount. | On |
| RevenueCat app user ID | **Metadata key** or **Dodo customer ID**. | Metadata key |
| Metadata key for the app user ID | The metadata key that holds the app user ID. Use letters, numbers, underscore, or hyphen. Maximum 64 characters. | `revenuecat_app_user_id` |
| Product map | Map a Dodo Payments product to a RevenueCat product. Enter one line for each product, for example `pdt_xxx=rc_product_id`. Maximum 4,096 characters. | Empty |
| Products | Send events only for the products that you pick. | All |

## What is sent and when

| In Dodo Payments | In RevenueCat |
| - | - |
| A payment for a subscription period | A new period with revenue, as `INITIAL_PURCHASE` or `RENEWAL`. A trial becomes a trialing period. |
| Cancel at period end | Auto-renew turns off. |
| Immediate cancel or expiry | Access ends. |
| Subscription on hold | A billing issue. |
| Subscription paused | The subscription is paused. |
| One-time purchase | One purchase for each cart line. |
| Refund | A negative payment. A full refund revokes access if **End access on a full refund** is on. See the limitations below for when access is revoked. |
| Lost dispute | Handled like a full refund. |

## Test mode

Dodo Payments sends test mode events to RevenueCat as sandbox purchases. Use a separate RevenueCat project for Dodo Payments test mode, so sandbox data never unlocks entitlements for real users.

## Limitations

* RevenueCat shows a plan change as a `RENEWAL`.
* The app does not backfill existing subscribers. Their events sync from the next renewal after you install the app.
* A refund revokes access only when the refunded payment belongs to a single subscription and is the payment of that subscription's latest posted period, and that period is still running at the time of the refund. A payment that covers several subscriptions revokes nothing.
* A refund of an older period posts only the negative payment, and it lands on the revenue of the newest period.
* A full refund means this refund plus earlier refunds reach the payment total. A lost dispute is capped at the amount that is not yet refunded.
* If a delivery fails, Dodo Payments tries again automatically.

## Troubleshooting

| Problem | What to do |
| - | - |
| **Connection needs attention** after the first event | RevenueCat refused the key (401), so the connection is marked broken. Select **Reconnect** and paste a valid app-specific secret key of the **External** app. |
| Events do not appear in RevenueCat | Check that the checkout or subscription `metadata` has the app user ID, or switch **RevenueCat app user ID** to **Dodo customer ID**. Then check the product identifiers and the filters. |
| Delivery fails with a 403 | The External Purchases API is not enabled for your RevenueCat project. Dodo Payments treats this as a final failure and doesn't retry. See [Before you start](#before-you-start). |
| Refunds do not match a purchase | Ask RevenueCat support to confirm that strict refund matching is on. |

## Disconnect and uninstall

Turn off the sync switches on the **Configure** tab to stop sending data. Uninstall the app to delete the connection. See [Manage and uninstall](https://docs.dodopayments.com/features/app-marketplace/manage-and-uninstall.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.