Reward on Paid Subscription

The most common and simplest referral campaign

One of the most common and simplest referral campaigns is a multi-sided cash + free trial referral. The sender gets paid cash or monetary compensation for the referral, and the receiver gets an extended free trail.

Reward on paid subscription exampleScreenshot coming soon
Sender gets $10, receiver gets 1 month free.

This is one of the most straightforward referral structures, and a great one for new apps to start with. Monetary compensation is a strong incentive, and an extended free trials are often sufficient to entice new users to sign up. In addition, rewarding on paid subscriptions is one of the most reliable ways to avoid referral fraud.

A paid subscription is the single best qualification gate for deciding whether a referral is genuine. To subscribe on the App Store you need an Apple Account (formerly Apple ID); on the Google Play Store you need a Google Account. These accounts require a verified, chargeable payment method and confirmed identity that is very difficult to spoof.

Easy integration

Another benefit of using a paid subscription as a qualification gate is the ease of setup and integration. Events for payment purchases, cancellations, and refunds automatically flow through Invitebase's integration with App Store Connect, RevenueCat, or Adapty. Once you connect your preferred payment provider, the purchase webhooks drive your qualification gate directly. No code required.

How it works

  1. A referred user taps an invite link (https://mycompany.refr.link/a1b2c3) and installs your app. Invitebase attributes the install and the referral moves to signed_up — it is now linked, but nothing is paid or billed yet.
  2. The user subscribes. RevenueCat or Adapty sends its purchase webhook to Invitebase, which maps it to a canonical subscription_started event for that user — no SDK track() call required.
  3. The event satisfies the campaign's qualification gate. The referral transitions in_progress → validated, fraud checks run, and the reward fires.

The whole loop is testable in test mode before any real money or store traffic is involved.

The qualification gate

You build the gate visually in the dashboard rule builder. For this campaign it reads: the referred user must start a paid subscription within 14 days of signing up.

Qualification gate rule builder in the dashboardScreenshot coming soon
Building the paid-subscription gate in the campaign rule builder.

See Qualification gates for everything the rule builder can express.

Fraud prevention

Bad actors looking to defraud your referral campaign could convince friends and family to download your app, subscribe, then immediately cancel their subscription and delete the app. These users never intended to use your app - only to take advantage of your referral campaign.

Invitebase has checks in place to specifically handle these situations. The hold window sits between validation and payout, and your subscription provider's refund and cancellation events feed straight into it — so a subscription that unwinds inside the window claws the reward back before any money leaves your balance, and reverses the billing with it. The deterministic fraud controls catch the structural version of the same abuse: one referrer producing these signups in bulk, or the same person on both sides of the code.

Set it up

Connect your subscription provider

  1. In the dashboard, go to Developer tools → Integrations → Connect a source and pick RevenueCat. Invitebase generates a unique webhook URL and an authorization header value (shown once).
  2. In RevenueCat, open Project settings → Integrations → Webhooks, paste the URL, and set the Authorization header to the value Invitebase gave you.
  3. RevenueCat sandbox events map to Invitebase test mode automatically; production events map to live mode.

The one convention that matters: your RevenueCat app_user_id must be the same user ID you pass to identify(). That is how a purchase event is resolved to the referred user. Full details in the RevenueCat integration reference.

The connection shows Waiting for first event… until a webhook arrives, then flips to Connected with a last-event-seen timestamp.

Create the campaign

In Campaigns → New campaign, pick the Paid subscription template — it prefills the gate above.

This campaign is double-sided: both the referrer and the referred user get a free month, delivered as app grants — no money movement, store-policy-friendly.

Identify users in your app

The only SDK requirement is that you call identify() with the same user ID your subscription provider knows:

import invitebase from '@invitebase/js';

invitebase.configure(process.env.NEXT_PUBLIC_INVITEBASE_PUBLISHABLE_KEY); // pk_test_…
await invitebase.identify({ id: 'usr_123' }); // must match your subscription provider's user ID

Attribution (link handling, deferred deep linking) is covered in the deep links guide and the platform quickstarts — if you have completed a quickstart, this step is already done.

Test the whole loop in test mode

Everything below runs against your sk_test_… key. Test data is isolated, never billed, and never moves money.

Create a referrer and a link.

curl https://api.invitebase.com/v1/referrers \
  -H "Authorization: Bearer $INVITEBASE_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "external_id": "usr_referrer_1", "email": "maya@example.com" }'

curl https://api.invitebase.com/v1/referral-links \
  -H "Authorization: Bearer $INVITEBASE_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "referrer_id": "6b1d4f9a-8e25-4c07-a3f6-1c5e9d7b2a84", "campaign_id": "7e1f8a3b-4c26-49d0-b591-0d8e2f6a3c15" }'

Open the returned link URL in a browser — the click creates the referral in clicked state. You can watch it appear in the dashboard's live event feed.

Sign up the referred user. Send a signup event carrying the referral code (the SDK does this automatically after handleInbound/resolveReferral; here we do it by hand):

curl https://api.invitebase.com/v1/events \
  -H "Authorization: Bearer $INVITEBASE_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: signup-usr-referee-1" \
  -d '{
    "name": "signup",
    "referred_user_id": "usr_referee_1",
    "referral_code": "a1b2c3"
  }'

The referral advances clicked → signed_up and shows as linked in the dashboard.

Simulate the paid conversion. Two options:

  • Provider sandbox: make a sandbox purchase in your app (RevenueCat sandbox / Adapty sandbox). The provider fires its webhook, Invitebase maps it, and the gate passes.
  • Event simulator: in Developer tools → Events → Simulate, fire a simulated INITIAL_PURCHASE (or send the canonical event yourself):
curl https://api.invitebase.com/v1/events \
  -H "Authorization: Bearer $INVITEBASE_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "subscription_started",
    "referred_user_id": "usr_referee_1",
    "properties": { "plan": "paid", "product_id": "pro_monthly" }
  }'

Watch it validate. The referral transitions in_progress → validated, fraud verification runs, and a reward is created. If you registered a reward webhook, a signed reward.pending delivery arrives at your endpoint with a test-mode flag. The referral detail page shows the exact gate evaluation that flipped it to validated.

When the test loop is green, flip to your live keys. Nothing else changes.

What's next

On this page