---
id: "web/integrations/stripe/track-external-purchases"
title: "Track External Purchases"
description: "If you accept Stripe purchases outside of RevenueCat purchase flows — for example, through your own checkout integration — you can import those purchases into RevenueCat so they are reflected in charts and customer data, and used to unlock entitlements."
permalink: "/docs/web/integrations/stripe/track-external-purchases"
slug: "track-external-purchases"
version: "current"
original_source: "docs/web/integrations/stripe/track-external-purchases.mdx"
---

If you accept Stripe purchases outside of RevenueCat purchase flows — for example, through your own checkout integration — you can import those purchases into RevenueCat so they are reflected in charts and customer data, and used to unlock entitlements.

There are two ways to do this:

- **Manually**, by posting purchase tokens to the RevenueCat API
- **Automatically**, using Stripe server-to-server notifications

## Tracking purchases manually via the RevenueCat API

Send Stripe subscriptions to RevenueCat using the [POST receipt endpoint](/migrating-to-revenuecat/migrating-existing-subscriptions/receipt-imports). When using Stripe Checkout, send the purchase only after one of these events has completed:

- `customer.subscription.created`
- `checkout.session.completed`

:::info
We recommend listening to `customer.subscription.created` for subscriptions and `checkout.session.completed` for one-time purchases for the simplest flow.
:::

The only required fields when sending a Stripe purchase to the RevenueCat API are:

- `fetch_token`: Your Stripe subscription ID (`sub_...`) **or** your Stripe Checkout Session ID
- `app_user_id`: The App User ID the subscription should be applied to

**Headers**

- `X-Platform`: Set to `stripe`
- `Authorization`: `Bearer YOUR_REVENUECAT_STRIPE_APP_PUBLIC_API_KEY`

*Interactive content is available in the web version of this doc.*

Stripe subscriptions are automatically refreshed by RevenueCat the same way as subscriptions from the app stores. This means **it may take up to two hours for a Stripe cancellation to be reflected in the RevenueCat backend**. Alternatively, you can re-post the same subscription to RevenueCat after a user cancels, and it will be updated immediately.

## Tracking purchases automatically via server-to-server notifications

RevenueCat can automatically process Stripe tokens sent through server-to-server notifications. To enable this, ensure the following are configured:

- [Stripe Server Notifications](/platform-resources/server-notifications/stripe-server-notifications)
- [Track new purchases from server-to-server notifications](/platform-resources/server-notifications/stripe-server-notifications#tracking-new-purchases-using-stripe-server-notifications)

## One-time purchases

To track one-time purchases made through Stripe Checkout, send the Checkout Session ID as the `fetch_token` when posting to the RevenueCat API. RevenueCat supports both one-time purchases and subscriptions made through Stripe Checkout, using Stripe's [Prices](https://stripe.com/docs/api/prices) objects.

:::warning One-time purchase support
RevenueCat supports non-subscription purchases, as long as they are created through a [Checkout Session](https://docs.stripe.com/api/checkout/sessions). Other ways of selling one-time purchases outside of Checkout Sessions can't be identified.
:::

:::info App User ID is required
In order for a Stripe subscription to be honored within an app, the *Purchases SDK* must be configured with the same App User ID associated with the Stripe subscription.
:::

## Troubleshooting

**A Stripe purchase is missing/not found in RevenueCat**

If a Stripe purchase seems to be missing in RevenueCat, first double check you've got the right App User ID. Sometimes users may have multiple accounts, and may contact you referencing the wrong identifier.

If you're sure you've got the right App User ID, you'll likely need to re-send the purchase token and App User ID to our API, or wait for a new subscription event to occur (if you have server-to-server notifications enabled). The end-user won't be able to directly restore their Stripe purchases to sync to RevenueCat as is possible with the mobile app stores.
