How the API chooses an environment
The API key selects the environment. Aledger_test_ key accesses sandbox data; a ledger_live_ key accesses live data. Both use https://api.integrateledger.com and the same endpoint paths. Send the key from your backend in Authorization: Bearer <key>. A request cannot switch environments with a body field or HTTP header.
Keep different server-side variables for the two keys. Do not use a live key in local browser code, test jobs, or sandbox fixtures. Customer IDs may be the same in both environments, but each environment has its own customer record and balance.
Prepare a live workspace
- Complete the sandbox billing walkthrough, including a plan, credit pack, and idempotent usage event.
- Select Live in the dashboard and create its API key. Store it securely; Ledger shows it only once.
- Create live features, plans, and credit packs. Sandbox catalog items are not copied into Live.
- Connect your Stripe
sk_live_key in Developer → Stripe. Ledger creates a separate live webhook endpoint. Confirm the connected account and webhook status before taking payments. - Set HTTPS success and cancel URLs in Developer → Checkout. These are independent of sandbox URLs.
- Verify that paid live plans show Synced. Activate the live environment once the dashboard reports that its API key, Stripe connection, webhook, return URLs, and catalog sync are ready.
503 live_charges_disabled. Do not send buyers a live Checkout link until the dashboard reports that live charges are enabled. Disabling new charges does not expire Checkout links already created; an operator must close outstanding sessions separately if sales need to stop immediately.
Verify live billing
Use a low-value plan and a customer you control. Open the returned Stripe Checkout URL, complete a real payment, and confirm the Ledger customer shows an Active subscription and the expected credit balance after the signed live invoice webhook arrives. Test a credit-pack purchase separately, then callPOST /v1/check and POST /v1/track with a unique request_id. A browser return URL is not proof of payment.
Live payments use real money. Make a deliberate choice about the test amount and refund or cancellation in your Stripe account before inviting customers.
See Authentication for key handling and Billing for payment timing.