Gumroad new dispute notifications on your phone.

Get a high-priority push notification when a buyer disputes a Gumroad sale, and a quiet one when you win it.

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 Gumroad

Add it as a webhook for dispute.

STEP 03

Get a push on your phone

With the text, sound and buttons from the recipe.

Setup

How to set up the Gumroad dispute 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 Gumroad, open Settings > Advanced.
  3. For sales, paste your webhook URL into Ping endpoint and save. For other events, subscribe it to the dispute resource with the API call in the setup notes.https://••••••••/•••••••• your personal URL, shown after install
  4. Gumroad doesn't sign pings, so keep the URL private.
  5. Gumroad's **Ping endpoint** setting only covers sales. For `dispute` pings, subscribe the URL through Gumroad's API:
  6. In Gumroad, open **Settings → Advanced → Applications**, create an application (any name, and any https URL such as `https://example.com` as the redirect URI), then click **Generate access token**.
  7. Run this, with your token in place of `YOUR_ACCESS_TOKEN`:
  8. ```
  9. curl https://api.gumroad.com/v2/resource_subscriptions \
  10. -d "access_token=YOUR_ACCESS_TOKEN" \
  11. -d "resource_name=dispute" \
  12. --data-urlencode "post_url=your webhook URL" \
  13. -X PUT
  14. ```
  15. To also get a quiet **✅ Dispute won** push, run the same call again with `resource_name=dispute_won`.
  16. Pings only arrive while the application and its access token exist, so don't delete or revoke them. Gumroad sends them form-encoded, retries a failed delivery a few times and can deliver the same event twice.
  17. Gumroad doesn't sign pings, 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// Gumroad → dispute and dispute_won (resource subscriptions)
