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
- Receives a POST webhook from Stripe containing an event ID and event type.
- Checks the incoming payload for a valid Stripe event ID and whether the event type is in the allowed list (refunds and dispute events).
- Retrieves the full event details from the Stripe Events API using your Stripe credentials to ensure the webhook call is authentic.
- Rejects unverified events and skips events that were already processed using workflow static data for de-duplication.
- Formats a Telegram-ready message with key details (amount, reason/status, evidence due date when present, and a Stripe Dashboard link).
- 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
- Add a Stripe API credential (a restricted key with access to read Events is sufficient).
- Create a Telegram bot via @BotFather, add the Telegram credential in n8n, and set your target Telegram chat ID in the CONFIG node.
- 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).