Advance test clock
curl --request POST \
--url https://commet.co/api/v1/test-clock \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"advanceDays": 123
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({advanceDays: 123})
};
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"
payload = { "advanceDays": 123 }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://commet.co/api/v1/test-clock"
payload := strings.NewReader("{\n \"advanceDays\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://commet.co/api/v1/test-clock")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"advanceDays\": 123\n}")
.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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'advanceDays' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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;
}{
"success": true,
"data": {
"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
}
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}Test Clock
Advance test clock
Starts a durable run that moves the test clock forward and processes every billing deadline due before the target time. Poll GET /test-clock for progress and terminal results. Sandbox only.
POST
/
test-clock
Advance test clock
curl --request POST \
--url https://commet.co/api/v1/test-clock \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"advanceDays": 123
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({advanceDays: 123})
};
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"
payload = { "advanceDays": 123 }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://commet.co/api/v1/test-clock"
payload := strings.NewReader("{\n \"advanceDays\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://commet.co/api/v1/test-clock")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"advanceDays\": 123\n}")
.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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'advanceDays' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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;
}{
"success": true,
"data": {
"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
}
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}This reference describes API version
2026-05-12. Send Commet-Version: 2026-05-12 with your request.Encabezados
Cuerpo
application/json
¿Esta página le ayudó?