Create test clock
curl --request POST \
--url https://uat-api.clinkbill.com/api/subscription/test-clocks \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--header 'X-Timestamp: <x-timestamp>' \
--data '
{
"name": "April renewal simulation",
"subscriptionId": "sub_xxxxx",
"metadata": "{\"scene\":\"docs-demo\"}"
}
'HttpResponse<String> response = Unirest.post("https://uat-api.clinkbill.com/api/subscription/test-clocks")
.header("X-Timestamp", "<x-timestamp>")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"April renewal simulation\",\n \"subscriptionId\": \"sub_xxxxx\",\n \"metadata\": \"{\\\"scene\\\":\\\"docs-demo\\\"}\"\n}")
.asString();import requests
url = "https://uat-api.clinkbill.com/api/subscription/test-clocks"
payload = {
"name": "April renewal simulation",
"subscriptionId": "sub_xxxxx",
"metadata": "{\"scene\":\"docs-demo\"}"
}
headers = {
"X-Timestamp": "<x-timestamp>",
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Timestamp': '<x-timestamp>',
'X-API-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'April renewal simulation',
subscriptionId: 'sub_xxxxx',
metadata: '{"scene":"docs-demo"}'
})
};
fetch('https://uat-api.clinkbill.com/api/subscription/test-clocks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"msg": "success",
"data": {
"name": "<string>",
"clockId": "<string>",
"subscriptionId": "<string>",
"frozenTime": 123,
"lastAdvancedTo": 123,
"status": "READY",
"livemode": true,
"metadata": "<string>",
"eventCount": 123,
"createTime": 123,
"updateTime": 123
}
}"<string>"Test Clock
Create Test Clock
Create a new test clock for a subscription
POST
/
subscription
/
test-clocks
Create test clock
curl --request POST \
--url https://uat-api.clinkbill.com/api/subscription/test-clocks \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--header 'X-Timestamp: <x-timestamp>' \
--data '
{
"name": "April renewal simulation",
"subscriptionId": "sub_xxxxx",
"metadata": "{\"scene\":\"docs-demo\"}"
}
'HttpResponse<String> response = Unirest.post("https://uat-api.clinkbill.com/api/subscription/test-clocks")
.header("X-Timestamp", "<x-timestamp>")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"April renewal simulation\",\n \"subscriptionId\": \"sub_xxxxx\",\n \"metadata\": \"{\\\"scene\\\":\\\"docs-demo\\\"}\"\n}")
.asString();import requests
url = "https://uat-api.clinkbill.com/api/subscription/test-clocks"
payload = {
"name": "April renewal simulation",
"subscriptionId": "sub_xxxxx",
"metadata": "{\"scene\":\"docs-demo\"}"
}
headers = {
"X-Timestamp": "<x-timestamp>",
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Timestamp': '<x-timestamp>',
'X-API-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'April renewal simulation',
subscriptionId: 'sub_xxxxx',
metadata: '{"scene":"docs-demo"}'
})
};
fetch('https://uat-api.clinkbill.com/api/subscription/test-clocks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"msg": "success",
"data": {
"name": "<string>",
"clockId": "<string>",
"subscriptionId": "<string>",
"frozenTime": 123,
"lastAdvancedTo": 123,
"status": "READY",
"livemode": true,
"metadata": "<string>",
"eventCount": 123,
"createTime": 123,
"updateTime": 123
}
}"<string>"Authorizations
Your secret API key obtained from the Clink dashboard (Developers section)
Headers
Current timestamp in milliseconds since Unix epoch (required for request signing)
Example:
"1783513683000"
Body
application/json