# Lemon Squeezy new subscriber notifications on your phone > Get a push notification when someone starts a Lemon Squeezy subscription or free trial. - Company: Lemon Squeezy (https://www.justpush.io/recipes/lemonsqueezy) - Event: `subscription_created` (subscription_created) - Tags: Finance, Subscriptions - Install: https://studio.justpush.io/recipes/lemonsqueezy/subscription-created - Web page: https://www.justpush.io/recipes/lemonsqueezy/subscription-created ## 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 Lemon Squeezy, go to Settings > Webhooks and add a webhook. 3. Paste your webhook URL (shown in Studio after install) as the callback URL, enter a signing secret, and tick subscription_created. 4. Save. Test mode and live mode have separate webhooks. 5. Add a webhook under **Settings โ†’ Webhooks** with the URL above and tick `subscription_created`. An `order_created` event fires for the same checkout; subscribe to one or the other if you don't want two pushes. 6. Lemon Squeezy signs deliveries with `X-Signature` (HMAC-SHA256 of your signing secret), but JustPush doesn't check it yet, so keep your endpoint URL private. ## 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 // Lemon Squeezy โ†’ subscription created // Fires when a customer starts a subscription or trial. (An order_created event fires too; // pick one of the two recipes if you don't want both pushes.) // Docs: https://docs.lemonsqueezy.com/help/webhooks/event-types // "12 Oct" from an ISO timestamp. function day(iso) { const date = new Date(iso) return Number.isNaN(date.getTime()) ? null : date.toLocaleDateString("en-GB", { day: "numeric", month: "short", timeZone: "UTC" }) } // The event name comes in the X-Event-Name header and in meta.event_name. // Header names can arrive in any case. function header(request, name) { const headers = request.headers || {} const key = Object.keys(headers).find((k) => k.toLowerCase() === name) const value = key ? headers[key] : null return Array.isArray(value) ? value[0] : value } // Lemon Squeezy puts test_mode in meta on real deliveries and in the attributes in its examples. function testMode(body) { return (body.meta?.test_mode ?? body.data?.attributes?.test_mode) === true ? " (test mode)" : "" } // Only link to real http(s) URLs. function link(url, cta) { return typeof url === "string" && /^https?:\/\//.test(url) ? [{ cta, url }] : [] } function handleRequest(request) { const body = request.body || {} const event = header(request, "x-event-name") ?? body.meta?.event_name const order = body.data?.attributes ?? {} // Guard: only subscription_created events. if (event !== "subscription_created") { console.log(`Ignoring Lemon Squeezy "${event ?? "unknown"}" event`) return null } const sub = order const product = [sub.product_name, sub.variant_name && sub.variant_name !== "Default" ? sub.variant_name : null].filter(Boolean).join(" โ€” ") const trial = sub.status === "on_trial" && sub.trial_ends_at && day(sub.trial_ends_at) ? ` (trial until ${day(sub.trial_ends_at)})` : "" return { title: sub.status === "on_trial" ? "๐Ÿงช New trial" : "๐ŸŽ‰ New subscriber", message: [sub.user_name, product].filter(Boolean).join(" โ€” ") + trial + testMode(body) || "New subscription", topic: "Lemon Squeezy", priority: 0, // Normal โ€” recurring revenue, worth a smile ...(sub.status === "on_trial" ? {} : { sound: "cashregister" }), buttons: link(sub.urls?.customer_portal, "Customer portal"), } } ``` ## Lemon Squeezy subscription_created webhook payload (sample) ```json { "data": { "id": "33445", "type": "subscriptions", "attributes": { "urls": { "customer_portal": "https://acme.lemonsqueezy.com/billing?expires=1790700000&signature=abc", "update_payment_method": "https://acme.lemonsqueezy.com/subscription/33445/payment-details?signature=abc" }, "pause": null, "status": "on_trial", "ends_at": null, "order_id": 1234567, "store_id": 12345, "cancelled": false, "renews_at": "2026-10-13T09:45:53.000000Z", "test_mode": false, "user_name": "Jane Doe", "user_email": "jane@example.com", "product_name": "Acme Pro", "variant_name": "Monthly", "trial_ends_at": "2026-10-13T09:45:53.000000Z", "status_formatted": "On Trial" } }, "meta": { "test_mode": false, "event_name": "subscription_created", "webhook_id": "a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d" } } ``` ## 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 Lemon Squeezy 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.