See llms.txt for all machine-readable content.

Back to Templates

Send Stripe refund and dispute alerts to Telegram

Quick Overview

This workflow receives Stripe webhook events for refunds and charge disputes, verifies each event by re-fetching it from the Stripe API, de-duplicates repeated notifications, and sends a formatted alert to a Telegram chat, returning a 200 response to Stripe (or 400 when the event cannot be verified).

How it works

  1. Receives a POST webhook from Stripe containing an event ID and event type.
  2. Checks the incoming payload for a valid Stripe event ID and whether the event type is in the allowed list (refunds and dispute events).
  3. Retrieves the full event details from the Stripe Events API using your Stripe credentials to ensure the webhook call is authentic.
  4. Rejects unverified events and skips events that were already processed using workflow static data for de-duplication.
  5. Formats a Telegram-ready message with key details (amount, reason/status, evidence due date when present, and a Stripe Dashboard link).
  6. Sends the alert to Telegram and responds to Stripe with JSON and an appropriate HTTP status (200 for handled/ignored/duplicates, 400 for invalid or unverified events).

Setup

  1. Add a Stripe API credential (a restricted key with access to read Events is sufficient).
  2. Create a Telegram bot via @BotFather, add the Telegram credential in n8n, and set your target Telegram chat ID in the CONFIG node.
  3. Copy the n8n production webhook URL and register it in Stripe (Developers → Webhooks) for the event types listed in CONFIG (charge.dispute.created, charge.dispute.closed and charge.refunded).