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

# Test in Sandbox

> A full copy of Ledger with its own Stripe test account, ready the moment your workspace exists, so you can test every purchase, renewal and cancellation before you go live.

Sandbox lets you build and test your whole billing flow, from Checkout to renewals to cancellation, before a real customer sees it. Every workspace starts there, with its own API keys, catalog, customers, balances, usage history and Stripe account, separate from Live, so a test never touches a real customer. A `ledger_test_` key reaches Sandbox; [API keys](https://docs.integrateledger.com/api-keys.md#key-types) explains how the key chooses the environment.

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

In the dashboard, the **Sandbox** menu at the top of the sidebar holds **Go to production**. Once you've gone to production, it switches between Sandbox and Live. Sandbox pages carry a hatched band across the top; Live pages carry an ink band.

## Ledger's Stripe test account

Sandbox is ready the moment your workspace exists. Ledger creates a Stripe test account for it on Ledger's Stripe Connect platform, so you can take test payments without a Stripe sign-up. **Settings › Stripe** shows the account as created by Ledger.

Every paid plan syncs to that account, and Checkout runs on it, with zero setup. That includes plans with seat prices, annual and one-off prices, and metered overage: [Stripe](https://docs.integrateledger.com/stripe.md#what-ledger-creates-in-stripe) lists what Ledger creates.

The account sends its events to Ledger's platform endpoint, so webhooks work from the start. To see the Stripe objects in your own Stripe Dashboard, connect your own account's test mode in **Settings › Stripe** instead. [Stripe](https://docs.integrateledger.com/stripe.md#the-stripe-account-in-each-environment) explains both ways to connect.

## Test payments

Checkout in Sandbox takes [Stripe test cards](https://docs.stripe.com/testing), and every payment is simulated.

| Card number | What happens |
| - | - |
| `4242 4242 4242 4242` | The payment succeeds. |
| `4000 0000 0000 0341` | The card is saved, then declined when charged. Use it to test a failed renewal, or `402 payment_failed` on a saved-card attach. |
| `4000 0025 0000 3155` | The payment asks for 3D Secure authentication. |

Use any future expiry date, any three-digit CVC and any postal code. Stripe's page lists more cards, for declines, disputes and other countries.

## Move time forward

Renewals, allowance resets, overage invoices and cancellations happen at the end of a period. In Sandbox, you can put a customer on a Stripe test clock and move it forward to test them in minutes. See [Simulate time](https://docs.integrateledger.com/test/simulate-time.md).

## Start over

Deleting a Sandbox customer also deletes its usage events, so you can rerun a test from a clean customer.

A coding agent can make a Sandbox workspace and key without an account, then hand it to you to claim. See [Build with AI agents](https://docs.integrateledger.com/integrate/ai-agents.md).

## What differs in Live

Live runs the same code and the same rules, so what passes in Sandbox works in Live. The differences:

| | Sandbox | Live |
| - | - | - |
| Stripe account | Ledger's test account, or your own account's test mode | Your own Stripe account, in live mode |
| Ready | When the workspace is created | After **Go to production**: connect Stripe, copy your plans, create a Live key |
| Payments | Stripe test cards | Real cards and real charges, with no review |
| Simulated time | Yes, with Stripe test clocks | Real time |
| Deleting a customer | Deletes its usage events too | Keeps its usage events as the record of what the customer used |
| `check` and `track` rate limit | 100 a second per key | 1,000 a second per key ([Limits](https://docs.integrateledger.com/limits.md#rate-limits)) |

Free plans work in Live as soon as you have a Live key, because they never reach Stripe. [Coupons](https://docs.integrateledger.com/billing/renewals-and-lifecycle.md#coupons) and [promotion codes](https://docs.integrateledger.com/billing/discounts.md) work the same in both.

[Production checklist](https://docs.integrateledger.com/integrate/production-checklist.md) walks through moving to Live and the scenarios to test first.

## Rules

* Paid attaches in Live answer `503 live_charges_disabled` until Live is activated.
* A customer with a Stripe customer balance is refused a paid plan with `409 stripe_customer_balance`, in both environments. Clear the balance in Stripe first.

## Next steps

> [card] [Simulate time](https://docs.integrateledger.com/test/simulate-time.md)
>
> Run a customer through renewals and cancellation.

> [card] [Production checklist](https://docs.integrateledger.com/integrate/production-checklist.md)
>
> Test the scenarios that matter, then go live.


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