# RevenueCat billing issue notifications on your phone > Get a High-priority push notification when a subscription renewal can't be charged, with the grace period if there is one. - Company: RevenueCat (https://www.justpush.io/recipes/revenuecat) - Event: `BILLING_ISSUE` (BILLING_ISSUE) - Tags: Finance, Subscriptions - Install: https://studio.justpush.io/recipes/revenuecat/billing-issue - Web page: https://www.justpush.io/recipes/revenuecat/billing-issue ## Setup 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 (shown in Studio after install) as the webhook URL. 4. Send all events, or only BILLING_ISSUE; the recipe ignores every other event type. 5. Save, then click Send test event to confirm it arrives. ## Code Studio calls `handleRequest(request)` with the incoming webhook (`{ method, headers, body, query, raw }`) and sends the message object it returns. Returning `null` sends nothing. ```js // RevenueCat → BILLING_ISSUE // Fires when a renewal can't be charged. // Docs: https://www.revenuecat.com/docs/integrations/webhooks/event-types-and-fields // // Paste this into a JustPush Studio integration and add a RevenueCat webhook pointing // at the integration's endpoint URL. // Human-readable store names. const STORES = { APP_STORE: "App Store", MAC_APP_STORE: "Mac App Store", PLAY_STORE: "Google Play", AMAZON: "Amazon", STRIPE: "Stripe", PADDLE: "Paddle", RC_BILLING: "Web Billing", ROKU: "Roku", PROMOTIONAL: "a promotional grant", TEST_STORE: "Test Store", } // RevenueCat prices are decimals ("9.99"), not cents. Returns null when there's no price. function money(amount, currency) { const value = Number(amount) if (amount == null || !Number.isFinite(value) || !currency) return null try { return new Intl.NumberFormat("en-GB", { style: "currency", currency }).format(value) } catch { return `${value} ${currency}` } } // Turn "NL" into 🇳🇱. function flag(countryCode) { return /^[A-Z]{2}$/.test(countryCode ?? "") ? String.fromCodePoint(...[...countryCode].map((c) => 127397 + c.charCodeAt(0))) : "" } // "pro_monthly on App Store from jane@example.com 🇳🇱 (sandbox)" function where(event) { const attributes = event.subscriber_attributes ?? {} const who = attributes.$email?.value ?? attributes.$displayName?.value const store = STORES[event.store] ?? event.store return ( (event.product_id ?? "a product") + (store ? ` on ${store}` : "") + (who ? ` from ${who}` : "") + (flag(event.country_code) ? ` ${flag(event.country_code)}` : "") + (event.environment === "SANDBOX" ? " (sandbox)" : "") ) } // RevenueCat timestamps are milliseconds since epoch. function day(ms) { return new Date(ms).toLocaleDateString("en-GB", { day: "numeric", month: "short", timeZone: "UTC" }) } function handleRequest(request) { const event = (request.body || {}).event // "Send test event" in RevenueCat; confirm the connection with a quiet push. if (event?.type === "TEST") { return { title: "🔔 RevenueCat connected", message: "Test event received", topic: "RevenueCat", priority: -1 } } // Guard: only handle this event type, so other RevenueCat events on this integration stay quiet. if (event?.type !== "BILLING_ISSUE") { console.log(`Ignoring RevenueCat event "${event?.type ?? "unknown"}"`) return null } const grace = event.grace_period_expiration_at_ms ? `. Grace period until ${day(event.grace_period_expiration_at_ms)}.` : "" return { title: "⚠️ Billing issue", message: `Couldn't charge ${where(event)}${grace}`, topic: "RevenueCat", priority: 1, // High — a paying customer is at risk of churning } } ``` ## RevenueCat BILLING_ISSUE webhook payload (sample) ```json { "event": { "id": "CD489E0E-BILLING-", "type": "BILLING_ISSUE", "price": 0, "store": "APP_STORE", "app_id": "app1a2b3c4d5", "aliases": [ "user_8Hq2" ], "currency": "EUR", "product_id": "pro_monthly", "app_user_id": "user_8Hq2", "environment": "PRODUCTION", "period_type": "NORMAL", "country_code": "NL", "transaction_id": "2000000712345678", "entitlement_ids": [ "pro" ], "purchased_at_ms": 1790584200000, "expiration_at_ms": 1793176200000, "event_timestamp_ms": 1790584200000, "subscriber_attributes": { "$email": { "value": "jane@example.com", "updated_at_ms": 1790584100000 } }, "original_transaction_id": "2000000612345678", "price_in_purchased_currency": 0, "grace_period_expiration_at_ms": 1790929800000 }, "api_version": "1.0" } ``` ## FAQ ### 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.