Recover failed Stripe payments with WhatsApp via Heyy
When a Stripe payment fails, add the customer to Heyy with the right recovery label so WhatsApp does the dunning, and ping revenue ops in Slack.
Build an agent workflow that turns failed Stripe payments into a labeled WhatsApp recovery flow in Heyy and a structured alert in Slack #revenue-ops. The label-routing judgement is the reason this is an agent, not a code workflow.
Trigger: incoming webhook from Stripe on the invoice.payment_failed event. The agent should also handle charge.failed payloads sent to the same webhook if I forward them.
When the webhook fires, the agent should:
1. Use Stripe Retrieve Customer with the customer id from the event payload to get the customer's name, email, and phone.
2. Use Stripe Retrieve Invoice with the invoice id from the event payload to get the invoice amount due and the attempt count. Skip this step gracefully if the event is a charge.failed without an invoice attached.
3. Decide a recovery label using this judgement: if invoice amount_due is at or above a high-value threshold (default 50000 cents, i.e. $500, expose as a config knob), use payment-failed-high-value. Otherwise, if attempt_count is 1, use payment-failed-soft. If attempt_count is 2 or more, use payment-failed-urgent. The label names should be configurable so I can match the labels I've already set up in Heyy.
4. Use Heyy Create Contact with the customer's phone number (required) and email, attaching the chosen label so my existing Heyy WhatsApp automations pick them up. If the customer has no phone on file in Stripe, skip the Heyy step and note that in the Slack alert.
5. Use Slack Send a Message to post to #revenue-ops with a structured summary: customer name and email, invoice amount in dollars, attempt count, the Heyy label that was applied (or a note that no Heyy contact was created because phone was missing), and a link back to the customer in the Stripe dashboard. Format it as a single readable message so the team can scan and decide whether to escalate.
Configuration knobs to expose: the high-value threshold in cents, the three label names (soft, urgent, high-value), and the Slack channel name.
Error handling: if Stripe Retrieve Customer or Retrieve Invoice fails, still post a degraded Slack alert with whatever information is available from the raw webhook payload so revenue ops is never blind to a failure.
Additional information
What does this prompt do?
- Listens for failed payments in Stripe and reacts the moment a charge or invoice fails.
- Pulls the customer's name, email, and phone from Stripe so the recovery message has the right contact details.
- Picks a recovery label based on attempt count and invoice size, so first-time misses get a gentle nudge and repeat or high-value failures get the urgent treatment.
- Adds the customer to Heyy with that label, which kicks off the matching WhatsApp recovery sequence you've already built.
- Posts a clean summary to your revenue ops Slack channel with the amount, attempt count, customer email, and the label that was applied.
What do I need to use this?
- A Stripe account with permission to receive failed payment events.
- A Heyy workspace with WhatsApp set up and recovery labels configured (for example soft, urgent, and high-value).
- A Slack workspace and the channel where revenue ops should be alerted.
How can I customize it?
- Change the high-value threshold so larger invoices route to your urgent label instead of the soft one.
- Rename the labels to match the ones you already use inside Heyy to drive automations.
- Point the Slack alert at a different channel, or tag specific teammates when the failure is high-value.
Frequently asked questions
Why use WhatsApp instead of email for payment recovery?
Does this send the WhatsApp message itself?
What decides which label gets applied?
Can I send the Slack alert to a private channel?
What happens if the customer is already in Heyy?
Stop losing revenue to silent failed payments.
Connect Stripe, Heyy, and Slack once, and every failed payment turns into a labeled WhatsApp recovery and a heads-up for revenue ops.