Mint receipt
curl --request POST \
--url https://api.truthlocks.com/v1/receipts \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-API-Key: <api-key>' \
--data '
{
"issuer_id": "<string>",
"kid": "<string>",
"receipt_type": "<string>",
"subject": "<string>",
"payload": {},
"metadata": {}
}
'import requests
url = "https://api.truthlocks.com/v1/receipts"
payload = {
"issuer_id": "<string>",
"kid": "<string>",
"receipt_type": "<string>",
"subject": "<string>",
"payload": {},
"metadata": {}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"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: {
'Idempotency-Key': '<idempotency-key>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
issuer_id: '<string>',
kid: '<string>',
receipt_type: '<string>',
subject: '<string>',
payload: {},
metadata: {}
})
};
fetch('https://api.truthlocks.com/v1/receipts', 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/receipts",
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([
'issuer_id' => '<string>',
'kid' => '<string>',
'receipt_type' => '<string>',
'subject' => '<string>',
'payload' => [
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/receipts"
payload := strings.NewReader("{\n \"issuer_id\": \"<string>\",\n \"kid\": \"<string>\",\n \"receipt_type\": \"<string>\",\n \"subject\": \"<string>\",\n \"payload\": {},\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://api.truthlocks.com/v1/receipts")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"issuer_id\": \"<string>\",\n \"kid\": \"<string>\",\n \"receipt_type\": \"<string>\",\n \"subject\": \"<string>\",\n \"payload\": {},\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.truthlocks.com/v1/receipts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"issuer_id\": \"<string>\",\n \"kid\": \"<string>\",\n \"receipt_type\": \"<string>\",\n \"subject\": \"<string>\",\n \"payload\": {},\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"receipt_id": "<string>",
"receipt_type": "<string>",
"status": "<string>",
"issuer_id": "<string>",
"subject": "<string>",
"signature": {
"alg": "<string>",
"kid": "<string>",
"value": "<string>"
},
"issued_at": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Receipts
Mint Receipt
Create a cryptographically signed, transparency-log-anchored receipt event.
POST
/
v1
/
receipts
Mint receipt
curl --request POST \
--url https://api.truthlocks.com/v1/receipts \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-API-Key: <api-key>' \
--data '
{
"issuer_id": "<string>",
"kid": "<string>",
"receipt_type": "<string>",
"subject": "<string>",
"payload": {},
"metadata": {}
}
'import requests
url = "https://api.truthlocks.com/v1/receipts"
payload = {
"issuer_id": "<string>",
"kid": "<string>",
"receipt_type": "<string>",
"subject": "<string>",
"payload": {},
"metadata": {}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"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: {
'Idempotency-Key': '<idempotency-key>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
issuer_id: '<string>',
kid: '<string>',
receipt_type: '<string>',
subject: '<string>',
payload: {},
metadata: {}
})
};
fetch('https://api.truthlocks.com/v1/receipts', 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/receipts",
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([
'issuer_id' => '<string>',
'kid' => '<string>',
'receipt_type' => '<string>',
'subject' => '<string>',
'payload' => [
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/receipts"
payload := strings.NewReader("{\n \"issuer_id\": \"<string>\",\n \"kid\": \"<string>\",\n \"receipt_type\": \"<string>\",\n \"subject\": \"<string>\",\n \"payload\": {},\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://api.truthlocks.com/v1/receipts")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"issuer_id\": \"<string>\",\n \"kid\": \"<string>\",\n \"receipt_type\": \"<string>\",\n \"subject\": \"<string>\",\n \"payload\": {},\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.truthlocks.com/v1/receipts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"issuer_id\": \"<string>\",\n \"kid\": \"<string>\",\n \"receipt_type\": \"<string>\",\n \"subject\": \"<string>\",\n \"payload\": {},\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"receipt_id": "<string>",
"receipt_type": "<string>",
"status": "<string>",
"issuer_id": "<string>",
"subject": "<string>",
"signature": {
"alg": "<string>",
"kid": "<string>",
"value": "<string>"
},
"issued_at": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Creates a cryptographically signed, transparency-log-anchored receipt event. Receipts are validated against the registered receipt type schema before signing.
Receipt types
| Type | Name | Required Fields |
|---|---|---|
payment_receipt | Payment Receipt | amount, currency, provider, provider_reference, subject |
security_event_receipt | Security Event Receipt | event_type, severity, subject, outcome |
delivery_receipt | Delivery Receipt | item_reference, recipient, delivery_method, delivered_at |
compliance_receipt | Compliance Receipt | check_type, subject, result, framework |
custom_receipt | Custom Receipt | subject, event |
Headers
string
required
UUID for idempotent minting. If you submit the same key twice, the original receipt is returned.
Request
string
required
UUID of the issuer signing the receipt.
string
required
Key ID of the signing key.
string
required
Signing algorithm:
Ed25519, ES256, or RS256.string
required
Receipt type name (e.g.
payment_receipt, security_event_receipt, or a custom type).string
required
Subject identifier for the receipt.
object
required
Receipt payload — validated against the receipt type’s JSON Schema.
object
Optional metadata attached to the receipt envelope.
Response
string
UUID of the created receipt.
string
The receipt type name.
string
activestring
UUID of the signing issuer.
string
Subject identifier.
object
Cryptographic signature:
alg, kid, value.string
ISO 8601 timestamp.
Webhook event
Areceipt.created webhook event is delivered to all configured endpoints after a successful mint.Authorizations
API key for machine-to-machine authentication
Headers
UUID for idempotent minting
Body
application/json
UUID of the issuer signing the receipt
Key ID of the signing key
Signing algorithm
Available options:
Ed25519, ES256, ES384, ES512, RS256, RS384, RS512, PS256, PS384, PS512 Receipt type name
Subject identifier
Receipt payload validated against schema
Optional metadata

