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

# Billing Lifecycle

> Understanding the recurring billing loop

The billing lifecycle in Credibill is designed to be automated and resilient.

## The Cycle

1. **Subscription Starts**: A customer subscribes. An immediate invoice is generated for the first period (unless there is a trial).
2. **Cycle Progresses**:
   * Time passes.
   * Usage is reported (if applicable).
3. **Cycle Ends**:
   * The billing period closes.
   * Usage is aggregated.
   * A new Invoice is generated for the **next** period (plus usage from the **past** period).
4. **Payment**:
   * Credibill attempts to charge the default payment method.
   * **Success**: Subscription remains `active`.
   * **Failure**: Subscription enters `past_due`. Smart Retries begin.
5. **Renewal**: The cycle repeats.

## Smart Retries

If a payment fails, Credibill doesn't just give up. We use machine learning to determine the optimal time to retry the card (e.g., Friday morning after payday) to maximize recovery rates. You can configure the retry schedule in the Dashboard.

## Dunning

Dunning is the process of communicating with customers about failed payments. Credibill can send automated emails:

* "Your payment failed"
* "Card expiring soon"
* "Subscription canceled due to non-payment"
