Run a simulation
1
Open the customer
In the dashboard, switch to Sandbox, open Customers, and open the customer. Under the page header, Run a simulation on this customer has a Run simulation button.You can start before the customer has a paid plan, for example to test a signup at the end of a month, and attach the plan once the clock is running.
2
Choose a time and run
Pick a date and time (UTC) in the future and choose Run simulation. Ledger creates a test clock for the customer at the current time, then advances it.One run moves up to two months ahead for a customer with a subscription, or two years for a customer with none. To reach an annual renewal, advance a few times in a row.
3
Watch the renewal
Advancing takes a few seconds. When it passes a renewal, Ledger stops just after the period ends so it can add overage lines to the draft invoice, then carries on to your time. When both Stripe and Ledger have caught up, the sheet shows the new simulated time.The customer’s page now shows Simulated time with the clock’s time. Their balances, usage and invoices all use it.
4
Advance again, or finish
Choose Advance time to keep going. When you’re done, choose Finish simulation. Stripe deletes the clock, with its Stripe customer and subscription. Ledger keeps the customer and its history. A paid recurring plan ends; a free plan stays and starts again from the real time; a lifetime plan stays, and its grants move to start at the real time.
Use the API while time is simulated
check, track and GET /v1/customers work as usual and use the customer’s simulated time. A grant that has expired on the clock is gone, an annual plan’s monthly allowance resets on the clock’s months, and usage is recorded at the clock’s time. In Usage, those requests are marked as simulated.
The scenarios worth running before you go live, such as a renewal, overage on the invoice and a mid-period upgrade, are in the Production checklist.
Rules
- Simulated time runs in Sandbox; Live customers run on real time.
- Clocks move forward only.
- While the clock is advancing, Stripe holds changes to the customer. Track usage, change seats or change the plan once the dashboard shows the new simulated time.
- Stripe deletes a test clock 30 days after it’s created.