RevenueCat

Validate referrals on real purchase events with the RevenueCat integration

If your app runs RevenueCat, Invitebase can qualify referrals on real subscription revenue without you tracking a single purchase event. Purchases are one of the best Qualification Gates, and Invitebase's RevenueCat integration makes it easy to automatically receive these events. See our guide on Reward on Paid Subscriptions for why purchases are one of the simplest and best ways to verify referrals.

Connect RevenueCat

In the dashboard, open Developer tools → Integrations → Connect a source and select RevenueCat. Invitebase generates:

  • a unique webhook URL for this connection, e.g. https://api.invitebase.com/v1/integrations/revenuecat/d2f61b7e-3c48-4d05-9a2b-8e6f1c4d7a39
  • an authorization header value, shown once — this is how the connection authenticates RevenueCat's requests

In RevenueCat, go to your project's Integrations → Webhooks, add a webhook, paste the URL, and set the Authorization header field to the value from step 1. Leave all event types enabled — Invitebase filters what it needs.

The connection shows Waiting for first event…. Make any sandbox purchase (or use the Send test event button in RevenueCat) and the panel renders the received event and flips to Connected.

Environments

RevenueCat tags each event with its environment; Invitebase routes them automatically:

RevenueCat environmentInvitebase mode
SANDBOXTest mode
PRODUCTIONLive mode

One connection covers both. Sandbox purchases can therefore drive your whole test-mode referral loop and never touch live data or billing.

Identity: the one convention

Invitebase resolves RevenueCat events to users by matching RevenueCat's app_user_id against the user ID you pass to identify():

Invitebase.identify(user.id)          // must be the same value…
Purchases.logIn(user.id)              // …as your RevenueCat app user ID

If you already use your own user IDs as RevenueCat app user IDs (the common setup), there is nothing to do. Events for users Invitebase has not seen yet are parked and retried once the user is identified — a purchase arriving moments before the signup event is not lost.

Anonymous RevenueCat IDs ($RCAnonymousID:…) cannot be matched — make sure logIn runs for referred users before purchase, or attribution to the referral will not resolve.

Event mapping

RevenueCat webhook events map to canonical Invitebase events:

RevenueCat eventInvitebase eventNotes
INITIAL_PURCHASE (period NORMAL)subscription_startedCarries plan: "paid"
INITIAL_PURCHASE (period TRIAL)trial_started
RENEWAL (first payment after a trial)trial_converted + subscription_startedThe trial-conversion moment
RENEWALsubscription_renewed
NON_RENEWING_PURCHASEpurchase_completedOne-time purchases
CANCELLATIONsubscription_cancelledAuto-renew off / refund per reason
EXPIRATIONsubscription_expired
Refund eventssubscription_refundedFeeds fraud holds and clawbacks

Mapped events carry useful properties you can restrict gate conditions by: product_id, store (app_store, play_store, stripe), price, currency, period_type, and plan (paid for non-trial starts). Every mapped event is visible in Developer tools → Events with the raw RevenueCat payload attached, and source: revenuecat on the API.

Use it in a gate

The flagship gate — validate when the referred user starts a paid subscription. In the gate builder, add one required condition on subscription_started, restricted to plan: paid, with a 14-day window.

Gate on trial_converted for trial-based funnels, or restrict the condition to product_id: pro_annual to reward only annual conversions. Refund events are wired into fraud controls: a refund inside the hold window can claw back the reward before payout. Full walkthrough: Reward on paid subscription.

Test with the RevenueCat sandbox

  1. Set up a linked test referral (see the test-mode walkthrough).
  2. In your development build, sign in as the referred test user and make a sandbox purchase (StoreKit test / Play billing test track).
  3. RevenueCat fires the webhook with environment: SANDBOX; Invitebase maps it into test mode and the gate evaluates within seconds.
  4. Watch the referral flip to validated in the dashboard.

No sandbox purchase handy? Developer tools → Events → Simulate can fire a synthetic RevenueCat INITIAL_PURCHASE against any test-mode user.

What's next

On this page