Lemon Squeezy order refunded notifications on your phone.

Get a push notification when a Lemon Squeezy order is fully or partially refunded.

order_refundedFinancePayments
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 order_refunded.

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 order_refunded 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 order_refunded.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 `order_refunded`.
  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 → order refunded
2// Fires when an order is fully or partially refunded.
3// Docs: https://docs.lemonsqueezy.com/help/webhooks/event-types
4
5// The event name comes in the X-Event-Name header and in meta.event_name.
6// Header names can arrive in any case.
7function header(request, name) {
8 const headers = request.headers || {}
9 const key = Object.keys(headers).find((k) => k.toLowerCase() === name)
10 const value = key ? headers[key] : null
11 return Array.isArray(value) ? value[0] : value
12}
13
14// Lemon Squeezy puts test_mode in meta on real deliveries and in the attributes in its examples.
15function testMode(body) {
16 return (body.meta?.test_mode ?? body.data?.attributes?.test_mode) === true ? " (test mode)" : ""
17}
18
19// Only link to real http(s) URLs.
20function link(url, cta) {
21 return typeof url === "string" && /^https?:\/\//.test(url) ? [{ cta, url }] : []
22}
23
24function handleRequest(request) {
25 const body = request.body || {}
26 const event = header(request, "x-event-name") ?? body.meta?.event_name
27 const order = body.data?.attributes ?? {}
28
29 // Guard: only order_refunded events.
30 if (event !== "order_refunded") {
31 console.log(`Ignoring Lemon Squeezy "${event ?? "unknown"}" event`)
32 return null
33 }
34
35 const partial = order.status === "partial_refund"
36 const amount = order.refunded_amount_formatted ?? order.total_formatted
37
38 return {
39 title: `↩️ ${partial ? "Partial refund" : "Refund"} for order #${order.order_number ?? body.data?.id}`,
40 message: (amount ? `${amount} refunded` : "Refunded") + (order.user_name ? ` to ${order.user_name}` : "") + testMode(body),
41 topic: "Lemon Squeezy",
42 priority: -1, // Low — you most likely issued it yourself
43 buttons: link(order.urls?.receipt, "View receipt"),
44 }
45}
Payload

The Lemon Squeezy order_refunded webhook

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

order_refunded · sample.json
1{
2 "data": {
3 "id": "1234567",
4 "type": "orders",
5 "attributes": {
6 "urls": {
7 "receipt": "https://app.lemonsqueezy.com/my-orders/104e18a2-d755-4d4b-80c4-a6c1dcbe1c10?signature=abc"
8 },
9 "total": 5929,
10 "status": "refunded",
11 "currency": "EUR",
12 "refunded": true,
13 "test_mode": false,
14 "user_name": "Jane Doe",
15 "user_email": "[email protected]",
16 "refunded_at": "2026-09-29T11:00:00.000000Z",
17 "order_number": 1042,
18 "refunded_amount": 5929,
19 "total_formatted": "€59.29",
20 "status_formatted": "Refunded",
21 "refunded_amount_formatted": "€59.29"
22 }
23 },
24 "meta": {
25 "test_mode": false,
26 "event_name": "order_refunded",
27 "webhook_id": "a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d"
28 }
29}
FAQ

Lemon Squeezy order refunded 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.