curl --request POST \
--url https://api.paygentic.io/v0/testClocks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currentTime": "2023-11-07T05:31:56Z",
"description": "<string>",
"merchantId": "<string>",
"name": "<string>"
}
'import requests
url = "https://api.paygentic.io/v0/testClocks"
payload = {
"currentTime": "2023-11-07T05:31:56Z",
"description": "<string>",
"merchantId": "<string>",
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
currentTime: '2023-11-07T05:31:56Z',
description: '<string>',
merchantId: '<string>',
name: '<string>'
})
};
fetch('https://api.paygentic.io/v0/testClocks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.paygentic.io/v0/testClocks",
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([
'currentTime' => '2023-11-07T05:31:56Z',
'description' => '<string>',
'merchantId' => '<string>',
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paygentic.io/v0/testClocks"
payload := strings.NewReader("{\n \"currentTime\": \"2023-11-07T05:31:56Z\",\n \"description\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.paygentic.io/v0/testClocks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currentTime\": \"2023-11-07T05:31:56Z\",\n \"description\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/testClocks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currentTime\": \"2023-11-07T05:31:56Z\",\n \"description\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "tc_a1b2c3d4e5f6g7h8",
"createdAt": "2024-02-28T10:00:00Z",
"currentTime": "2024-03-01T00:00:00Z",
"deletedAt": null,
"description": "Test clock for monthly subscription billing scenarios",
"merchantId": "org_i9j0k1l2m3n4o5p6",
"name": "Monthly Billing Test",
"updatedAt": "2024-02-28T10:00:00Z"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Create
Creates a new test clock with an optional initial time. If no time is provided, uses the current time.
curl --request POST \
--url https://api.paygentic.io/v0/testClocks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currentTime": "2023-11-07T05:31:56Z",
"description": "<string>",
"merchantId": "<string>",
"name": "<string>"
}
'import requests
url = "https://api.paygentic.io/v0/testClocks"
payload = {
"currentTime": "2023-11-07T05:31:56Z",
"description": "<string>",
"merchantId": "<string>",
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
currentTime: '2023-11-07T05:31:56Z',
description: '<string>',
merchantId: '<string>',
name: '<string>'
})
};
fetch('https://api.paygentic.io/v0/testClocks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.paygentic.io/v0/testClocks",
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([
'currentTime' => '2023-11-07T05:31:56Z',
'description' => '<string>',
'merchantId' => '<string>',
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paygentic.io/v0/testClocks"
payload := strings.NewReader("{\n \"currentTime\": \"2023-11-07T05:31:56Z\",\n \"description\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.paygentic.io/v0/testClocks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currentTime\": \"2023-11-07T05:31:56Z\",\n \"description\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/testClocks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currentTime\": \"2023-11-07T05:31:56Z\",\n \"description\": \"<string>\",\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "tc_a1b2c3d4e5f6g7h8",
"createdAt": "2024-02-28T10:00:00Z",
"currentTime": "2024-03-01T00:00:00Z",
"deletedAt": null,
"description": "Test clock for monthly subscription billing scenarios",
"merchantId": "org_i9j0k1l2m3n4o5p6",
"name": "Monthly Billing Test",
"updatedAt": "2024-02-28T10:00:00Z"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Authorizations
API key authentication
Body
Initial time for the test clock (defaults to current time). Cannot be more than 1 hour in the past to prevent accidental backdating. The 1-hour buffer accounts for clock drift and network delays.
Description of the test clock's purpose
The merchant organization that will own this test clock. If not provided, will be extracted from authenticated user's context.
Name of the test clock
Response
Test clock created successfully
Unique identifier for the test clock
^tc_[a-zA-Z0-9]{16}$When the test clock was created
The simulated current time of the test clock
The merchant organization that owns this test clock
When the test clock was last updated
When the test clock was deleted (if applicable)
Description of the test clock's purpose
Name of the test clock
Was this page helpful?