84 Stripe Decline Codes · Visa/MC Retry Rules 100% Browser-Local · Zero Stripe Key Required

Stripe Decline Code Calculator & SaaS Dunning Recovery Simulator

What is a Stripe decline code calculator? A Stripe decline code calculator is a billing operations utility that maps payment_intent and charge outcome decline_code strings into three actionable buckets—retriable soft declines, customer-action 3DS/card-update declines, and hard-stop declines prohibited from automated retries—while modeling monthly involuntary churn recovery and dunning ROI. Every lookup, ARR recovery calculation, and webhook router script runs locally in your browser without connecting your Stripe API keys.

Load SaaS Scenario:

1. Lookup Stripe decline_code

84 of 84 Stripe codes
insufficient_funds Soft Retry

Network Fee Risk
Optimal Schedule
Webhook Route
SaaS Benchmark

2. Idempotent Webhook & Portal Router

3. SaaS Involuntary Churn & Recovery ROI

Annualized ARR & Commission Model
Failed MRR at Risk $2,925/mo $35,100/yr gross involuntary churn exposure
Net Extra MRR Saved +$752/mo +$9,024 net ARR recovered / yr
% Dunning Vendor Tax $2,619/yr At 15% vendor revenue-share
1st-Year Fee Savings $2,570 vs. $49 one-time self-hosted Worker
Why self-hosted beats revenue-share dunning:

Percentage-based recovery tools claim 10%–20% of every subscription invoice that clears after a soft blip—even try_again_later and Friday payday retries that clear automatically. Running an idempotent Cloudflare Worker + D1 queue + Resend plain-text link router inside your own account keeps 100% of recovered ARR and never exposes customer PII to a third party.

Zero-Commission Billing Infrastructure

Self-Hosted Cloudflare Worker + Resend Dunning Pack ($49 One-Time)

Stop paying 15% of recovered MRR every month. Deploy a production-hardened TypeScript dunning engine directly to your own Cloudflare Workers & D1 account in 15 minutes.

  • Complete 84-code Visa/Mastercard Category 1 hard-stop guard (zero MAC excessive-retry fines)
  • Cloudflare D1 retry queue + 15-min Cron aligned to 24h velocity resets and 1st/15th paydays
  • HMAC-signed 1-click Stripe Billing Portal & hosted_invoice_url 3DS step-up deep links
  • 4 high-deliverability plain-text Resend templates + Slack recovered-revenue webhook alerts
$49 one-time buyout
Full TypeScript source · Unlimited Stripe accounts · $0 recurring tax
Request $49 Source Kit License → View All Free & Pro Tools

Stripe Decline Code Retry Legality & Recovery Matrix

Reference rules for the top 12 recurring SaaS failure codes across Visa, Mastercard, and PSD2 / SCA jurisdictions.