2// Fires when a buyer disputes a sale (chargeback) and, if you subscribe to it too, when you win it.
3// Docs: https://gumroad.com/api#resource-subscriptions
4//
5// Gumroad POSTs form-encoded fields such as product_name=…, price=4900, refunded=true.
6// Depending on how the body was parsed, it can arrive as a nested object, a flat object
7// with bracket keys, or only as the raw string. Every value is a string ("true", "4900").
8
9const TOPIC = "Gumroad"
10
11// Keys that must never become object properties.
12const UNSAFE = new Set(["__proto__", "constructor", "prototype"])
13
14// Put a value at a bracket path such as card[visual] or purchase_ids[].
15function setPath(target, key, value) {
16 const list = /\[\]$/.test(key)
17 const parts = String(key).replace(/\[\]$/, "").replace(/\]/g, "").split("[")
18 if (parts.some((p) => p === "" || UNSAFE.has(p))) return
19 let node = target
20 for (const part of parts.slice(0, -1)) {
21 if (!Object.prototype.hasOwnProperty.call(node, part) || !node[part] || typeof node[part] !== "object" || Array.isArray(node[part])) node[part] = {}
22 node = node[part]
23 }
24 const last = parts[parts.length - 1]
25 if (!list) node[last] = value
26 else if (Array.isArray(node[last]) && Object.prototype.hasOwnProperty.call(node, last)) node[last].push(value)
27 else node[last] = [value]
28}
29
30// Decode one form-encoded piece; a bad escape shouldn't break the whole body.
31function decode(value) {
32 try {
33 return decodeURIComponent(String(value).replace(/\+/g, " "))
34 } catch {
35 return String(value)
36 }
37}
38
39// Turn whatever Studio gives us (object, JSON string or raw form string) into one object.
40function readForm(request) {
41 let body = request.body
42 if (typeof body === "string" && body.trim().startsWith("{")) {
43 try {
44 body = JSON.parse(body)
45 } catch {
46 body = null
47 }
48 }
49 const out = {}
50 if (body && typeof body === "object" && !Array.isArray(body)) {
51 for (const [key, value] of Object.entries(body)) {
52 if (key.includes("[")) setPath(out, key, value)
53 else if (!UNSAFE.has(key)) out[key] = value
54 }
55 if (Object.keys(out).length) return out
56 }
57 // Fall back to the raw form-encoded string.
58 const raw = typeof body === "string" ? body : typeof request.raw === "string" ? request.raw : ""
59 for (const pair of raw.split("&")) {
60 if (!pair) continue
61 const at = pair.indexOf("=")
62 setPath(out, decode(at < 0 ? pair : pair.slice(0, at)), at < 0 ? "" : decode(pair.slice(at + 1)))
63 }
64 return out
65}
66
67// Read an own field only, so names like "toString" never resolve to something inherited.
68function field(form, key) {
69 return Object.prototype.hasOwnProperty.call(form, key) ? form[key] : undefined
70}
71
72// Form fields are strings; treat blanks as missing.
73function text(value) {
74 if (typeof value === "number" && Number.isFinite(value)) return String(value)
75 return typeof value === "string" && value.trim() ? value.trim() : null
76}
77
78// Booleans arrive as "true"/"false" in form bodies and as true/false in JSON.
79function flag(value) {
80 return value === true || value === "true"
81}
82
83// Gumroad's price is always in USD cents, whatever the product's currency field says.
84function usd(cents) {
85 const n = typeof cents === "number" ? cents : /^-?\d+(\.\d+)?$/.test(text(cents) ?? "") ? Number(cents) : NaN
86 if (!Number.isFinite(n)) return null
87 try {
88 return new Intl.NumberFormat("en-GB", { style: "currency", currency: "USD" }).format(n / 100)
89 } catch {
90 return `US$${(n / 100).toFixed(2)}`
91 }
92}
93
94// Only link to real http(s) URLs.
95function link(url, cta) {
96 return typeof url === "string" && /^https?:\/\//.test(url) ? [{ cta, url }] : []
97}
98
99// Look a key up without tripping over inherited names such as "toString".
100function pick(table, key, fallback) {
101 return Object.prototype.hasOwnProperty.call(table, key) ? table[key] : fallback
102}
103
104// Each resource this recipe answers, and how loud it is.
105const EVENTS = {
106 dispute: { title: "⚖️ New dispute", priority: 1 }, // High — the money is held and Gumroad may ask you for evidence
107 dispute_won: { title: "✅ Dispute won", priority: -1 }, // Low — good news, the money is back
108}
109
110function handleRequest(request) {
111 const form = readForm(request)
112 const resource = text(field(form, "resource_name"))
113 const event = pick(EVENTS, resource, null)
114
115 // Guard: only dispute pings. They look like sale pings, so resource_name decides.
116 if (!event) {
117 console.log(`Ignoring Gumroad "${resource ?? "unknown"}" ping`)
118 return null
119 }
120
121 const amount = usd(field(form, "price"))
122 const who = text(field(form, "full_name")) ?? text(field(form, "email"))
123 const product = text(field(form, "product_name")) ?? "a product"
124
125 return {
126 title: event.title,
127 message:
128 (resource === "dispute"
129 ? `${who ?? "A customer"} disputed ${amount ?? "a payment"}`
130 : `${amount ?? "A payment"} from ${who ?? "a customer"}`) +
131 ` — ${product}`,
132 topic: TOPIC,
133 priority: event.priority,
134 buttons: link("https://app.gumroad.com/customers", "View sales"),
135 }
136}
Payload

The Gumroad dispute webhook

This is what Gumroad sends to your URL for dispute. It is a sample, trimmed to the fields recipes use.

dispute · sample.json
1{
2 "card": {
3 "type": "visa",
4 "visual": "**** **** **** 4242"
5 },
6 "email": "[email protected]",
7 "price": "4900",
8 "sale_id": "yN3kP8sQ1wR5tU7vX9zA2g==",
9 "currency": "usd",
10 "disputed": "true",
11 "quantity": "1",
12 "referrer": "direct",
13 "refunded": "false",
14 "full_name": "Jane Doe",
15 "permalink": "acme-course",
16 "seller_id": "x7Q2kL0vT1aB7cD3eF5gHw==",
17 "ip_country": "Netherlands",
18 "product_id": "Qm9vc3RlclRlc3QxMjM0NQ==",
19 "can_contact": "true",
20 "dispute_won": "false",
21 "gumroad_fee": "540",
22 "order_number": "524980123",
23 "product_name": "Acme Design Course",
24 "purchaser_id": "1234567890123",
25 "resource_name": "dispute",
26 "sale_timestamp": "2026-09-29T09:45:53Z",
27 "short_product_id": "qzxbt",
28 "product_permalink": "https://acme.gumroad.com/l/acme-course",
29 "discover_fee_charged": "false",
30 "is_gift_receiver_purchase": "false"
31}
FAQ

Gumroad new dispute 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 Gumroad 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

Gumroad on your phone in two minutes.

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