> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpaycheckout.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retry Mechanism

> Comprehensive system for handling failed subscription payments with automatic and manual retry capabilities.

xPay's Subscription Retry Mechanism is a robust system designed to handle failed subscription payments intelligently. It ensures that temporary payment issues don't immediately terminate subscriptions while providing clear escalation paths when payments consistently fail.

## Retry Configuration

The retry mechanism operates with predefined rules to ensure optimal payment recovery:

* **Automatic Retry Schedule:** 4, 8, 12, and 24 hours after failure.

* **Retry Limits:** 4 automatic attempts max, 4-hour cooldown for manual retries.

## Manual Retry Capability

Merchants have full control over subscription retry attempts through the xPay dashboard:

<Note>
  Manual retries are subject to a 4-hour cooldown period to prevent excessive payment attempts and respect payment processor limits.
</Note>

## Notification System

The system sends various notifications during the retry process:

<Card>
  <div><Icon icon="user" />   <span className="font-bold text-[16px]">Customer Notifications </span></div>

  <ul>
    <li><strong>First Payment Failure</strong> - Immediate notification to customer</li>
    <li><strong>Final Failure</strong> - Customer notification with payment update link</li>
  </ul>

  <div><Icon icon="store" />   <span className="font-bold text-[16px]">Merchant Notifications </span></div>

  <ul>
    <li><strong>Failed Subscription Transactions</strong> - Notifications for failed subscription transactions</li>
  </ul>
</Card>

## State Management

The subscription retry mechanism manages subscription states throughout the retry process:

<ul>
  <li><strong>ACTIVE/TRIALING</strong> - Normal subscription states that can be charged</li>
  <li><strong>UNPAID</strong> - Final state after all retries are exhausted</li>
  <li><strong>Next Payment Date</strong> - Dynamically updated for retry scheduling</li>
</ul>

## Webhook Events

The retry mechanism triggers specific webhook events to keep your system updated:

<ul>
  <li><strong>subscription.cycle\_charged</strong> - Successful retry payment</li>
  <li><strong>subscription.unpaid</strong> - All retries exhausted</li>
  <li><strong>subscription.ended</strong> - Subscription terminated after retry failure</li>
</ul>

<Columns cols={2}>
  <Card title={<div><Icon icon="bell" /> &nbsp; View Webhook Events </div>} href="/developer-resources/webhooks/events/subsEvents" />

  <Card title={<div><Icon icon="gear" /> &nbsp; Webhook Setup </div>} href="/developer-resources/webhooks/introduction" />
</Columns>

***
