# Lemon Squeezy order refunded notifications on your phone > Get a push notification when a Lemon Squeezy order is fully or partially refunded. - Company: Lemon Squeezy (https://www.justpush.io/recipes/lemonsqueezy) - Event: `order_refunded` (order_refunded) - Tags: Finance, Payments - Install: https://studio.justpush.io/recipes/lemonsqueezy/order-refunded - Web page: https://www.justpush.io/recipes/lemonsqueezy/order-refunded ## 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 order_refunded. 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. ## 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 → order refunded // Fires when an order is fully or partially refunded. // Docs: https://docs.lemonsqueezy.com/help/webhooks/event-types // 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 order_refunded events. if (event !== "order_refunded") { console.log(`Ignoring Lemon Squeezy "${event ?? "unknown"}" event`) return null } const partial = order.status === "partial_refund" const amount = order.refunded_amount_formatted ?? order.total_formatted return { title: `↩️ ${partial ? "Partial refund" : "Refund"} for order #${order.order_number ?? body.data?.id}`, message: (amount ? `${amount} refunded` : "Refunded") + (order.user_name ? ` to ${order.user_name}` : "") + testMode(body), topic: "Lemon Squeezy", priority: -1, // Low — you most likely issued it yourself buttons: link(order.urls?.receipt, "View receipt"), } } ``` ## Lemon Squeezy order_refunded webhook payload (sample) ```json { "data": { "id": "1234567", "type": "orders", "attributes": { "urls": { "receipt": "https://app.lemonsqueezy.com/my-orders/104e18a2-d755-4d4b-80c4-a6c1dcbe1c10?signature=abc" }, "total": 5929, "status": "refunded", "currency": "EUR", "refunded": true, "test_mode": false, "user_name": "Jane Doe", "user_email": "jane@example.com", "refunded_at": "2026-09-29T11:00:00.000000Z", "order_number": 1042, "refunded_amount": 5929, "total_formatted": "€59.29", "status_formatted": "Refunded", "refunded_amount_formatted": "€59.29" } }, "meta": { "test_mode": false, "event_name": "order_refunded", "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.