The Test Clock object v1Test helper

Attributes

  • idstring

    Unique identifier for the object.

  • objectstring, value is "test_helpers.test_clock"

    String representing the object’s type. Objects of the same type share the same value.

  • createdtimestamp

    Time at which the object was created. Measured in seconds since the Unix epoch.

  • deletes_aftertimestamp

    Time at which this clock is scheduled to auto delete.

  • frozen_timetimestamp

    Time at which all objects belonging to this clock are frozen.

  • livemodeboolean

    If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.

  • namenullable string

    The custom name supplied at creation.

  • statusenum

    The status of the Test Clock.

    Possible enum values
    advancing

    In the process of advancing time for the test clock objects.

    internal_failure

    Failed to advance time. Future requests to advance time will fail.

    ready

    All test clock objects have advanced to the frozen_time.

  • status_detailsobject

    Details on the current state of the Test Clock.

The Test Clock object
{
"object": "test_helpers.test_clock",
"created": 1680112806,
"deletes_after": 1680717606,
"frozen_time": 1577836800,
"livemode": false,
"name": null,
"status": "ready"
}

Create a test clock v1Test helper

POST /v1/test_helpers/test_clocks

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

Parameters

  • frozen_timetimestampRequired

    The initial frozen time for this test clock.

  • namestring

    The name for this test clock.

    The maximum length is 300 characters.

More parameters

  • customerstring

Returns

The newly created TestClock object is returned upon success. Otherwise, this call raises an error.

curl https://api.stripe.com/v1/test_helpers/test_clocks \
-u "sk_test_...sk_test_...:" \
-H "Stripe-Version: 2026-10-28.endive" \
-d frozen_time=1577836800
Response
{
"object": "test_helpers.test_clock",
"created": 1680112806,
"deletes_after": 1680717606,
"frozen_time": 1577836800,
"livemode": false,
"name": null,
"status": "ready"
}

Retrieve a test clock v1Test helper

GET /v1/test_helpers/test_clocks/:id

Retrieves a test clock.

Parameters

  • idstringRequired

    Unique identifier for the object.

Returns

Returns the TestClock object. Otherwise, this call raises an error.

curl https://api.stripe.com/v1/test_helpers/test_clocks/ \
-u "sk_test_...sk_test_...:" \
-H "Stripe-Version: 2026-10-28.endive"
Response
{
"object": "test_helpers.test_clock",
"created": 1680112806,
"deletes_after": 1680717606,
"frozen_time": 1577836800,
"livemode": false,
"name": null,
"status": "ready"
}