Vérifier le reçu
curl --request POST \
--url https://api.truthlocks.com/v1/receipts/verify \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"receipt_id": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({receipt_id: '<string>'})
};
fetch('https://api.truthlocks.com/v1/receipts/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/receipts/verify"
payload = { "receipt_id": "<string>" }
headers = {
"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/verify"
payload := strings.NewReader("{\n \"receipt_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}{
"valid": true,
"receipt_id": "<string>",
"checks": {}
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Reçus
Vérifier le reçu
Vérifier la signature cryptographique et le statut actuel d’un reçu.
POST
/
v1
/
receipts
/
verify
Vérifier le reçu
curl --request POST \
--url https://api.truthlocks.com/v1/receipts/verify \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"receipt_id": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({receipt_id: '<string>'})
};
fetch('https://api.truthlocks.com/v1/receipts/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/receipts/verify"
payload = { "receipt_id": "<string>" }
headers = {
"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/verify"
payload := strings.NewReader("{\n \"receipt_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}{
"valid": true,
"receipt_id": "<string>",
"checks": {}
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Vérifie un reçu par ID. Renvoie un verdict indiquant la validité cryptographique et le statut actuel du reçu.
Verdicts
| Verdict | Signification |
|---|---|
VALID | La signature est valide, la clé n’a pas été compromise, le reçu est actif |
REVOKED | Le reçu a été explicitement révoqué |
INVALID_SIGNATURE | La vérification de la signature cryptographique a échoué |
KEY_COMPROMISED | La clé de signature a été marquée comme compromise à ou avant l’émission |
KEY_INACTIVE | La clé de signature n’est plus active |
NOT_FOUND | Reçu introuvable pour ce locataire |

