Beleg prägen
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>",
"payload": "<unknown>",
"receipt_type": "<string>",
"subject": "<string>"
}
'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>',
payload: '<unknown>',
receipt_type: '<string>',
subject: '<string>'
})
};
fetch('https://api.truthlocks.com/v1/receipts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/receipts"
payload = {
"issuer_id": "<string>",
"kid": "<string>",
"payload": "<unknown>",
"receipt_type": "<string>",
"subject": "<string>"
}
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)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 \"payload\": \"<unknown>\",\n \"receipt_type\": \"<string>\",\n \"subject\": \"<string>\"\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))
}{
"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
}Belege
Beleg prägen
Erstellen Sie ein kryptografisch signiertes, im Transparenzprotokoll verankertes Belegereignis.
POST
/
v1
/
receipts
Beleg prägen
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>",
"payload": "<unknown>",
"receipt_type": "<string>",
"subject": "<string>"
}
'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>',
payload: '<unknown>',
receipt_type: '<string>',
subject: '<string>'
})
};
fetch('https://api.truthlocks.com/v1/receipts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/receipts"
payload = {
"issuer_id": "<string>",
"kid": "<string>",
"payload": "<unknown>",
"receipt_type": "<string>",
"subject": "<string>"
}
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)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 \"payload\": \"<unknown>\",\n \"receipt_type\": \"<string>\",\n \"subject\": \"<string>\"\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))
}{
"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
}Erstellt ein kryptografisch signiertes, im Transparenzprotokoll verankertes Empfangsereignis. Belege werden vor der Signatur anhand des registrierten Belegtypschemas validiert.
Belegtypen
| Typ | Name | Erforderliche Felder |
|---|---|---|
payment_receipt | Zahlungsbeleg | amount, currency, provider, provider_reference, subject |
security_event_receipt | Sicherheitsereignisbeleg | event_type, severity, subject, outcome |
delivery_receipt | Lieferbeleg | item_reference, recipient, delivery_method, delivered_at |
compliance_receipt | Compliance-Beleg | check_type, subject, result, framework |
custom_receipt | Benutzerdefinierter Beleg | subject, event |
Header
Antwort
Webhook-Ereignis
Einreceipt.created Webhook-Ereignis wird nach einem erfolgreichen Mint an alle konfigurierten Endpunkte zugestellt.Autorisierungen
Body
application/json

