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.You can move up to two billing periods ahead at a time, or two years for a customer with no paid plan. Clocks only move forward.
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 balance, 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 free plan stays, a paid plan ends.
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, and usage is recorded at the clock’s time. In Usage, those requests are marked as simulated.
While the clock is advancing, Stripe refuses changes to the customer, so wait until the dashboard shows the new simulated time before you track usage or change the plan.
Scenarios worth testing
Stripe deletes a test clock 30 days after it’s created.