decline_code Classification Card Network Rule Issuer Root Cause Optimal Retry Window Automated Webhook Action SaaS Recovery
insufficient_fundsSoft RetryMax 4 retries in 30 days (Mastercard / Visa limit)Cardholder checking or credit limit temporarily exhausted at billing timestamp.+24h, +72h, then align to 1st or 15th payday at 09:00 local timePause immediate retry; schedule payday-window charge + subtle low-friction reminder after attempt 2.52% – 64%
do_not_honorSoft RetryMax 4 retries in 30 days; space >= 24h apartCatch-all issuer fraud or velocity filter triggered without a specific reason code.+24h, +72h, +144h; escalate to card-update portal link if attempt 2 failsRetry silently once at +24h; if declined twice, email pre-signed Billing Portal update link.41% – 53%
authentication_requiredCustomer Action (3DS)Off-session MIT exemption rejected; do NOT blind-retry off-sessionPSD2 / SCA or issuer step-up requires live cardholder 3D Secure verification.0 blind off-session retries; send hosted_invoice_url within 5 minutesEmail Stripe hosted_invoice_url immediately so customer completes 3DS challenge on-session.58% – 72%
expired_cardCustomer Action (Card Update)Check Network Token / Card Account Updater (CAU) firstStored expiration month/year has passed and issuer CAU did not auto-roll credentials.1 delayed check at +48h (for late CAU sync), plus immediate portal update emailSend 1-click Stripe Billing Portal payment_method_update session link; halt blind loops.46% – 61%
try_again_laterSoft RetrySafe for backoff retryTemporary issuer switch outage, core-banking maintenance window, or rate throttle.+4h, +24h, +72hSilent automated retry before sending any alarming email to the subscriber.65% – 78%
card_velocity_exceededSoft RetryWait for 24h or calendar-month velocity resetCorporate or virtual card hit daily/weekly spend cap or transaction count ceiling.+26h (next daily window), +72h, or 1st of next monthDelay retry past 24h UTC/local boundary; notify billing contact if virtual card cap is too low.49% – 60%
generic_declineSoft RetryMax 3–4 spaced retries; monitor issuer BIN success rateUnclassified issuer refusal—often cross-border SaaS MCC restriction or risk score.+24h, +72h, +120h + parallel alternate-card promptCombine 2 spaced retries with email offering Apple Pay / Google Pay / Link via Stripe Portal.34% – 45%
lost_cardHard Stop (Never Retry)Visa Category 1 / Mastercard MAC violation if retried ($15+ fine risk)Cardholder reported physical or virtual card lost; PAN is permanently deactivated.0 retries — cancel scheduled dunning charges immediatelyDisable auto-collection retries on invoice and email immediate card-replacement link.25% – 38% (via new card only)
stolen_cardHard Stop (Never Retry)Visa Category 1 / Mastercard MAC violation if retriedPAN flagged stolen by issuing bank; subsequent auth attempts penalize merchant MID.0 retries — halt off-session charging immediatelyStop automated retries and request verified replacement payment method.18% – 30% (via new card only)
fraudulentHard Stop (Never Retry)Strict network prohibition; harms merchant auth rate & dispute ratioIssuing bank or card network classified transaction as suspected unauthorized use.0 retries — never re-attempt same payment_methodDetach or block retries on current card; require authenticated checkout if legitimate user.8% – 16%
invalid_accountHard Stop (Never Retry)Category 1 permanent decline — zero retries permittedUnderlying card account or checking account was closed by customer or bank.0 retries — immediate billing portal replacement workflowSuppress retry cron and trigger plain-text founder note with 1-click card swap URL.28% – 42% (via new card)
processing_errorSoft RetrySafe to retry with new idempotency key after brief cooldownDownstream acquirer or card network formatting/timeout glitch unrelated to customer funds.+2h, +18h, +48hRetry silently with zero customer email unless 3 consecutive attempts fail.70% – 84%

How to build a network-safe Stripe dunning pipeline in 5 steps

  1. 1

    Inspect your Stripe decline_code and network category

    Search or select the exact decline_code from invoice.payment_failed -> payment_intent.last_payment_error.decline_code in the lookup table above to verify whether card networks classify it as a Soft Retry, Customer Action (3DS/Update), or Hard Stop.

    const code = paymentIntent.last_payment_error?.decline_code ?? 'generic_decline';
  2. 2

    Separate Hard Stops before scheduling any retry

    Block automated retries on Category 1 / MAC codes such as lost_card, stolen_card, fraudulent, pickup_card, invalid_account, and revocation_of_all_authorizations so Visa and Mastercard never assess excessive-retry penalties or throttle your MID approval rate.

    if (HARD_STOP_CODES.has(code)) return haltAutoRetriesAndRequestNewCard(invoice);
  3. 3

    Model your involuntary churn leakage and dunning cost

    Enter your current MRR, monthly payment failure percentage, and baseline recovery rate in the SaaS Recovery Calculator to quantify net recoverable ARR and compare 10%–15% revenue-share dunning SaaS tools against a flat self-hosted worker.

    // Example: $45,000 MRR × 6.5% fail × +30% recovery lift = +$877.50/mo ($10,530/yr ARR saved)
  4. 4

    Route 3DS challenges to hosted_invoice_url and soft declines to payday windows

    Send authentication_required failures directly to invoice.hosted_invoice_url so European and corporate subscribers pass 3DS in two clicks, while queuing insufficient_funds and card_velocity_exceeded retries around 24h resets and 1st/15th salary dates.

    const actionUrl = code === 'authentication_required' ? invoice.hosted_invoice_url : portalSession.url;
  5. 5

    Export your idempotent webhook router and test with Stripe CLI

    Download the generated TypeScript webhook handler, verify signatures with constructEventAsync, enforce per-attempt idempotency keys, and replay test failures locally with stripe trigger invoice.payment_failed.

    stripe trigger invoice.payment_failed --add payment_intent:last_payment_error.decline_code=insufficient_funds

