Aerostack
webhook

Payment Failed Handler — Webhook Template for Automation

Webhook
aerostack @aerostack verified
· Updated Mar 18, 2026

Stripe payment fails — AI alerts your billing team on Slack and creates a support ticket automatically.

star 90 stars content_copy 38 deploys stripe v1.0.0

Template Payment Failed Handler bundles a ready-to-deploy workspace for automation workflows. Install in one click from the Aerostack dashboard or via aerostack init --template=payment-failed-handler.

What It Does

Automate your response to failed Stripe payments. When a charge fails, this webhook uses AI to assess the severity, alert the right people on Slack, and create a support ticket — all within seconds of the event.

No more missed payment failures sitting in a Stripe dashboard that nobody checks.

How It Works

  1. Stripe fires a payment_intent.payment_failed or charge.failed webhook event
  2. AI analyzes the payload — extracts customer info, amount, failure reason, and checks if they are on a paid plan
  3. Severity assessment — high-value customers or amounts over $50 trigger immediate Slack alerts to #billing-alerts
  4. Ticket creation — a support ticket tagged "billing-failure" is created with full context for your team to follow up

Example Scenario

A customer on your Pro plan ($99/mo) has a payment fail due to an expired card. Within 10 seconds: your #billing-alerts Slack channel gets a message with the customer name, amount, and failure reason. A support ticket is created. Your billing team reaches out before the customer even notices.

Triggers

  • payment_intent.payment_failed — payment attempt failed
  • charge.failed — charge was declined
  • invoice.payment_failed — subscription invoice payment failed

psychology System Prompt

The instructions that define how this webhook behaves. It ships pre-configured — edit it anytime in your workspace.

You are a payment failure handler. When a Stripe payment_intent.payment_failed or charge.failed event arrives, extract the customer email, name, amount, currency, and failure reason from the payload. Determine severity based on amount and customer plan. For high-value failures (over $50 or paid-plan customers), alert the billing team immediately and create a support ticket. For small amounts on free plans, log the event without alerting.

checklist Setup Guide

When a payment fails, check if the customer is on a paid plan. If yes and amount over 50 dollars, alert billing-alerts on Slack. Also create a support ticket.

Metadata

upgrade Version 1.0.0
description Type Webhook
category Category Automation
radio Trigger stripe

What's Included

check_circle System Prompt
check_circle Setup Guide

Required MCPs

MCP servers this template connects to.

Tags

webhook

Deploy this webhook in minutes

Stripe payment fails — AI alerts your billing team on Slack and creates a support ticket automatically.

More Automation Templates

Browse Automation Templates →

Frequently asked questions

What does the Payment Failed Handler webhook template do the moment a Stripe payment fails? +

It catches the Stripe webhook event, generates an AI summary of the failure reason, alerts the billing team in Slack, and creates a support ticket — all within seconds of the event.

Which MCPs are wired into the Payment Failed Handler template? +

@aerostack/mcp-slack posts the alert to your billing channel; @aerostack/mcp-crm creates and assigns the support ticket to the correct owner based on account type.

How do I change which Slack channel or CRM pipeline the Payment Failed Handler routes to? +

Update the channel name in the Slack MCP config and the pipeline ID in the CRM MCP settings inside the workspace. No code changes are needed.

What payment failure volume is the Payment Failed Handler webhook suited for? +

Works from a handful of failures per day to thousands. The webhook template is stateless and scales with Aerostack's serverless runtime, so there is no infrastructure to provision.