RevenueCat new subscriber notifications on your phone.

Get a push notification when a customer starts a subscription or free trial, on any store RevenueCat tracks.

INITIAL_PURCHASEFinanceSubscriptions
How it works

Three steps to your first push

STEP 01

Install the recipe

One click in Studio gives you a personal webhook URL.

STEP 02

Paste your URL into RevenueCat

Add it as a webhook for INITIAL_PURCHASE.

STEP 03

Get a push on your phone

With the text, sound and buttons from the recipe.

Setup

How to set up the RevenueCat initial_purchase webhook

  1. Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL.
  2. In the RevenueCat dashboard, open your project's Integrations > Webhooks and add a new webhook.
  3. Paste your webhook URL as the webhook URL.https://••••••••/•••••••• your personal URL, shown after install
  4. Send all events, or only INITIAL_PURCHASE; the recipe ignores every other event type.
  5. Save, then click Send test event to confirm it arrives.
The code

What runs when the webhook arrives

Studio calls handleRequest(request) with the incoming webhook and sends the message it returns. It's yours after install; change anything.

transform.js
1// RevenueCat → INITIAL_PURCHASE
2// Fires when a customer starts a subscription or free trial.
3// Docs: https://www.revenuecat.com/docs/integrations/webhooks/event-types-and-fields
4//
5// Paste this into a JustPush Studio integration and add a RevenueCat webhook pointing
6// at the integration's endpoint URL.
7
8// Human-readable store names.
9const STORES = {
10 APP_STORE: "App Store",
11 MAC_APP_STORE: "Mac App Store",
12 PLAY_STORE: "Google Play",
13 AMAZON: "Amazon",
14 STRIPE: "Stripe",
15 PADDLE: "Paddle",
16 RC_BILLING: "Web Billing",
17 ROKU: "Roku",
18 PROMOTIONAL: "a promotional grant",
19 TEST_STORE: "Test Store",
20}
21
22// RevenueCat prices are decimals ("9.99"), not cents. Returns null when there's no price.
23function money(amount, currency) {
24 const value = Number(amount)
25
26 if (amount == null || !Number.isFinite(value) || !currency) return null
27
28 try {
29 return new Intl.NumberFormat("en-GB", { style: "currency", currency }).format(value)
30 } catch {
31 return `${value} ${currency}`
32 }
33}
34
35// Turn "NL" into 🇳🇱.
36function flag(countryCode) {
37 return /^[A-Z]{2}$/.test(countryCode ?? "")
38 ? String.fromCodePoint(...[...countryCode].map((c) => 127397 + c.charCodeAt(0)))
39 : ""
40}
41
42// "pro_monthly on App Store from [email protected] 🇳🇱 (sandbox)"
43function where(event) {
44 const attributes = event.subscriber_attributes ?? {}
45 const who = attributes.$email?.value ?? attributes.$displayName?.value
46 const store = STORES[event.store] ?? event.store
47
48 return (
49 (event.product_id ?? "a product") +
50 (store ? ` on ${store}` : "") +
51 (who ? ` from ${who}` : "") +
52 (flag(event.country_code) ? ` ${flag(event.country_code)}` : "") +
53 (event.environment === "SANDBOX" ? " (sandbox)" : "")
54 )
55}
56
57function handleRequest(request) {
58 const event = (request.body || {}).event
59
60 // "Send test event" in RevenueCat; confirm the connection with a quiet push.
61 if (event?.type === "TEST") {
62 return { title: "🔔 RevenueCat connected", message: "Test event received", topic: "RevenueCat", priority: -1 }
63 }
64
65 // Guard: only handle this event type, so other RevenueCat events on this integration stay quiet.
66 if (event?.type !== "INITIAL_PURCHASE") {
67 console.log(`Ignoring RevenueCat event "${event?.type ?? "unknown"}"`)
68 return null
69 }
70
71 const trial = event.period_type === "TRIAL"
72 const price = money(event.price_in_purchased_currency, event.currency)
73
74 return {
75 title: trial ? "🧪 Trial started" : "🎉 New subscriber",
76 message: (!trial && price ? `${price} for ` : "") + where(event),
77 topic: "RevenueCat",
78 priority: 0, // Normal — good news, not an emergency
79 ...(trial ? {} : { sound: "cashregister" }),
80 }
81}
Payload

The RevenueCat INITIAL_PURCHASE webhook

This is what RevenueCat sends to your URL for initial_purchase. It is a sample, trimmed to the fields recipes use.

INITIAL_PURCHASE · sample.json
1{
2 "event": {
3 "id": "CD489E0E-INITIAL-",
4 "type": "INITIAL_PURCHASE",
5 "price": 10.87,
6 "store": "APP_STORE",
7 "app_id": "app1a2b3c4d5",
8 "aliases": [
9 "user_8Hq2"
10 ],
11 "currency": "EUR",
12 "product_id": "pro_monthly",
13 "app_user_id": "user_8Hq2",
14 "environment": "PRODUCTION",
15 "period_type": "NORMAL",
16 "country_code": "NL",
17 "transaction_id": "2000000712345678",
18 "entitlement_ids": [
19 "pro"
20 ],
21 "purchased_at_ms": 1790584200000,
22 "expiration_at_ms": 1793176200000,
23 "event_timestamp_ms": 1790584200000,
24 "subscriber_attributes": {
25 "$email": {
26 "value": "[email protected]",
27 "updated_at_ms": 1790584100000
28 }
29 },
30 "original_transaction_id": "2000000612345678",
31 "price_in_purchased_currency": 9.99
32 },
33 "api_version": "1.0"
34}
FAQ

RevenueCat new subscriber notifications: questions

Does this work on iPhone and Android?

Yes. Install the JustPush app from the App Store or Google Play and sign in. Every phone signed in to your account gets the notification.

Do I need to write code?

No. Install the recipe in Studio, paste your webhook URL into RevenueCat and you are done. The code is there if you want to change the text, the sound or the buttons.

Can I change what the notification says?

Yes. After install the recipe's code is yours. Edit it in Studio and test it against the sample payload before you save.

What does it cost?

JustPush is free for 30 days. After that it's $19.99 a year, or $39.99 once. There is no extra charge for recipes.

Ready when you are

RevenueCat on your phone in two minutes.

Install the recipe, paste one URL, done. Free for 30 days, no credit card required.