Get billing status
curl --request GET \
--url https://api.truthlocks.com/v1/billing/status \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.truthlocks.com/v1/billing/status"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.truthlocks.com/v1/billing/status', 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.truthlocks.com/v1/billing/status",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/billing/status"
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://api.truthlocks.com/v1/billing/status")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.truthlocks.com/v1/billing/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"plan": "<string>",
"status": "<string>",
"trial_ends_at": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Billing
Get billing status
Returns the current billing state, feature mode, and grace period for the authenticated tenant.
GET
/
v1
/
billing
/
status
Get billing status
curl --request GET \
--url https://api.truthlocks.com/v1/billing/status \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.truthlocks.com/v1/billing/status"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.truthlocks.com/v1/billing/status', 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.truthlocks.com/v1/billing/status",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/billing/status"
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://api.truthlocks.com/v1/billing/status")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.truthlocks.com/v1/billing/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"plan": "<string>",
"status": "<string>",
"trial_ends_at": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}GET /v1/billing/status
feature_mode is NORMAL and grace_until is null. If a payment fails, the account enters a graduated access workflow — Degraded, Restricted, then Suspended — with a grace period at each stage.
Response
string
The billing account state:
ACTIVE, PAST_DUE, UNPAID, or SUSPENDED.string
The current feature capability level:
NORMAL— all features availableDEGRADED— payment failed; all features still work during the grace periodRESTRICTED— grace period running out; write operations (minting, key creation) are disabledSUSPENDED— grace period expired; all API access is disabled until payment is resolved
string | null
ISO 8601 timestamp for when the current grace period ends, or
null if the account is in good standing.string | null
A human-readable message describing the required action, or
null when no action is needed.When to use this endpoint
UseGET /v1/billing/status to:
- Surface payment prompts — check
feature_modeon app startup or login and show a banner when the value is anything other thanNORMAL. - Guard write operations — before minting or creating keys, verify that
feature_modeis notRESTRICTEDorSUSPENDED. - Track grace deadlines — read
grace_untilto show your users exactly how long they have to resolve a payment issue.
const res = await fetch("https://api.truthlocks.com/v1/billing/status", {
headers: { "X-API-Key": "tl_live_..." },
});
const { feature_mode, grace_until } = await res.json();
if (feature_mode !== "NORMAL") {
showPaymentBanner(feature_mode, grace_until);
}
Grace period timing
The default grace windows for the Standard contract mode are:| Transition | Grace window | Notifications |
|---|---|---|
| NORMAL → DEGRADED | 7 days | Reminders at T+24h, T+48h, T+72h |
| DEGRADED → RESTRICTED | 14 days | Reminders at T+24h, T+48h, T+72h |
| RESTRICTED → SUSPENDED | Immediate | Final suspension notice |
See payment failures and grace periods for a full breakdown of the graduated access workflow.

