Get test clock state
curl --request GET \
--url https://commet.co/api/v1/test-clock \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://commet.co/api/v1/test-clock', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://commet.co/api/v1/test-clock"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://commet.co/api/v1/test-clock"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://commet.co/api/v1/test-clock")
.header("x-api-key", "<api-key>")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://commet.co/api/v1/test-clock",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"simulatedTime": "2023-11-07T05:31:56Z",
"isActive": true,
"now": "2023-11-07T05:31:56Z",
"latestRun": {
"id": "<string>",
"status": "pending",
"startedAtTime": "2023-11-07T05:31:56Z",
"targetTime": "2023-11-07T05:31:56Z",
"estimatedDeadlineCount": 0,
"completedDeadlineCount": 0,
"failedDeadlineCount": 0,
"error": "<string>",
"items": [
{
"kind": "billing_cycle",
"status": "pending",
"dueAt": "2023-11-07T05:31:56Z",
"subscriptionId": "<string>",
"customerName": "<string>",
"invoiceNumber": "<string>",
"invoiceId": "<string>",
"outcome": "<string>",
"detail": "<string>",
"error": "<string>"
}
]
},
"object": "test_clock",
"livemode": true
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}Test Clock
Get test clock state
Returns the organization’s current test clock state and latest durable run. Sandbox only.
GET
/
test-clock
Get test clock state
curl --request GET \
--url https://commet.co/api/v1/test-clock \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://commet.co/api/v1/test-clock', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://commet.co/api/v1/test-clock"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://commet.co/api/v1/test-clock"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://commet.co/api/v1/test-clock")
.header("x-api-key", "<api-key>")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://commet.co/api/v1/test-clock",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"simulatedTime": "2023-11-07T05:31:56Z",
"isActive": true,
"now": "2023-11-07T05:31:56Z",
"latestRun": {
"id": "<string>",
"status": "pending",
"startedAtTime": "2023-11-07T05:31:56Z",
"targetTime": "2023-11-07T05:31:56Z",
"estimatedDeadlineCount": 0,
"completedDeadlineCount": 0,
"failedDeadlineCount": 0,
"error": "<string>",
"items": [
{
"kind": "billing_cycle",
"status": "pending",
"dueAt": "2023-11-07T05:31:56Z",
"subscriptionId": "<string>",
"customerName": "<string>",
"invoiceNumber": "<string>",
"invoiceId": "<string>",
"outcome": "<string>",
"detail": "<string>",
"error": "<string>"
}
]
},
"object": "test_clock",
"livemode": true
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}This reference describes API version
2026-07-24. Send Commet-Version: 2026-07-24 with your request.Headers
Was this page helpful?