Lemon Squeezy subscription cancelled notifications on your phone.

Get a push notification when a Lemon Squeezy subscription is cancelled, with the date access ends.

subscription_cancelledFinanceSubscriptions
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 Lemon Squeezy

Add it as a webhook for subscription_cancelled.

STEP 03

Get a push on your phone

With the text, sound and buttons from the recipe.

Setup

How to set up the Lemon Squeezy subscription_cancelled 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 Lemon Squeezy, go to Settings > Webhooks and add a webhook.
  3. Paste your webhook URL as the callback URL, enter a signing secret, and tick subscription_cancelled.https://••••••••/•••••••• your personal URL, shown after install
  4. Save. Test mode and live mode have separate webhooks.
  5. Add a webhook under **Settings → Webhooks** with the URL above and tick `subscription_cancelled`. A cancelled subscription stays active until the end of the period.
  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.
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// Lemon Squeezy → subscription cancelled
2// Fires when a subscription is cancelled. It stays active until ends_at.
3// Docs: https://docs.lemonsqueezy.com/help/webhooks/event-types
4
5// "12 Oct" from an ISO timestamp.
6function day(iso) {
7 const date = new Date(iso)
8 return Number.isNaN(date.getTime())
9 ? null
10 : date.toLocaleDateString("en-GB", { day: "numeric", month: "short", timeZone: "UTC" })
11}
12
13// The event name comes in the X-Event-Name header and in meta.event_name.
14// Header names can arrive in any case.
15function header(request, name) {
16 const headers = request.headers || {}
17 const key = Object.keys(headers).find((k) => k.toLowerCase() === name)
18 const value = key ? headers[key] : null
19 return Array.isArray(value) ? value[0] : value
20}
21
22// Lemon Squeezy puts test_mode in meta on real deliveries and in the attributes in its examples.
23function testMode(body) {
24 return (body.meta?.test_mode ?? body.data?.attributes?.test_mode) === true ? " (test mode)" : ""
25}
26
27// Only link to real http(s) URLs.
28function link(url, cta) {
29 return typeof url === "string" && /^https?:\/\//.test(url) ? [{ cta, url }] : []
30}
31
32function handleRequest(request) {
33 const body = request.body || {}
34 const event = header(request, "x-event-name") ?? body.meta?.event_name
35 const order = body.data?.attributes ?? {}
36
37 // Guard: only subscription_cancelled events.
38 if (event !== "subscription_cancelled") {
39 console.log(`Ignoring Lemon Squeezy "${event ?? "unknown"}" event`)
40 return null
41 }
42
43 const sub = order
44 const until = sub.ends_at && day(sub.ends_at) ? `. Access until ${day(sub.ends_at)}.` : ""
45
46 return {
47 title: "👋 Subscription cancelled",
48 message: [sub.user_name, sub.product_name].filter(Boolean).join(" — ") + until + testMode(body) || "A subscription was cancelled",
49 topic: "Lemon Squeezy",
50 priority: 0, // Normal — worth knowing; they keep access until the period ends
51 }
52}
Payload

The Lemon Squeezy subscription_cancelled webhook

This is what Lemon Squeezy sends to your URL for subscription_cancelled. It is a sample, trimmed to the fields recipes use.

subscription_cancelled · sample.json
1{
2 "data": {
3 "id": "33445",
4 "type": "subscriptions",
5 "attributes": {
6 "status": "cancelled",
7 "ends_at": "2026-10-13T09:45:53.000000Z",
8 "cancelled": true,
9 "renews_at": "2026-10-13T09:45:53.000000Z",
10 "test_mode": false,
11 "user_name": "Jane Doe",
12 "user_email": "[email protected]",
13 "product_name": "Acme Pro",
14 "variant_name": "Monthly",
15 "trial_ends_at": null,
16 "status_formatted": "Cancelled"
17 }
18 },
19 "meta": {
20 "test_mode": false,
21 "event_name": "subscription_cancelled",
22 "webhook_id": "a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d"
23 }
24}
FAQ

Lemon Squeezy subscription cancelled 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 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.

Ready when you are

Lemon Squeezy on your phone in two minutes.

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