Why Blindly Retrying Every Failed Subscription Hurts Authorization Rates

Most early-stage SaaS billing setups treat every failed renewal identically: Stripe fires invoice.payment_failed, Smart Retries or a rigid 1–3–5–7 day cron hammers the same card four times, and a generic 'Your payment failed' banner goes out on attempt one. Under modern Visa and Mastercard network monitoring rules, treating all decline codes the same destroys both conversion and merchant standing. Card networks split declines into temporary soft refusals (such as insufficient_funds, try_again_later, processing_error, and card_velocity_exceeded) versus permanent Visa Category 1 and Mastercard Merchant Advice Code (MAC 03 / MAC 21) hard stops (lost_card, stolen_card, invalid_account, pickup_card, do_not_try_again, revocation_of_all_authorizations).

When your billing system re-attempts a Category 1 hard-declined PAN, two bad things happen simultaneously. First, Visa's Misuse of Authorization System fee and Mastercard's Excessive Retry program flag repeated authorization requests on closed, revoked, or stolen credentials—assessing per-attempt network fines ($0.10 to $15+ depending on program tier) and degrading your merchant descriptor's historical approval score across issuing banks. Second, waiting seven days while futile retries fail on a cancelled or stolen card wastes the 48-hour window when an active SaaS subscriber still remembers why they rely on your product.

Conversely, emailing a customer within sixty seconds of a transient processing_error, switch_inoperative, or try_again_later acquirer hiccup triggers completely avoidable voluntary cancellations: subscribers open the alarming dunning email, realize they are still being billed monthly, and click Cancel Subscription instead of letting a silent 4-hour background retry clear the invoice without friction.

Always check Stripe Network Tokens and Card Account Updater (CAU) interactions before firing expired_card campaigns too aggressively. Major US and European issuers push updated expiration dates and replacement PANs automatically to network tokens, yet batch CAU updates occasionally lag 24 to 48 hours behind the billing date; pairing a single +48h check with an immediate self-serve portal link captures both automated rollovers and manual updates.

// Never email the customer on attempt #1 for transient switch/issuer blips:
const SILENT_FIRST_RETRY = new Set(['processing_error', 'try_again_later', 'issuer_not_available', 'reenter_transaction']);
if (invoice.attempt_count === 1 && SILENT_FIRST_RETRY.has(declineCode)) {
  return scheduleSilentRetryHours(4); // Recover quietly without churn-inducing emails
}
Billing Engineering Note: Rule of thumb: silent retry transient gateway errors first, payday-schedule liquidity declines, and immediately send a 1-click card swap link on hard stops.

Handling authentication_required (3DS) and B2B Virtual Card Velocity Caps

If you sell developer tools, AI seats, or B2B SaaS to European, UK, Indian (RBI e-Mandate), or corporate cardholders, two decline codes dominate involuntary churn: authentication_required and card_velocity_exceeded. Under Strong Customer Authentication (SCA / PSD2), recurring subscriptions normally rely on a Merchant-Initiated Transaction (MIT) exemption linked to the initial Customer-Initiated Transaction (CIT) cryptogram. However, issuing banks periodically reset cumulative off-session counters—especially after plan tier upgrades, seat additions, or six months of renewals—and return authentication_required.

Off-session automated retries can never satisfy an authentication_required challenge because no browser session exists to render the bank's 3D Secure biometric app push or SMS OTP prompt. Sending the user to a generic login-gated account settings screen also fails whenever they re-save the exact same card without completing an on-session PaymentIntent confirmation. Instead, route authentication_required webhooks straight to invoice.hosted_invoice_url: Stripe's hosted invoice page loads the open PaymentIntent and triggers the 3DS modal in one click without requiring a password.

