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

# Renewals and lifecycle

> Ledger keeps every plan's grants in step with Stripe for its whole life, through renewals, failed payments, refunds, disputes and coupons.

Ledger keeps every plan in step with Stripe for its whole life. Each renewal grants the new period before the card is charged, a failed payment leaves the customer working on what they have, and refunds and disputes adjust balances on their own. Stripe's signed webhooks are Ledger's proof of payment, so customers get exactly what they paid for. This page covers a plan after it starts: [Checkout and attach](https://docs.integrateledger.com/billing/checkout-and-attach.md) covers how it starts, and [Upgrades and downgrades](https://docs.integrateledger.com/billing/upgrades-and-downgrades.md) how it changes.

## Subscription statuses

[List customer subscriptions](https://docs.integrateledger.com/api-reference/customers/subscriptions.md) returns each plan the customer has had, newest first, with its `status`:

| Status | Meaning |
| - | - |
| `pending_checkout` | Checkout is open; the grants arrive with the payment. |
| `incomplete` | The first invoice is still being paid. |
| `active` | The plan is running and its grants are available. |
| `past_due`, `unpaid`, `paused` | Stripe is collecting a payment. The plan and its grants stay. Overage, new months on an annual plan, and upgrades and downgrades resume once the invoice is paid, along with the next renewal's grants. A `past_due` plan can be cancelled at the period end. With [ignore past due](#ignore-past-due), a `past_due` plan keeps its overage and renewal grants. |
| `trialing` | In a [free trial](https://docs.integrateledger.com/pricing/trials.md), with a card in Stripe or without one in Ledger only, until `trialEndsAt`. It gets the trial's grants and no overage. A Stripe trial [imported](https://docs.integrateledger.com/integrate/migrate-from-stripe.md) is `trialing` too. |
| `canceled` | The subscription ended, a paid plan replaced this free plan, or a recurring plan replaced this lifetime plan. |
| `incomplete_expired` | Checkout expired or failed before payment. |

[Get a customer](https://docs.integrateledger.com/api-reference/customers/get.md) shows the plan the customer is on now as `currentPlan`, with the same status names. `canceled` and `incomplete_expired` describe plans that have ended, so they appear in the subscriptions list.

## Renewals

Stripe renews paid plans at the end of each billing period, monthly or yearly. Ledger grants the new period's credits and metered allowances when Stripe creates the renewal invoice (`invoice.created`), about an hour before it charges the card, so the customer keeps working while the payment goes through.

* **Allowances refresh** each period: unspent ones expire at its end and the new period's are granted. Credit packs carry over.
* **Overage** from the period that just ended is added to the renewal invoice, one line per rate and per metered feature. See [Invoices and Stripe](https://docs.integrateledger.com/concepts/invoices-and-stripe.md).
* **Seats** bill for the count held, in advance, at the plan's [seat price](https://docs.integrateledger.com/pricing/per-seat.md).
* **Held counts and boolean features** apply for as long as the plan does.
* **If Stripe voids the renewal invoice**, or marks it uncollectible, the grants it made end. An uncollectible renewal that's paid later gets its grants back for the rest of the period.
* **Free plans** renew in Ledger, at the same time of day each month from when they started.
* **Plan versions.** A subscriber renews on the version they're on. See [Plan versions](https://docs.integrateledger.com/billing/plan-versions.md).

### Annual plans with monthly resets

An [annual plan](https://docs.integrateledger.com/pricing/annual.md) bills once a year. With `resetInterval: "month"` (the default), the year's invoice grants the first month. Each later month is granted in full by the customer's first `check` or `track` in it, and unused grants end with their month. A customer who is quiet for a month loses nothing, since that month's grants would have ended with it. Months are counted the way Stripe counts them (a year starting on Jan 31 resets on Feb 28, then Mar 31), and the twelfth ends exactly on the renewal. While the renewal is past due, the customer works on the month they have; paying it grants the month they are in.

With `resetInterval: "year"`, the whole allowance is granted once, for the year. A [lifetime plan](https://docs.integrateledger.com/pricing/lifetime.md) never renews, and its grants never expire.

## Past due

When a renewal payment fails, Stripe marks the subscription `past_due` (or `unpaid`) and retries by your Stripe settings. The customer keeps working throughout, and Ledger holds new spending to what's been paid for:

* Grants already made stay. The customer keeps working on what's left.
* Usage stays within what's been paid for: a credit use past the balance answers `insufficient_credits`, and a metered use past its allowance `limit_reached`, until the payment lands and overage resumes. To keep overage running instead, [ignore past due](#ignore-past-due).
* Upgrades, immediate downgrades and new annual months go ahead once the payment lands.
* The customer can [cancel at the period end](https://docs.integrateledger.com/billing/upgrades-and-downgrades.md#cancel-at-period-end). The unpaid invoice stays open, and at the period end the plan ends without granting again.

When Stripe's retries finish, your Stripe settings choose the outcome. If Stripe cancels the subscription, the plan ends and the unpaid renewal's grants end with it. If Stripe marks the invoice uncollectible, the renewal's grants end, and come back if it's paid later. Your invoices stay under your Stripe settings: Ledger leaves voiding them to you.

## Ignore past due

Keep your best customers working at full speed while Stripe retries a failed renewal. Set `ignorePastDue: true` on a plan for everyone on it, or on one customer, and while the subscription is `past_due`:

* **Overage keeps running**, for credits and metered items, under the customer's one [overage cap](https://docs.integrateledger.com/pricing/overage.md#which-cap-applies), as if the plan were `active`. The next invoice bills it.
* **Renewal grants arrive on time**, when Stripe creates the renewal invoice, as for an active plan.

```ts ledger.config.ts theme={"system"}
plan({
	id: "scale",
	name: "Scale",
	monthlyCredits: 5000,
	priceCents: 5000,
	overageUnitAmountCents: 1,
	overageCapCents: 2000,
	ignorePastDue: true,
	items: [],
}),
```

```json ledger.catalog.json theme={"system"}
{ "id": "scale", "name": "Scale", "monthlyCredits": 5000, "priceCents": 5000,
  "overageUnitAmountCents": 1, "overageCapCents": 2000, "ignorePastDue": true, "items": [] }
```

For one customer, set their own setting:

```typescript TypeScript theme={"system"}
await billing.setCustomerIgnorePastDue({
	customerId: "acme",
	body: { ignorePastDue: true },
});
```

```python Python theme={"system"}
billing.set_customer_ignore_past_due(customer_id="acme", ignore_past_due=True)
```

```bash cURL theme={"system"}
curl "https://api.integrateledger.com/v1/customers/ignore-past-due?customerId=acme" \
  -H "Authorization: Bearer $LEDGER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ignorePastDue": true}'
```

```json Response theme={"system"}
{ "customerId": "acme", "ignorePastDue": true, "effective": true, "source": "customer" }
```

`effective` is what applies now, and `source` says where it comes from: `customer`, `plan` or `default`. Read it with [`GET /v1/customers/ignore-past-due`](https://docs.integrateledger.com/api-reference/customers/get-ignore-past-due).

* **The customer's setting wins.** `false` stops it on a plan that ignores past due, and `null` follows the plan again.
* **It applies in place.** A plan's `ignorePastDue` covers every version, current subscribers included, with no new version.
* **It covers `past_due`.** `unpaid` and `paused` work as above, and upgrades and downgrades go ahead once the payment lands.
* **Overage is billed to the end.** If Stripe's retries cancel the subscription, the final invoice bills the overage recorded.

## Refunds and disputes

Refund and dispute payments in Stripe, and Ledger updates the customer from Stripe's signed events. It takes back grants for a credit pack refunded in full or lost to a dispute, and for a lifetime plan refunded in full; every other refund or dispute is recorded and leaves the grants in place.

| What happens in Stripe | What Ledger does |
| - | - |
| A credit pack is refunded in full | The pack's unused credits expire. Credits already spent stay spent, so the balance never goes negative. |
| A credit pack is refunded in part | Recorded on the customer; the credits stay. Once later refunds make it a full refund, the unused credits expire. |
| A lifetime plan's payment is refunded in full | The plan ends, with its remaining credits, as for a credit pack. |
| A subscription invoice is refunded, with or without tax | Recorded on the customer. The plan's grants stay; remove credits with a [balance adjustment](https://docs.integrateledger.com/customers/balance-adjustments.md), or cancel the subscription, if you need to. |
| A payment is disputed | Recorded and the customer is marked. `GET /v1/customers` returns `dispute`, the most serious one: `open` while Stripe is waiting on it, then `won` or `lost`. Grants stay while it's open, and when it's won. |
| A dispute over a credit pack is lost | The money went back to the cardholder, as for a full refund: the pack's unused credits expire. A lost dispute over a subscription invoice or a lifetime plan keeps the plan's grants. |

```json theme={"system"}
"dispute": {
  "status": "open",
  "amountCents": 2900,
  "createdAt": "2026-11-20T10:02:11.000Z",
  "closedAt": null
}
```

The dashboard's customer page lists the customer's refunds and disputes, with what each did to their balance. Canceling a subscription in Stripe ends the plan as [cancelling now](https://docs.integrateledger.com/billing/upgrades-and-downgrades.md#cancel-now) does.

## Coupons

A coupon or promotion code you add in Stripe, on the subscription or on the invoice before it's finalized, lowers what the customer pays, never what they get. A discounted invoice, even one discounted to \$0, grants the plan's full credits and allowances. Ledger still checks the plan's line at your full price before the discount, and [tax](https://docs.integrateledger.com/billing/tax.md) is calculated on the discounted amount.

Customers can enter a promotion code themselves when you attach with `allowPromotionCodes: true`. A discount stays on the subscription through [upgrades and downgrades](https://docs.integrateledger.com/billing/upgrades-and-downgrades.md#discounts), and a prorated downgrade refund is on what the customer paid. Credit overage bills under the plan's `<Plan> – overage` product, so a coupon limited to the plan's own product discounts the plan and bills usage at full price. See [Discounts and promotion codes](https://docs.integrateledger.com/billing/discounts.md).

> [!TIP]
>
> To see renewals, past-due payments and cancellations in minutes, [simulate time](https://docs.integrateledger.com/test/simulate-time.md) on a Sandbox customer.

## Rules

* Treat a status your code doesn't know as not paid up, so new statuses stay safe.
* Discount with coupons, not Stripe customer balances or billing credits: an invoice paid from a balance grants nothing and Ledger alerts you, and attach answers `409 stripe_customer_balance` for a customer with one.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.