<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Eddie Tai</title>
    <description>The latest articles on DEV Community by Eddie Tai (@t_87a26b0dcaa8835af201ec9).</description>
    <link>https://dev.to/t_87a26b0dcaa8835af201ec9</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4271527%2F1e09f610-4b9e-4634-82c9-65938dd93136.png</url>
      <title>DEV Community: Eddie Tai</title>
      <link>https://dev.to/t_87a26b0dcaa8835af201ec9</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/t_87a26b0dcaa8835af201ec9"/>
    <language>en</language>
    <item>
      <title>How to Build an Idempotent Stripe Failed-Payment Recovery Sequence (With 5 Email Templates)</title>
      <dc:creator>Eddie Tai</dc:creator>
      <pubDate>Sun, 29 Nov 2026 00:48:03 +0000</pubDate>
      <link>https://dev.to/t_87a26b0dcaa8835af201ec9/how-to-build-an-idempotent-stripe-failed-payment-recovery-sequence-with-5-email-templates-3gk9</link>
      <guid>https://dev.to/t_87a26b0dcaa8835af201ec9/how-to-build-an-idempotent-stripe-failed-payment-recovery-sequence-with-5-email-templates-3gk9</guid>
      <description>&lt;p&gt;Involuntary churn happens quietly: a corporate card expires, an issuer triggers a temporary fraud hold, and a paying SaaS customer disappears without ever clicking Cancel.&lt;/p&gt;

&lt;p&gt;Here is the clean webhook and email architecture I use to handle &lt;code&gt;invoice.payment_failed&lt;/code&gt; events without spamming customers on Stripe retries.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Classify Soft vs Hard Declines
&lt;/h2&gt;

&lt;p&gt;Inspect &lt;code&gt;invoice.payment_intent.last_payment_error.decline_code&lt;/code&gt; before choosing the message tone:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Soft declines&lt;/strong&gt; (&lt;code&gt;insufficient_funds&lt;/code&gt;, &lt;code&gt;do_not_honor&lt;/code&gt;, &lt;code&gt;try_again_later&lt;/code&gt;): keep the Day 0 notice calm and mention that Stripe will retry automatically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hard declines&lt;/strong&gt; (&lt;code&gt;expired_card&lt;/code&gt;, &lt;code&gt;lost_card&lt;/code&gt;, &lt;code&gt;card_not_supported&lt;/code&gt;): ask directly for a new card using a 1-click hosted billing link.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Enforce Idempotency Per Attempt
&lt;/h2&gt;

&lt;p&gt;Stripe delivers webhooks at-least-once. Deduplicate notifications on &lt;code&gt;(invoice_id, attempt_count)&lt;/code&gt; so a retried webhook never sends two emails for the same failure.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Never Require a Login Wall to Update a Card
&lt;/h2&gt;

&lt;p&gt;Forgotten passwords kill recovery rates. Route directly to Stripe Hosted Invoice pages or a pre-authenticated Customer Portal link (&lt;code&gt;{{invoice_or_billing_url}}&lt;/code&gt;) so the customer can fix billing in under 30 seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Copy-Paste Templates &amp;amp; Webhook Reference
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Interactive template customizer (with live merge tags): &lt;a href="https://renewalrescue.com/stripe-failed-payment-email-templates" rel="noopener noreferrer"&gt;Failed Payment Email Templates&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Open-source MIT Markdown/JSON template pack: &lt;a href="https://github.com/taieddie/stripe-dunning-email-templates" rel="noopener noreferrer"&gt;taieddie/stripe-dunning-email-templates&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>stripe</category>
      <category>saas</category>
      <category>billing</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
