Create a test clock
const url = 'http://localhost:8080/v1/test-clocks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","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 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "frozen_time": "2026-04-15T12:00:00Z" }'Test mode only. The clock starts in ready state at
frozen_time. Use /advance to move it forward.
Authorizations
Section titled “Authorizations”Parameters
Section titled “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
{ "name": "example", "frozen_time": "2026-04-15T12:00:00Z"}Responses
Section titled “Responses”Clock created
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"}