Create a test clock Test helper

Billing
Test Clocks
Create a test clock

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.

Returns

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

POST /v1/test_helpers/test_clocks
curl https://api.stripe.com/v1/test_helpers/test_clocks \
-u "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \
-d frozen_time=1577836800
Response
{
"id": "clock_1Mr3I22eZvKYlo2Ck0rgMqd7",
"object": "test_helpers.test_clock",
"created": 1680112806,
"deletes_after": 1680717606,
"frozen_time": 1577836800,
"livemode": false,
"name": null,
"status": "ready"
}