For B2B startups charging $49 to $499/month, Ramp, Brex, Wise, Mercury, Revolut, and Airwallex virtual cards routinely trigger card_velocity_exceeded, policy_declined, or do_not_honor when an engineering manager sets a fixed monthly vendor ceiling (for example, locking a virtual card at $100/month when seat overages push the invoice to $120). Retrying two hours later is guaranteed to fail; delaying 26 hours or sending a concise plain-text email displaying the exact dollar amount lets the card admin raise their Ramp or Brex limit in ten seconds.

// Route 3DS step-up vs. Card Replacement cleanly:
const recoveryUrl = declineCode === 'authentication_required'
  ? invoice.hosted_invoice_url
  : (await stripe.billingPortal.sessions.create({
      customer: invoice.customer as string,
      return_url: 'https://app.yourdomain.com/billing?recovered=1',
      flow_data: { type: 'payment_method_update' }
    })).url;
Billing Engineering Note: Stripe Billing Portal deep-links (flow_data.type = 'payment_method_update') skip login friction when paired with short-lived, single-purpose recovery tokens.

Payday-Window Scheduling Within Visa & Mastercard's 15-Retry / 30-Day Cap

For prosumer and indie SaaS products priced between $9 and $79/month, insufficient_funds accounts for 30% to 45% of all failed renewals. Naive exponential backoff (retrying at +1h, +6h, +24h, +48h) burns every retry slot inside a single 48-hour dry spell right before the customer's paycheck clears. Meanwhile, Visa and Mastercard enforce strict retry ceilings: keep per-invoice soft retries to 4 attempts max, and never approach the 15-attempt rolling 30-day card-network threshold where excessive-retry penalties kick in (for US ACH insufficient_funds_ach / R01, NACHA is even stricter at 2 re-initiations max within 180 days).

Aligning your four card retry slots to real payroll liquidity boundaries lifts recovery substantially without burning network attempts: slot 1 at +24 hours (catches overnight checking transfers and daily debit resets), slot 2 aligned to Friday 09:30 local time or the 1st/15th semi-monthly salary deposit date, slot 3 five days later, and slot 4 as a final grace-period check paired with a plain-text note before downgrading the workspace.

Sender presentation matters just as much as retry timing. Heavy multi-column HTML marketing templates with tracking pixels get routed to Gmail's Promotions tab and read like automated collection notices, whereas a four-sentence plain-text email from a monitored founder or billing address citing the card brand, last4 digits, exact invoice total, and direct Stripe Portal link routinely doubles click-to-recovery conversion.

// Compute next payroll liquidity timestamp (1st, 15th, or Friday 09:30 UTC):
function nextLiquiditySlot(now: Date): Date {
  const d = new Date(now.getTime() + 24 * 3600_000);
  const dom = d.getUTCDate();
  if (dom >= 12 && dom <= 15) d.setUTCDate(15);
  else if (dom >= 28 || dom === 1) { d.setUTCMonth(dom === 1 ? d.getUTCMonth() : d.getUTCMonth() + 1, 1); }
  d.setUTCHours(14, 0, 0, 0); // Morning US / Afternoon EU overlap
  return d;
}
Billing Engineering Note: Always include card brand + last4 (e.g., 'Visa ending in 4242') in plain-text dunning emails so subscribers immediately recognize which card failed without fearing phishing.

Economics of Zero-Commission Dunning vs. Revenue-Share SaaS Vendors

Managed dunning platforms typically price in one of two ways: either a $200–$500 monthly base fee plus 3%–5% of recovered revenue, or a 'performance tax' claiming 10% to 25% of every subscription invoice that clears after an initial failure—including transient try_again_later and insufficient_funds charges that would have succeeded on a scheduled retry anyway. At $50,000 MRR with a 6.5% failure rate ($3,250/mo failed) and 58% recovery ($1,885/mo recovered), a 15% take-rate silently siphons $282/month ($3,393/year) forever.

