> ## 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.

# Invoices and Stripe

> Ledger puts plans, seats, overage, storage and packs on the customer's Stripe invoice at the right moment, while Stripe collects the money.

Ledger turns every plan, seat and use into lines on the customer's own Stripe invoice, billed at the right moment and checked before anything is granted. Ledger decides what a customer may use and what their usage costs; Stripe takes the money and sends the invoice.

| Ledger owns | Stripe owns |
| - | - |
| The catalog: features, plans, items, prices | Products and prices, which Ledger creates and keeps in step |
| Balances, grants and spend order | Cards, payment methods and Checkout |
| `check`, `track` and the usage log | Subscriptions, renewal dates and collection |
| Overage totals and caps | Invoices, receipts, tax and refunds |
| Which payments grant what | Payment retries and dunning |

Ledger grants only what a signed Stripe webhook confirms, never a browser redirect. [Stripe](https://docs.integrateledger.com/stripe.md) lists every object Ledger creates and every event it listens for.

## Lines on an invoice

| Line | Example | Comes from |
| - | - | - |
| The plan | "Pro", \$20.00 | The subscription's plan price, monthly or yearly |
| Seats | "Team – Seats", 7 × \$10.00 | The plan's [per-seat](https://docs.integrateledger.com/pricing/per-seat.md) item at the count held; one line per tier band |
| Seat licenses | "Team – Seat seat", 3 × \$40.00 | A plan's [seat licenses](https://docs.integrateledger.com/pricing/seat-licenses.md): the paid seats past the included ones |
| Seat prorations | Stripe's own proration lines | A count change within the period, by the item's `proration` setting |
| Credit overage | "Scale – overage, 1,500 credits" | Credits spent past the balance, one line per plan version and rate, one per band when [tiered](https://docs.integrateledger.com/pricing/tiers.md#overage-tiers) |
| Metered overage | "Pro – Messages overage, 120" | Units past a metered item's allowance, one line per feature and rate, under the item's own Stripe product |
| A month's overage on an annual plan | "Pro (annual) – overage, 1,500 credits" | Its own invoice on the annual subscription, created by Ledger when the month ends |
| A credit pack | "Top-up – 500 credits" | Its own one-time invoice |
| A lifetime plan | "Lifetime", \$499.00 | One paid invoice, with no subscription |

Every line is in the customer's [currency](https://docs.integrateledger.com/pricing/currencies.md), set by their first paid plan.

A [pay-as-you-go](https://docs.integrateledger.com/pricing/pay-as-you-go.md) plan's invoice has a \$0 plan line and its overage lines. Free plans run entirely in Ledger, with no Stripe invoice.

## When each line is billed

* **The plan and seats** bill in advance: on the first payment, then on each renewal invoice Stripe creates.
* **Overage** bills in arrears. When Stripe creates the renewal invoice, while it's still a draft, Ledger adds the overage for the period that just ended. The same moment grants the new period's allowance, about an hour before Stripe charges the card.
* **Overage on an [annual plan](https://docs.integrateledger.com/pricing/annual.md)** bills monthly. When each month ends, Ledger creates an invoice on the annual subscription with that month's overage and [storage](https://docs.integrateledger.com/pricing/storage.md) and Stripe charges the saved card. The year's last month goes on the renewal invoice.
* **Seat changes** reach Stripe from Ledger's own queue, so `track` never waits on Stripe. With the defaults a change is prorated on the next invoice; `charge_now` invoices an increase at once.
* **An upgrade** charges the new plan in full now and starts a new period. The old plan's overage bills at its own rate, and its storage at its own price on the next renewal.
* **When a subscription ends**, Ledger bills any remaining overage, credit and metered, and storage on a final invoice.

Overage is cost per rate: `ceil(units ÷ overageBillingUnits) × overageUnitAmountCents`, up to the customer's one monthly cap. [Overage](https://docs.integrateledger.com/pricing/overage.md) has the rules. On an annual plan the cap is per month.

## What Ledger checks on an invoice

Before it grants a renewal, Ledger checks the plan's line at your full price, and seat lines at the seat price for their count. A coupon, whether one of your catalog's [promotion codes](https://docs.integrateledger.com/billing/discounts.md) or one you add in Stripe, lowers what the customer pays, never what they get. [Renewals and lifecycle](https://docs.integrateledger.com/billing/renewals-and-lifecycle.md) covers failed payments, refunds and disputes.

## Rules

* Ledger grants a renewal from an invoice paid in full by card or bank: an invoice paid partly from a Stripe customer balance grants nothing.

## Next steps

> [card] [Checkout and attach](https://docs.integrateledger.com/billing/checkout-and-attach.md)
>
> The first payment and when grants land.

> [card] [Tax](https://docs.integrateledger.com/billing/tax.md)
>
> Have Stripe calculate and collect tax.


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