Hand failed Stripe payments to ActiveCampaign dunning and alert Slack

By General Input

When a Stripe charge or invoice fails, tag the customer in ActiveCampaign so your dunning series fires the right email, and brief revenue ops in Slack.

Integrations

  • Stripe
  • ActiveCampaign
  • Slack

Type

Agentic Task

Categories

  • Finance
  • Operations

Build me an agent workflow that recovers failed Stripe payments by handing them off to my existing ActiveCampaign dunning automation and alerting revenue ops in Slack.

Trigger: a Stripe webhook that fires on both charge.failed and invoice.payment_failed events. Skip any event where livemode is false (no test-mode noise).

From the Stripe event, extract: customer email (data.object.customer_email, falling back to the customer's billing email if needed), amount (data.object.amount or amount_due, which is in cents), failure reason (failure_message for charges, last_finalization_error or attempt_count context for invoices), and the retry attempt number from Stripe's metadata (data.object.attempt_count for invoices, or 1 for charges if not provided).

Then in ActiveCampaign: call List Contacts with an email filter to find the matching contact. If a contact exists, call Add Tag to Contact with a tag named payment-failed-attempt-1, payment-failed-attempt-2, or payment-failed-attempt-3 based on the attempt number from Stripe. (The POST /contactTags body shape is { contactTag: { contact, tag } }.) If no matching contact exists, create one via Create Contact in sync mode (the upsert endpoint) using the email, then add the same tag. The tag is what fires the customer's existing ActiveCampaign automation series, so the right dunning email goes out.

Then in Slack: use Send a Message to post to a finance or revenue ops channel I'll specify at setup. Include the customer name (or email if no name), the amount converted from cents to dollars (Stripe is in cents, ActiveCampaign monetary fields are also in cents, but the Slack message should be human dollars like $129.00), the failure reason translated to plain English (insufficient funds, card expired, card declined by issuer, etc.), the retry attempt number, and a clickable link to the Stripe customer (https://dashboard.stripe.com/customers/{customer_id}).

Integrations: Stripe (webhook trigger + minimal lookups if needed), ActiveCampaign (List Contacts, Create Contact sync, Add Tag to Contact), Slack (Send a Message). Use the user-OAuth Slack integration.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredLet support send one-off Loops emails without an engineerCustomer lifecycle inspector for Loops, Stripe and PostHogChat quality review board for LiveChat support leadsWin back no-show and cancelled appointments every morningLive Loop returns analytics with product-level drill-downMonth-end Stripe finance pack, stored and shared in SlackNewsletter pre-flight and approval board for Mailjet sendsTurn a prospect spreadsheet into personalized sequence enrollments