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

# Sandbox and Live

> Every workspace has two environments. Build and test in Sandbox, then take real payments in Live.

A Ledger workspace has two environments, **Sandbox** and **Live**. Each one has its own API keys, catalog, customers, balances, usage history and Stripe account. Nothing is shared between them, so a test in Sandbox can never touch a real customer.

```mermaid theme={"system"}
%%{init: {"theme": "base", "themeVariables": {"fontFamily": "IBM Plex Sans, sans-serif", "fontSize": "14px", "primaryColor": "#f7f6f3", "primaryBorderColor": "#c4bfb5", "primaryTextColor": "#1a1816", "lineColor": "#6b655c", "clusterBkg": "#ffffff", "clusterBorder": "#dbd7cf"}}}%%
flowchart LR
    sk["ledger_test_ key"] --> sd["Sandbox<br/>catalog · customers · usage"]
    sd <-- "Checkout · webhook" --> ss["Stripe test account"]
    lk["ledger_live_ key"] --> ld["Live<br/>catalog · customers · usage"]
    ld <-- "Checkout · webhook" --> ls["Your live Stripe account"]
    style ld fill:#eff2fd,stroke:#2443c4
```

## The API key chooses the environment

There's one API host, `https://api.integrateledger.com`, for both environments. Ledger reads the environment from the key on each request:

| Key prefix | Environment | Reaches |
| - | - | - |
| `ledger_test_` | Sandbox | Sandbox catalog, customers and Stripe test account |
| `ledger_live_` | Live | Live catalog, customers and your live Stripe account |

A request body or header can't switch environments. A Sandbox key that asks for a Live customer gets `404 customer_not_found`, because that customer doesn't exist in Sandbox. The same `customerId` can exist in both environments as two separate customers.

In the dashboard, the switch at the top of the sidebar chooses which environment you're looking at. Sandbox pages carry a hatched band across the top; Live pages carry an ink band.

## Sandbox

Sandbox is ready the moment your workspace exists:

* **A Stripe test account.** Ledger creates one for your workspace on its Stripe Connect platform, shown in **Settings › Stripe** as created by Ledger. Paid plans sync to it, and Checkout runs on it, with no setup. You can connect your own `sk_test_` key instead (see [Stripe](https://docs.integrateledger.com/stripe.md)).
* **Test payments.** Checkout takes [Stripe test cards](https://docs.stripe.com/testing), such as `4242 4242 4242 4242`.
* **Simulated time.** Move a customer through renewals on a Stripe test clock. See [Simulated time](https://docs.integrateledger.com/customers/simulate-time.md).
* **Overage.** Paid plans can bill usage past their allowance. See [Overage](https://docs.integrateledger.com/configure-pricing/overage.md).
* **Deleting customers** removes their usage events too, so you can start over cleanly.

## Live

Live takes real payments from your own Stripe account. Before it can, you finish a short setup in the dashboard: a Live API key, your live Stripe key, the payment webhook, Checkout redirect URLs and a paid plan synced to Stripe. Then you activate Live from Settings, and live charges start straight away. Ledger can suspend a workspace that breaks its terms. [Deploy](https://docs.integrateledger.com/getting-started/deploy.md) walks through each step.

Free plans work in Live as soon as you have a Live API key, because they never touch Stripe.

### What Live doesn't support yet

| Capability | Sandbox | Live |
| - | - | - |
| Free and paid monthly plans | Yes | Yes |
| Credit packs | Yes | Yes |
| Upgrades and downgrades | Yes | Yes |
| Stop or resume renewal | Yes | Yes |
| [Overage](https://docs.integrateledger.com/configure-pricing/overage.md) | Yes | Yes |
| Simulated time (test clocks) | Yes | No |
| [Automatic tax](https://docs.integrateledger.com/concepts/tax.md) (Stripe Tax) | Yes | Yes |
| Promotion codes, or changing the plan of a subscription with discounts | No | No |

Deleting a Live customer keeps its usage events as the record of what the customer used.

## Next steps

> [card] [Deploy and go live](https://docs.integrateledger.com/getting-started/deploy.md)
>
> Finish Live setup and take your first real payment.

> [card] [API keys and permissions](https://docs.integrateledger.com/api-keys.md)
>
> Create keys for each environment and limit what they can do.


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