Advance the clock to a new frozen_time
const url = 'http://localhost:8080/v1/test-clocks/example/advance';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"frozen_time":"2026-04-15T12:00:00Z"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/v1/test-clocks/example/advance \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "frozen_time": "2026-04-15T12:00:00Z" }'Moves the clock forward and runs billing catchup asynchronously
for every subscription pinned to this clock. The 200 returns as
soon as the clock is marked advancing — a background worker
drains the catchup; poll GET /v1/test-clocks/{id} until status
leaves advancing. Concurrent advances 409 while catchup runs.
Catchup failures park the clock in internal_failure — resume
it with POST /v1/test-clocks/{id}/retry-advance (deletion is
not required). ADR-018. Catchup bills every skipped period
before it runs payment retries and dunning, so when a dunning
policy cancels or pauses a subscription, advance to the time of
the invoice’s last retry first, then to the next billing date.
The cancel or pause is dated at the advance target, and one
longer advance bills a period a real clock would not (#1276).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Makes the call safe to retry. Send a unique value (a UUID works) and
the same value on every retry. For 24 hours, a repeat with the same
key, method, path and body gets the first response again, with an
Idempotent-Replayed: true header, instead of running again. The
error cases are in docs/api-surface.md. The usage routes do not take
it: each usage event carries its own idempotency_key.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Example generated
{ "frozen_time": "2026-04-15T12:00:00Z"}Responses
Section titled “Responses”Advance accepted — clock returned in advancing state
A clock for test mode. Customers and subscriptions attached to it are billed on its time, not the real time.
object
The clock’s current time.
ready: it can be advanced or deleted. advancing: billing is
catching up to the new time. internal_failure: the last advance
failed partway; resume it with POST /v1/test-clocks/{id}/retry-advance.
Why the last advance failed. Cleared by the next successful advance.
What the latest advance did: the time span it covered and how many of each billing step it ran. Absent until the clock is first advanced.
object
True when a step failed. The counts then cover only the work done before the failure.
Example
{ "status": "ready"}Clock is not in ready state
New frozen_time is not strictly after the current frozen_time, or is more than one year after it