Document Verification — Canada Passport
curl --request POST \
--url https://adhere-api.smartcomply.com/api/onboarding/document_verification/canada/passport \
--header 'Content-Type: multipart/form-data' \
--header 'x-access-token: <api-key>' \
--form document_front='@example-file' \
--form selfie_image='@example-file'import requests
url = "https://adhere-api.smartcomply.com/api/onboarding/document_verification/canada/passport"
files = {
"document_front": ("example-file", open("example-file", "rb")),
"selfie_image": ("example-file", open("example-file", "rb"))
}
headers = {"x-access-token": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('document_front', '<string>');
form.append('selfie_image', '<string>');
const options = {method: 'POST', headers: {'x-access-token': '<api-key>'}};
options.body = form;
fetch('https://adhere-api.smartcomply.com/api/onboarding/document_verification/canada/passport', 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://adhere-api.smartcomply.com/api/onboarding/document_verification/canada/passport",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"selfie_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-access-token: <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://adhere-api.smartcomply.com/api/onboarding/document_verification/canada/passport"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"selfie_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://adhere-api.smartcomply.com/api/onboarding/document_verification/canada/passport")
.header("x-access-token", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"selfie_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://adhere-api.smartcomply.com/api/onboarding/document_verification/canada/passport")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"selfie_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"valid": true,
"first_name": "<string>",
"last_name": "<string>",
"full_name": "<string>",
"date_of_birth": "<string>",
"gender": "<string>",
"nationality": "<string>",
"address": "<string>",
"id_number": "<string>",
"serial_number": "<string>",
"id_type": "<string>",
"document_type": "<string>",
"expiry_date": "<string>",
"issue_date": "<string>",
"is_expired": true,
"photo": "<string>",
"extra_fields": {},
"face_match": {
"attempted": true,
"verified": true,
"confidence_percentage": 123,
"selfie_image": "<string>",
"reason": "<string>"
}
},
"message": "Document details retrieved successfully"
}{
"status": "failed",
"data": [
"<unknown>"
],
"message": "<string>"
}{
"status": "failed",
"message": "Authentication credentials were not provided."
}Canada
Passeport
Extrayez les détails d’identité d’un passeport canadien à l’aide de l’OCR.
POST
/
api
/
onboarding
/
document_verification
/
canada
/
passport
Document Verification — Canada Passport
curl --request POST \
--url https://adhere-api.smartcomply.com/api/onboarding/document_verification/canada/passport \
--header 'Content-Type: multipart/form-data' \
--header 'x-access-token: <api-key>' \
--form document_front='@example-file' \
--form selfie_image='@example-file'import requests
url = "https://adhere-api.smartcomply.com/api/onboarding/document_verification/canada/passport"
files = {
"document_front": ("example-file", open("example-file", "rb")),
"selfie_image": ("example-file", open("example-file", "rb"))
}
headers = {"x-access-token": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('document_front', '<string>');
form.append('selfie_image', '<string>');
const options = {method: 'POST', headers: {'x-access-token': '<api-key>'}};
options.body = form;
fetch('https://adhere-api.smartcomply.com/api/onboarding/document_verification/canada/passport', 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://adhere-api.smartcomply.com/api/onboarding/document_verification/canada/passport",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"selfie_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-access-token: <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://adhere-api.smartcomply.com/api/onboarding/document_verification/canada/passport"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"selfie_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://adhere-api.smartcomply.com/api/onboarding/document_verification/canada/passport")
.header("x-access-token", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"selfie_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://adhere-api.smartcomply.com/api/onboarding/document_verification/canada/passport")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"selfie_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"valid": true,
"first_name": "<string>",
"last_name": "<string>",
"full_name": "<string>",
"date_of_birth": "<string>",
"gender": "<string>",
"nationality": "<string>",
"address": "<string>",
"id_number": "<string>",
"serial_number": "<string>",
"id_type": "<string>",
"document_type": "<string>",
"expiry_date": "<string>",
"issue_date": "<string>",
"is_expired": true,
"photo": "<string>",
"extra_fields": {},
"face_match": {
"attempted": true,
"verified": true,
"confidence_percentage": 123,
"selfie_image": "<string>",
"reason": "<string>"
}
},
"message": "Document details retrieved successfully"
}{
"status": "failed",
"data": [
"<unknown>"
],
"message": "<string>"
}{
"status": "failed",
"message": "Authentication credentials were not provided."
}Vérifiez le passeport canadien d’un client en téléversant une photo de la page de données — aucune saisie manuelle du numéro de passeport requise. Extraction OCR plus une concordance faciale requise par rapport à un selfie — pas de vérification de vivacité (pas de vidéo, pas de défi de clignement/mouvement).
Le passeport est unilatéral — seul
document_front est nécessaire.selfie_image est requis — le visage extrait du document est comparé à celui-ci. Il s’agit d’une comparaison d’image fixe (pas de vivacité).Endpoint
POST /api/onboarding/document_verification/canada/passport
Requête
En-têtes
| En-tête | Valeur | Requis |
|---|---|---|
x-access-token | Votre clé secrète API | Oui |
Content-Type | multipart/form-data | Oui |
Paramètres de corps
| Paramètre | Type | Requis | Description |
|---|---|---|---|
document_front | file | Oui | Photo de la page de données du passeport. JPG ou PNG, max 5 Mo |
selfie_image | file | Oui | Un selfie à comparer avec la photo du visage du document. JPG ou PNG, max 5 Mo |
Exemple
curl -X POST "https://adhere-api.smartcomply.com/api/onboarding/document_verification/canada/passport" \
-H "x-access-token: YOUR_SECRET_KEY" \
-F "document_front=@/path/to/passport.jpg" \
-F "selfie_image=@/path/to/selfie.jpg"
const formData = new FormData();
formData.append("document_front", fs.createReadStream("/path/to/passport.jpg"));
formData.append("selfie_image", fs.createReadStream("/path/to/selfie.jpg"));
const response = await fetch(
"https://adhere-api.smartcomply.com/api/onboarding/document_verification/canada/passport",
{
method: "POST",
headers: { "x-access-token": "YOUR_SECRET_KEY" },
body: formData,
}
);
const data = await response.json();
import requests
response = requests.post(
"https://adhere-api.smartcomply.com/api/onboarding/document_verification/canada/passport",
headers={"x-access-token": "YOUR_SECRET_KEY"},
files={
"document_front": open("/path/to/passport.jpg", "rb"),
"selfie_image": open("/path/to/selfie.jpg", "rb"),
},
)
data = response.json()
Réponse
200 OK
| Champ | Type | Description |
|---|---|---|
status | string | "success" en cas d’extraction réussie |
data.full_name | string | Nom complet extrait |
data.first_name | string | Prénom extrait |
data.last_name | string | Nom de famille extrait |
data.date_of_birth | string | Date de naissance au format YYYY-MM-DD |
data.gender | string | Genre extrait |
data.nationality | string | Nationalité extraite |
data.id_number | string | Le numéro de passeport |
data.document_type | string | "passport" |
data.expiry_date | string | Date d’expiration du passeport |
data.is_expired | boolean | Si expiry_date est déjà passée |
data.photo | string | Photo du visage extraite du document, encodée en base64 |
data.extra_fields | object | Autres champs lus par l’OCR sur la page de données — place_of_birth, issuing_authority, nin (si intégré), et mrz_line1/mrz_line2 si la zone lisible par machine était lisible, exactement tels qu’imprimés |
data.face_match | object | Résultat de la comparaison du visage du document avec selfie_image — voir ci-dessous |
data.face_match.attempted | boolean | Si une comparaison a réellement été exécutée |
data.face_match.verified | boolean | null | true/false si la comparaison a été exécutée ; null si elle ne l’a pas pu (voir Notes de concordance faciale) |
data.face_match.confidence_percentage | number | Confiance de correspondance, 0–100 |
data.face_match.selfie_image | string | URL du selfie téléversé |
message | string | Résumé du résultat lisible par l’homme |
{
"status": "success",
"data": {
"valid": true,
"first_name": "JAMES",
"last_name": "TREMBLAY",
"full_name": "TREMBLAY JAMES",
"date_of_birth": "1988-07-22",
"gender": "M",
"nationality": "CANADIAN",
"id_number": "GA123456",
"document_type": "passport",
"expiry_date": "2027-09-30",
"is_expired": false,
"photo": "/9j/4AAQSkZJRgABAQAAAQABAAD...",
"extra_fields": {
"place_of_birth": "TORONTO, ON",
"issuing_authority": "GATINEAU, QC"
},
"face_match": {
"attempted": true,
"verified": true,
"confidence_percentage": 92.4,
"selfie_image": "https://.../selfie.jpg"
}
},
"message": "Document details retrieved successfully"
}
Notes de concordance faciale — si le service de comparaison lui-même échoue,
attempted reflète si une comparaison a réellement été exécutée et verified revient null avec un champ reason expliquant pourquoi — c’est différent de verified: false, qui signifie que la comparaison a été exécutée et que les visages ne correspondaient pas. Un problème de concordance faciale ne bloque jamais les données du document sous-jacent — le reste de data est toujours renvoyé.400 Bad Request
{
"status": "failed",
"data": [],
"message": "ID photo is too blurry — please retake in good lighting with a steady hand"
}
401 Unauthorized
{
"status": "failed",
"message": "Authentication credentials were not provided."
}
Pour une liste complète des codes d’erreur, consultez la référence Codes d’erreur.
Autorisations
Your Adhere API secret key
Corps
multipart/form-data

