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

# Tax

> Charge sales tax, VAT and GST with Stripe Tax on everything Ledger sells.

Turn on **Automatic tax** in **Settings › Tax** and Ledger asks Stripe Tax to calculate tax on every Checkout, subscription and invoice it creates. Stripe works out the rate from where the customer is. The setting is per environment: Sandbox and Live are turned on separately, and both start off.

## Set up Stripe Tax first

Stripe Tax is set up in your own Stripe account, in **Settings › Tax**. Ledger checks it and shows what's missing:

| In Stripe | Why |
| - | - |
| A head office address | Without it, Stripe refuses every request that asks for tax. |
| A default tax behavior (exclusive or inclusive) | Ledger creates your plan prices without one, so the account default applies. Without it, Stripe refuses Checkout. |
| A registration wherever you collect tax | Without one, nothing fails, but Stripe charges \$0 tax. |

Ledger only lets you turn Automatic tax on once the first two are done. Products use your account's default tax code unless you set one on the product in Stripe. For a SaaS product, set the default to Software as a service: `txcd_10103001` for business use or `txcd_10103000` for personal use. Credit packs and overage are usually taxed like the service they pay for, so they can use the same code.

> [!NOTE]
>
> Stripe calculates and collects the tax; you're still responsible for it. Stripe's threshold monitoring shows where your Stripe sales may require you to register, but you register before collecting, and file and pay the tax, yourself or through Stripe's filing partners. Stripe charges \$0 tax where you have no registration.

> [!NOTE]
>
> A Sandbox account that Ledger created for you has no Stripe Dashboard. To try Stripe Tax in Sandbox, connect your own Stripe sandbox key in **Settings › Stripe**.

## What gets taxed

| Purchase | With Automatic tax on |
| - | - |
| Paid plan through Checkout | Checkout asks for a billing address and a tax ID, saves them on the Stripe customer, and adds tax. The subscription keeps automatic tax, so every renewal is taxed. |
| Credit pack through Checkout | The same. The pack's invoice shows the tax. |
| Paid plan on a saved card | Taxed when Stripe knows the customer's location. Without one, the plan is charged without tax. |
| Upgrade | Taxed when the subscription already has tax, or when the customer has a location (Ledger turns tax on for the subscription). Otherwise charged without tax. |
| Overage on a renewal | Added to the renewal invoice, and taxed with it. |
| Final overage invoice | Taxed when the customer has a location. Otherwise charged without tax, so it can still be collected. |
| Prorated refund on an immediate downgrade | Refunds the share of the price difference plus the tax charged on it. |

Ledger never emails an invoice: every purchase is charged to the customer's card, so a customer without an address is charged without tax rather than refused.

## Credits and amounts

* Customers get a plan's full credits whatever the tax. Ledger checks the plan's line on the invoice at your price, before tax, and accepts the tax Stripe adds. This is true even if you turned on tax in Stripe directly, and for subscriptions with tax that you [import from Stripe](https://docs.integrateledger.com/migrate-from-stripe.md).
* Discounts, coupons and customer balances are still not supported: an invoice with one grants no credits, and Ledger alerts.
* Overage prices and the overage cap are **before tax**. A $50 cap bills at most $50 of overage, plus its tax.

## Turning it on or off

Turning Automatic tax on only changes new purchases. Subscriptions that started without tax keep renewing without it until the customer upgrades, or until you turn on tax for them in Stripe (**Tax → Migrations** in the Stripe Dashboard). Turning it off stops Ledger asking for tax on new purchases; subscriptions that already have tax keep it in Stripe until you turn it off there.


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