Architecturally, production-grade dunning requires only four deterministic primitives: an idempotent Stripe webhook endpoint verifying stripe-signature via Web Crypto HMAC-SHA256, a durable state table (such as Cloudflare D1 or PostgreSQL) keyed by invoice_id and attempt_count to record decline_code classification and next_retry_at timestamps, a 15-minute cron worker calling stripe.invoices.pay(invoiceId, { off_session: true }) with per-attempt idempotency keys, and Resend or Postmark delivering plain-text recovery URLs.

Hosting that state machine inside your own Cloudflare Worker + D1 account costs $0/month on Cloudflare's standard Workers tier and Resend's 3,000-email monthly allowance, keeps customer billing emails and restricted Stripe API keys inside your own security boundary, and ensures 100% of recovered ARR stays on your balance sheet.

Before switching live webhook traffic over, always validate two edge cases in Stripe Test Mode using stripe trigger invoice.payment_failed: duplicate webhook deliveries caused by network timeouts (verified by asserting UNIQUE(invoice_id, attempt_count) in D1 before dispatching Resend emails), and out-of-order invoice.paid events arriving while a retry email sits queued—ensuring your cron worker checks invoice.status === 'open' right before calling stripe.invoices.pay or sending a stale dunning reminder.

// Minimal Restricted Stripe Key permissions required for self-hosted dunning:
// - Invoices: Write (to trigger off-session retry on soft declines)
// - Customer Portal: Write (to mint payment_method_update session URLs)
// - Customers & Charges: Read (to read brand, last4, and outcome.decline_code)
// - Webhook Secret: whsec_... stored in Cloudflare Worker secret store
Billing Engineering Note: Principle of least privilege: never pass rk_live full-admin keys to a third-party dunning vendor when a 4-scope Restricted Key on your own Worker suffices.

Frequently asked questions

Where do I find the exact decline_code in Stripe webhooks?

Listen to the invoice.payment_failed or payment_intent.payment_failed webhook event. Read paymentIntent.last_payment_error.decline_code (or charge.outcome.reason / network_decline_code). When Stripe only receives a generic refusal from the bank, code equals 'card_declined' and decline_code defaults to 'generic_decline' or 'do_not_honor'.

Which Stripe decline codes should NEVER be automatically retried?

Never auto-retry Category 1 / hard-stop codes: lost_card, stolen_card, fraudulent, pickup_card, restricted_card, invalid_account, revocation_of_all_authorizations, stop_payment_order, merchant_blacklist, or do_not_try_again. Retrying these violates Visa and Mastercard network rules, risks $15+ excessive-retry fees, and lowers your overall authorization rate.

Why do Stripe Smart Retries still miss recoverable SaaS revenue?

Stripe Smart Retries handle background charge timing well, but they do not send plain-text founder emails from your domain, differentiate 3DS hosted_invoice_url flows from card-replacement flows, alert B2B admins about virtual card velocity limits, or coordinate pause/grace states inside your app database.

How do I recover authentication_required declines without forcing users to log in?

Do not retry off-session and do not send users to a login-gated settings screen. Email invoice.hosted_invoice_url directly from your invoice.payment_failed handler—Stripe's hosted invoice page renders the bank's 3D Secure prompt immediately in one click.

How many times can I legally retry a soft-declined Visa or Mastercard?

Keep automated retries to a maximum of 4 well-spaced attempts within a 30-day billing cycle (and strictly below Visa/Mastercard's 15-attempt rolling 30-day hard ceiling). Spacing retries across +24h, +72h, and payday dates recovers more revenue with fewer attempts than rapid daily polling.

Does this Stripe decline calculator require connecting my Stripe account?

No. Every decline-code classification, MRR churn recovery simulation, and TypeScript webhook generator runs 100% client-side in your browser with zero API keys, zero OAuth, and zero telemetry.

What is included in the $49 One-Time Cloudflare Worker + Resend Dunning Kit?

You get the complete self-hosted TypeScript repository: 84-code Stripe decline classifier, Cloudflare D1 retry queue migration + cron worker, HMAC pre-signed Stripe Billing Portal deep-linker, 4 plain-text Resend email templates, Slack recovery notifications, and lifetime source updates with zero % commission.