# Automate payment retries

Automatically retry failed subscription and invoice payments to reduce involuntary churn.

Payments can fail for a number of reasons, but many of them are recoverable. Stripe Billing can automatically retry failed subscription and invoice payments for you.

To configure subscription retries in your Dashboard, go to **Billing** > **Revenue recovery** > [Retries](https://dashboard.stripe.com/revenue_recovery/retries). For one-time invoice retries, go to **Advanced invoicing features** under **Settings** > **Billing** > [Invoices](https://dashboard.stripe.com/settings/billing/invoice).

Stripe recommends using Smart Retries, but you can also create a [custom retry schedule](https://docs.stripe.com/billing/revenue-recovery/smart-retries.md#custom-retry-schedule).

> Stripe doesn’t retry payments if:
> 
> - No payment methods are available.
> - The issuer returned a [hard decline code](https://docs.stripe.com/billing/revenue-recovery/smart-retries.md#non-retryable-decline-codes).
> - The payment card is [India-issued](https://docs.stripe.com/india-recurring-payments.md).
> - The Stripe *Connect* (Connect is Stripe's solution for multi-party businesses, such as marketplace or software platforms, to route payments between sellers, customers, and other recipients) account has been disconnected.

## Payment method ordering 

When retrying, Stripe uses the first available payment method in this list, in this order:

| Priority | Payment method | API attribute |
| --- | --- | --- |
| 1 | Subscription default payment method | [subscription.default_payment_method](https://docs.stripe.com/api/subscriptions/object.md#subscription_object-default_payment_method) |
| 2 | Subscription default payment source | [subscription.default_source](https://docs.stripe.com/api/subscriptions/object.md#subscription_object-default_source) |
| 3 | Customer default payment method | - [customer.invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object.md#customer_object-invoice_settings-default_payment_method) (for `Customer` objects)
- [configuration.customer.billing.default_payment_method](https://docs.stripe.com/api/v2/core/accounts/object.md#v2_account_object-configuration-customer-billing-default_payment_method) (for customer-configured `Account` objects) |
| 4 | (Legacy) Origem do pagamento padrão do cliente | [customer.default_source](https://docs.stripe.com/api/customers/object.md#customer_object-default_source) |

When you update payment methods after a failed payment attempt, update the field where the previous payment failed. For example, if a subscription has a `default_payment_method`, but you only update `customer.invoice_settings.default_payment_method`, Stripe continues to retry on the subscription’s `default_payment_method`.

## Smart Retries

O Smart Retries usa IA para escolher os melhores momentos para novas tentativas de pagamentos que apresentaram falha. Esse recurso aumenta a probabilidade de êxito no pagamento da fatura. O modelo de IA por trás do Smart Retries usa sinais dinâmicos e dependentes do tempo, como:

- O número de dispositivos diferentes que apresentaram uma forma de pagamento específica nas últimas *N* horas.
- O melhor momento para pagar. Em alguns países, os pagamentos com cartões de débito podem ter mais êxito quando realizados um minuto após a meia-noite no fuso horário local.

A Stripe usa essas informações para avaliar quando repetir os pagamentos. Aprendemos continuamente com os novos comportamentos e transações do comprador, que fornecem uma abordagem mais direcionada em relação à lógica tradicional de repetição estabelecido por regras de pagamento. 



O Smart Retries tenta novamente a cobrança de acordo com suas especificações para o número de novas tentativas e a duração máxima. Você pode definir a política de repetição inteligente para tentar o pagamento um número específico de vezes em um período de tempo: 1 semana, 2 semanas, 3 semanas, 1 mês ou 2 meses. A configuração padrão recomendada é de 8 tentativas em 2 semanas. Você também pode usar as [automações](https://docs.stripe.com/billing/automations.md) para criar diferentes políticas de repetição para diferentes segmentos de cliente.

É possível substituir esse comportamento [desativando Smart Retries](https://dashboard.stripe.com/revenue_recovery/retries) e definir suas próprias regras personalizadas de novas tentativas. Quando você habilita a cobrança, o atributo [next_payment_attempt](https://docs.stripe.com/api/invoices/object.md#invoice_object-next_payment_attempt) indica quando ocorrerá a próxima tentativa de cobrança. 

## Webhook events 

For both Smart Retries and custom retry schedules, Stripe reattempts the charge according to your specified schedule. Use the `invoice.payment_failed` *webhook* (A webhook is a real-time push notification sent to your application as a JSON payload through HTTPS requests) to receive subscription payment failure events and retry attempt updates.

The [attempt_count](https://docs.stripe.com/api/invoices/object.md#invoice_object-attempt_count) attribute on the `invoice.payment_failed` webhook indicates how many attempts have been made so far. If a failure returns a *hard decline code* (A hard decline code means the issuing bank has rejected the transaction and you can't retry it), we can’t retry invoice payment without a new payment method. Retries continue to be scheduled, and [attempt_count](https://docs.stripe.com/api/invoices/object.md#invoice_object-attempt_count) continues to increment, but retries only execute after detecting a new payment method. Unexecuted retries don’t create a new [Charge](https://docs.stripe.com/api/charges.md).

The [next_payment_attempt](https://docs.stripe.com/api/invoices/object.md#invoice_object-next_payment_attempt) attribute on the invoice indicates the date when Stripe will attempt the next collection. For [automations](https://docs.stripe.com/billing/automations.md) users, [next_payment_attempt](https://docs.stripe.com/api/invoices/object.md#invoice_object-next_payment_attempt) is no longer set in `invoice.payment_failed` webhooks but is set in `invoice.updated` webhooks.

### Hard decline codes 

Stripe can’t automatically retry a payment if the card issuer returns any of these hard decline codes:

- `incorrect_number`
- `lost_card`
- `pickup_card`
- `stolen_card`
- `revocation_of_authorization`
- `revocation_of_all_authorizations`
- `authentication_required`
- `highest_risk_level`
- `transaction_not_allowed`

For these failures, the scheduled retries continue but the payment only executes if you obtain a new payment method.

## Custom retry schedule 

You can also modify the retry schedule with [custom rules](https://dashboard.stripe.com/revenue_recovery/retries). You can configure up to three retries, each with a specific number of days after the previous attempt.

You can use the [invoice.payment_failed](https://docs.stripe.com/billing/revenue-recovery/smart-retries.md#invoice-payment-failed-webhook) event to monitor subscription payment failure events and retry attempt updates. After a payment attempt on an invoice, its [next_payment_attempt](https://docs.stripe.com/api.md#invoice_object-next_payment_attempt) value is set using the current subscription settings in your Dashboard.

> When using automations, the [next_payment_attempt](https://docs.stripe.com/api/invoices/object.md#invoice_object-next_payment_attempt) attribute is no longer set in `invoice.payment_failed` webhooks but is set in `invoice.updated` webhooks.

Quando a recuperação falha, o status da assinatura muda de acordo com as configurações. As opções são:

| Configuração | Descrição |
| --- | --- |
| Cancelar a assinatura | The subscription changes to `canceled` after the maximum number of days defined in the retry schedule. |
| Marcar a assinatura como não paga | The subscription changes to `unpaid` after the maximum number of days defined in the retry schedule. Invoices continue to be generated and stay in a draft state. |
| Deixar a assinatura vencida | The subscription remains `past_due` after the maximum number of days defined in the retry schedule. Invoices continue to be generated and charge the customer based on retry settings. |
| Pause the subscription | If the subscription is eligible, it changes to `paused`. Stripe doesn’t generate new subscription invoices until the subscription resumes. |

You can pause eligible subscriptions after the first renewal payment failure or after retries are exhausted. To learn about eligibility, retry behavior, billing effects, and resumption, see [Pause subscriptions after payment failure](https://docs.stripe.com/billing/revenue-recovery/smart-retries/pause-on-payment-failure.md).

After the final payment attempt, Stripe makes no further payment attempts. Changing your subscription settings only affects future retries.

## Retry local payment methods 

Stripe can automatically retry failed payments made with local payment methods. Use the **Local payment methods** section for [recurring subscription invoices](https://dashboard.stripe.com/revenue_recovery/retries), [one-off invoices](https://dashboard.stripe.com/settings/billing/invoices/general), or both, to turn on retries.

> If you enable local payment method retries, a payment can still fail. Stripe isn’t responsible for any losses if we don’t retry a payment made with a local payment method.

By default, Stripe doesn’t automatically retry failed payments made with local payment methods. To enable automatic retries for local payment methods, use the corresponding settings in the following table:

| Local payment method | Retryable failures | Maximum retries | Maximum retry period | Mandate requirements | [Release phase](https://docs.stripe.com/release-phases.md) |
| --- | --- | --- | --- | --- | --- |
| Débito automático ACH | Insufficient funds | 2 | 40 days | [ACH Direct Debit mandates](https://docs.stripe.com/payments/ach-direct-debit.md#mandates) | [General availability](https://docs.stripe.com/payments/ach-direct-debit.md#ach-debit-retries) |
| Débito automático ACSS | Insufficient funds | 1 | 30 dias | [ACSS Direct Debit mandates](https://docs.stripe.com/payments/acss-debit.md#mandates) | [General availability](https://docs.stripe.com/payments/acss-debit.md#acss-retries) |
| Débito automático BECS Austrália | Insufficient funds | 4 | 30 dias | [AU BECS Direct Debit mandates](https://docs.stripe.com/payments/au-becs-debit.md#mandates) | [General availability](https://docs.stripe.com/payments/au-becs-debit.md#au-becs-retries) |
| Débito automático Bacs | Insufficient funds | 2 | 30 dias | [Bacs Direct Debit mandates](https://docs.stripe.com/payments/bacs-debit.md#mandates) | [General availability](https://docs.stripe.com/payments/bacs-debit.md#bacs-retries) |
| Débito automático BECS da Nova Zelândia | Insufficient funds | 1 | 30 dias | [NZ BECS Direct Debit mandates](https://docs.stripe.com/payments/nz-bank-account.md#mandates) | [General availability](https://docs.stripe.com/payments/nz-bank-account.md#nz-becs-retries) |
| Débito automático SEPA | Insufficient funds | 2 | 30 dias | [SEPA Direct Debit mandates](https://docs.stripe.com/payments/sepa-debit.md) | [General availability](https://docs.stripe.com/payments/sepa-debit.md#sepa-debit-retries) |
