صك إيصال
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
}الإيصالات
صك إيصال
إنشاء حدث إيصال موقع تشفيريًا ومثبت بسجل الشفافية.
POST
/
v1
/
receipts
صك إيصال
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
}ينشئ حدث إيصال موقع تشفيريًا ومثبتًا في سجل الشفافية. يتم التحقق من صحة الإيصالات مقابل مخطط نوع الإيصال المسجل قبل التوقيع.
أنواع الإيصالات
| النوع | الاسم | الحقول المطلوبة |
|---|---|---|
payment_receipt | إيصال دفع | amount، currency، provider، provider_reference، subject |
security_event_receipt | إيصال حدث أمني | event_type، severity، subject، outcome |
delivery_receipt | إيصال التسليم | item_reference، recipient، delivery_method، delivered_at |
compliance_receipt | إيصال الامتثال | check_type، subject، result، framework |
custom_receipt | إيصال مخصص | subject، event |
الرؤوس
الاستجابة
حدث Webhook
يتم تسليم حدث webhook لـreceipt.created إلى جميع نقاط النهاية المكونة بعد سك ناجح.الجسم
application/json

