What does the RevenueDot webhook event REFUND_REVERSED mean?

The RevenueDot webhook event REFUND_REVERSED means the store took back a refund, so the customer has the purchase again.

Quick facts#

Event REFUND_REVERSED
Where RevenueDot webhook (event.type), RevenueCat's webhook format
Sent to Every enabled webhook whose filters match
Fields that are specific to it renewal_number
What it means A refund was reversed and access is back.

When it is sent#

  • The store reversed a refund, for example after a customer dispute (Apple's REFUND_REVERSED).
  • The purchase had a CANCELLATION with cancel_reason: CUSTOMER_SUPPORT before.
  • renewal_number gives the number of renewals the subscription had gone through.

What your server should do#

  1. Restore the access or item that the refund removed.
  2. Undo the refund in your revenue records: price is the money that moved back.
  3. Match it to the earlier refund by transaction_id.
  4. Deduplicate on event.id: deliveries can repeat, because anything but HTTP 200 is retried after 5, 10, 20, 40 and 80 minutes.

Example#

JavaScript
import { createHmac, timingSafeEqual } from "node:crypto";

// X-RevenueCat-Webhook-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>">
function verify(rawBody, header, secret, toleranceSeconds = 300) {
  const m = /^t=(\d+),v1=([0-9a-f]{64})$/.exec(header ?? "");
  if (!m || Math.abs(Date.now() / 1000 - Number(m[1])) > toleranceSeconds) return false;
  const expected = createHmac("sha256", secret).update(`${m[1]}.${rawBody}`).digest();
  return timingSafeEqual(expected, Buffer.from(m[2], "hex"));
}

// Sign a sample delivery the way RevenueDot does, then handle it.
const secret = "whsec_test_secret";
const rawBody = JSON.stringify({ api_version: "1.0", event: {"id":"66339910-3BFF-49F4-B873-D1283D673DE2","type":"REFUND_REVERSED","app_user_id":"user_1","product_id":"pro_monthly","transaction_id":"2000000123456789","renewal_number":3} });
const t = Math.floor(Date.now() / 1000);
const header = `t=${t},v1=${createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex")}`;

const seen = new Set(); // use a database table in production

function handle(rawBody, header) {
  if (!verify(rawBody, header, secret)) return "401 bad signature";
  const { event } = JSON.parse(rawBody);
  if (seen.has(event.id)) return "200 duplicate";
  seen.add(event.id);
  if (event.type !== "REFUND_REVERSED") return "200 ignored";
  return "restore access, undo the refund for " + event.transaction_id;
}

console.log(handle(rawBody, header));

Run-checked: npm run check:snippets runs this snippet with Node and compares its output with undo the refund for (checked 2026-10-03).

How RevenueDot produces it#

diffSubscription and diffNonSubscription return REFUND_REVERSED when a stored refund time is cleared and the change is not a new period. recordEvent adds renewal_number, a count of the customer's renewal transactions for that product.

Source#

Checked: 2026-10-03

Edit this page on GitHub ↗ View as Markdown Last updated