Polar order paid notifications on your phone.

Get a push notification with the amount, product and customer every time a Polar order is paid, including new subscriptions and renewals.

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 Polar

Add it as a webhook for order.paid.

STEP 03

Get a push on your phone

With the text, sound and buttons from the recipe.

Setup

How to set up the Polar order.paid 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 the Polar dashboard, open Settings > Webhooks and click Add Endpoint.
  3. Paste your webhook URL as the URL and leave the format on Raw.https://••••••••/•••••••• your personal URL, shown after install
  4. Generate a secret (JustPush doesn't need it), tick the order.paid event and save.
  5. Tick **order.paid**, not `order.created`: renewal orders are created as *pending* before the payment goes through, while `order.paid` only fires once the money is in. It covers one-time purchases, new subscriptions and renewals, each with its own title.
  6. Don't want a push for every renewal? Add `?renewals=0` to the URL. Testing in the **sandbox**? Add `?sandbox=1` so the button opens the sandbox dashboard:
  7. ```
  8. your webhook URL?renewals=0
  9. ```
  10. Polar signs every delivery (`webhook-id`, `webhook-timestamp`, `webhook-signature`; Standard Webhooks for secrets made on or after 8 September 2026), but JustPush doesn't check that signature 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// Polar → order.paid
2// Fires when an order is fully processed and paid: one-time purchases, new subscriptions and renewals.
3// Docs: https://polar.sh/docs/api-reference/current/order_paid
4//
5// Use order.paid rather than order.created: renewal orders are created as "pending" before
6// the payment goes through.
7
8// How each billing reason reads, and how loud to be.
9const REASONS = {
10 purchase: { title: "💰 New order", priority: 0 }, // Normal: a sale
11 subscription_create: { title: "🎉 New subscriber", priority: 0 }, // Normal: a new customer
12 subscription_cycle: { title: "🔁 Subscription renewed", priority: -1, renewal: true }, // Low: routine
13 subscription_meter_cycle: { title: "🔁 Usage billed", priority: -1, renewal: true }, // Low: routine
14 subscription_update: { title: "⬆️ Subscription changed", priority: 0 }, // Normal: upgrade or seat change
15}
16
17// Polar amounts are in the currency's smallest unit (cents), except zero-decimal currencies.
18const ZERO_DECIMAL = new Set([
19 "bif", "clp", "djf", "gnf", "jpy", "kmf", "krw", "mga",
20 "pyg", "rwf", "ugx", "vnd", "vuv", "xaf", "xof", "xpf",
21])
22
23function money(amount, currency) {
24 if (typeof amount !== "number" || !Number.isFinite(amount) || typeof currency !== "string" || !currency) return null
25
26 const code = currency.toLowerCase()
27 const value = ZERO_DECIMAL.has(code) ? amount : amount / 100
28
29 try {
30 return new Intl.NumberFormat("en-GB", { style: "currency", currency: code.toUpperCase() }).format(value)
31 } catch {
32 return `${value} ${code.toUpperCase()}`
33 }
34}
35
36// Table lookup that ignores inherited names such as "toString".
37function pick(table, key, fallback) {
38 return typeof key === "string" && Object.prototype.hasOwnProperty.call(table, key) ? table[key] : fallback
39}
40
41// Only link to real http(s) URLs.
42function link(url, cta) {
43 return typeof url === "string" && /^https?:\/\//.test(url) ? [{ cta, url }] : []
44}
45
46// A non-empty string, or null.
47function text(value) {
48 return typeof value === "string" && value.trim() ? value.trim() : null
49}
50
51function flag(query, name) {
52 return ["1", "true", "yes"].includes(String(query?.[name] ?? "").toLowerCase())
53}
54
55function handleRequest(request) {
56 const body = request.body && typeof request.body === "object" ? request.body : {}
57 const order = body.data
58
59 // Guard: only order.paid, so other Polar events on this integration stay quiet.
60 if (body.type !== "order.paid" || !order || typeof order !== "object" || !order.id) {
61 console.log(`Ignoring Polar "${typeof body.type === "string" ? body.type : "unknown"}" event`)
62 return null
63 }
64
65 const reason = pick(REASONS, order.billing_reason, { title: "💰 Order paid", priority: 0 })
66
67 // ?renewals=0 on the webhook URL skips routine renewal payments.
68 if (reason.renewal && ["0", "false", "no"].includes(String(request.query?.renewals ?? "").toLowerCase())) {
69 console.log("Skipping renewal (renewals=0)")
70 return null
71 }
72
73 const free = order.total_amount === 0
74 const total = free ? "Free" : money(order.total_amount, order.currency)
75 const who = text(order.customer?.name) ?? text(order.billing_name) ?? text(order.customer?.email)
76 const product = text(order.product?.name) ?? text(order.description)
77 // ?sandbox=1 points the button at the sandbox dashboard.
78 const host = flag(request.query, "sandbox") ? "https://sandbox.polar.sh" : "https://polar.sh"
79
80 return {
81 title: reason.title,
82 message:
83 (total ?? "An order") +
84 (product ? ` · ${product}` : "") +
85 (who ? ` · ${who}` : ""),
86 topic: "Polar",
87 priority: free ? -1 : reason.priority, // free orders are Low: nothing was earned
88 ...(free ? {} : { sound: "cashregister" }),
89 buttons: link(`${host}/to/dashboard/sales/${encodeURIComponent(order.id)}`, "View order"),
90 }
91}
Payload

The Polar order.paid webhook

This is what Polar sends to your URL for order.paid. It is a sample, trimmed to the fields recipes use.

order.paid · sample.json
1{
2 "data": {
3 "id": "7e3a5c1d-2b4f-4c8e-9a1b-0f2d3e4c5b6a",
4 "paid": true,
5 "items": [
6 {
7 "label": "Lifetime licence",
8 "amount": 4900,
9 "proration": false,
10 "tax_amount": 1029
11 }
12 ],
13 "status": "paid",
14 "product": {
15 "id": "p1a2b3c4-d5e6-4f70-8a9b-0c1d2e3f4a5b",
16 "name": "Lifetime licence",
17 "description": null,
18 "is_archived": false,
19 "is_recurring": false,
20 "organization_id": "o1a2b3c4-d5e6-4f70-8a9b-0c1d2e3f4a5b",
21 "recurring_interval": null
22 },
23 "currency": "eur",
24 "customer": {
25 "id": "c1a2b3c4-d5e6-4f70-8a9b-0c1d2e3f4a5b",
26 "name": "Jane Doe",
27 "type": "individual",
28 "email": "[email protected]",
29 "billing_name": "Jane Doe",
30 "email_verified": true,
31 "organization_id": "o1a2b3c4-d5e6-4f70-8a9b-0c1d2e3f4a5b"
32 },
33 "metadata": [],
34 "created_at": "2026-09-29T08:06:30.000000Z",
35 "due_amount": 0,
36 "net_amount": 4900,
37 "product_id": "p1a2b3c4-d5e6-4f70-8a9b-0c1d2e3f4a5b",
38 "tax_amount": 1029,
39 "checkout_id": "k1a2b3c4-d5e6-4f70-8a9b-0c1d2e3f4a5b",
40 "customer_id": "c1a2b3c4-d5e6-4f70-8a9b-0c1d2e3f4a5b",
41 "description": "Lifetime licence",
42 "discount_id": null,
43 "modified_at": "2026-09-29T08:06:40.000000Z",
44 "billing_name": "Jane Doe",
45 "subscription": null,
46 "total_amount": 5929,
47 "billing_reason": "purchase",
48 "invoice_number": "ACME-0042",
49 "discount_amount": 0,
50 "refunded_amount": 0,
51 "subscription_id": null,
52 "subtotal_amount": 4900,
53 "refunded_tax_amount": 0,
54 "applied_balance_amount": 0
55 },
56 "type": "order.paid",
57 "timestamp": "2026-09-29T08:06:40.000000Z"
58}
FAQ

Polar order paid 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 Polar 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

Polar on your phone in two minutes.

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