Payment Retry Logic
Configuring automatic reattempts of failed subscription payments with strategic timing, escalating notifications, and eventual fallback actions when all retries are exhausted.
Description
Payment retry logic determines how and when your system reattempts collecting a failed payment, most commonly for subscription renewals. Payments fail for various reasons: insufficient funds, expired cards, temporary bank declines, and network errors. An effective retry strategy distinguishes between hard declines (stolen card, invalid number) that should not be retried and soft declines (insufficient funds, temporary hold) that may succeed on a subsequent attempt. Stripe's Smart Retries use machine learning to determine the optimal retry timing based on aggregated success patterns across their network.
Stripe provides configurable retry schedules in the Billing settings, allowing you to set up to 4 retry attempts over a customizable window (typically 1, 3, 5, and 7 days after the initial failure). During this retry window, the subscription enters a past_due status, and your application should reflect this state by showing a banner prompting the customer to update their payment method while maintaining limited service access. The specific retry schedule should be configured through the Stripe Dashboard or via the API using stripe.subscriptions.update() with the payment_settings.payment_method_options.card.request_three_d_secure parameter.
Beyond Stripe's automatic retries, consider implementing an intelligent retry approach at the application level. Analyze the decline code (e.g., card_declined, insufficient_funds, expired_card) from the last payment attempt to determine whether to retry, prompt for a card update, or escalate. Send escalating notifications: a gentle reminder after the first failure, a more urgent notice after the second retry, and a final warning before cancellation. Track retry metrics to optimize your schedule based on actual recovery rates.
Prompt Snippet
Configure Stripe's Smart Retries in the Billing settings with a retry schedule of 3, 5, and 7 days after initial failure, and set the subscription status to past_due during retries rather than immediately canceling. Inspect the invoice.payment_failed webhook payload's last_payment_error.decline_code to distinguish between retriable declines (insufficient_funds, processing_error) and terminal declines (stolen_card, card_not_supported), canceling retries immediately for terminal codes. Implement escalating customer notifications triggered by each retry attempt via the invoice.payment_failed event, and update your application's UI to show a payment_action_required banner with a link to update the payment method when subscription.status === 'past_due'.
Tags
Related Terms
Failed Payment Recovery (Dunning)
The systematic process of recovering failed subscription payments through automated retries, customer communications, and graceful degradation before eventually canceling the subscription.
Subscription Billing (Stripe)
Managing recurring payment cycles using Stripe's Subscription and Price APIs, including plan creation, billing intervals, upgrades/downgrades, and lifecycle event handling.
Payment Intent Flow
The server-driven flow using Stripe's PaymentIntent API to create, confirm, and track a payment through its complete lifecycle from creation to settlement.
Payment Webhook Event Handling
Processing asynchronous payment lifecycle events delivered via webhooks, including idempotent handling, event routing, retry logic, and maintaining consistency between Stripe and your application state.