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

> Collect sales tax, VAT and GST on every plan, pack, seat and overage line Ledger sells, calculated by Stripe Tax from where each customer is.

Ledger collects sales tax, VAT and GST on everything it sells: plans, credit packs, seats, renewals and overage. Turn on **Automatic tax** in **Settings › Tax** and Ledger asks Stripe Tax to calculate tax on every Checkout, subscription and invoice it creates, at the rate for where the customer is. Customers still get every credit and allowance they paid for, because tax never changes a grant.

The setting is per environment, so you can try it in Sandbox before you turn it on in Live. Tax is calculated on each invoice in its own [currency](https://docs.integrateledger.com/pricing/currencies.md), so a customer billed in euros is taxed in euros.

## 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 left to do:

| In Stripe | What it does |
| - | - |
| A head office address | Lets Stripe calculate tax on every request. |
| A default tax behavior (exclusive or inclusive) | Sets whether your prices include tax. Ledger creates every price without a tax behavior of its own, so each follows this default. |
| A registration wherever you collect tax | Stripe charges tax in every place you're registered. |

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, seats and overage are usually taxed like the service they pay for, so they can use the same code.

Stripe calculates and collects the tax, and its threshold monitoring shows where you may need to register. Registering, filing and paying are yours, directly or through Stripe's filing partners.

To try Stripe Tax in Sandbox, connect your own Stripe account's test mode in **Settings › Stripe**, so you can set up Stripe Tax in its Dashboard. See [Sandbox](https://docs.integrateledger.com/test/sandbox.md).

## What gets taxed

| Purchase | With Automatic tax on |
| - | - |
| Paid plan through Checkout, monthly or annual | 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, seat lines included. |
| Lifetime plan through Checkout | The same, on its one payment. |
| Credit pack through Checkout | The same. The pack's invoice shows the tax. |
| Paid or lifetime plan on a saved card | Taxed at the customer's location: an address saved with [billing details](https://docs.integrateledger.com/customers/billing-details.md), or by an earlier Checkout. |
| Upgrade | Taxed when the subscription already has tax, or when the customer has a location, in which case Ledger turns tax on for the subscription. |
| Overage on a renewal | Added to the renewal invoice, and taxed with it. |
| Final overage invoice | Taxed at the customer's location. |
| Prorated refund on an immediate downgrade | Refunds the share of the price difference plus the tax charged on it. |

A customer marked `taxExempt: exempt` in their [billing details](https://docs.integrateledger.com/customers/billing-details.md) is never taxed; `reverse` shows Stripe's reverse-charge note.

Every purchase is charged to the customer's card, so every sale completes: a customer Stripe has no location for is charged the untaxed price. Save their address with [billing details](https://docs.integrateledger.com/customers/billing-details.md) to tax saved-card purchases from the start.

## Grants and amounts

* **Tax never changes a grant.** Customers get a plan's full credits and allowances whatever the tax. Ledger checks the plan's line on the invoice at your price, before tax, and accepts the tax Stripe adds. This holds when you turned on tax in Stripe directly too, and for subscriptions you [import from Stripe](https://docs.integrateledger.com/integrate/migrate-from-stripe.md).
* **Coupons** lower the amount that's taxed, never the grant. See [Coupons](https://docs.integrateledger.com/billing/renewals-and-lifecycle.md#coupons).
* **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 applies to every new purchase. To tax subscriptions that started earlier, turn on tax for them in Stripe (**Tax → Migrations** in the Stripe Dashboard); an upgrade also turns it on for a customer with a location. Turning it off stops Ledger asking for tax on new purchases, and subscriptions that already have tax keep it in Stripe until you turn it off there.

## Rules

* Automatic tax turns on once your Stripe account has a head office address and a default tax behavior.
* Stripe charges tax only where you have a registration; elsewhere it charges \$0 tax.
* Automatic tax starts off in both Sandbox and Live; turn each on separately.
* A Sandbox account Ledger created for you has no Stripe Dashboard, so set up Stripe Tax on your own connected account.


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