Sample - Stripe API
POST/v1/test_helpers/test_clocks

Create a test clock

Creates a new test clock that can be attached to new customers and quotes.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.
  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

4 body fields
customerstringoptional
Existing customer this test clock will be attached to. Once attached, customers can't be removed from a test clock.
expandarray<string>optional
Specifies which fields in the response should be expanded.
frozen_timeintegerrequired
The initial frozen time for this test clock.
namestringoptional
The name for this test clock.

2 status codes
200Successful response.
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
deletes_afterintegerrequired
Time at which this clock is scheduled to auto delete.
frozen_timeintegerrequired
Time at which all objects belonging to this clock are frozen.
idstringrequired
Unique identifier for the object.
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
namestringoptional
The custom name supplied at creation.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:test_helpers.test_clock
statusstringrequired
The status of the Test Clock.
Allowed:advancinginternal_failureready
status_detailsobjectrequired
defaultError response.
errorobjectrequired

Error handling

Any other status is an error: Error response.