Document Verification
Ensure the authenticity of end-users’ identity documents with a secure and reliable solution. Facia’s robust ID verification system is designed to safeguard against fraud, forgery, data manipulation, and unauthorized alterations. The solution strengthens protection against potential fraudulent activities while ensuring a seamless experience and maintaining high end-user conversion rates.
Generate Document Verification Request
This endpoint initiates a transaction request for document verification and returns response accordingly if the request includes proper authentication and valid fields, as mentioned below in the request parameters, using the POST method.
Endpoint
POSThttps://api.facia.ai/document-verification
Authorization:
Token Type: Client-Secret/Bearer TokenDescription:
This API utilizes Access token or Client-Secret key in header for authentication.
You can use your client_id and client_secret key when using the "/request-access-token" endpoint to obtain a Bearer token for authorization while connecting to this API. For additional details on Authorization, click Here
Request Body Samples:
- HTTP
- Javascript
- Curl
- PHP
- Python
- Ruby
- Java
- C#
- Go
//POST /document-verification HTTP/1.1
//Host: https://api.facia.ai
//Content-Type: application/json
//Headers: client-secret <client_secret_here>
{
"additional_file": "data:image/png;base64,your_image_base64_here",
"file": "data:image/png;base64,your_image_base64_here",
"type": "document_verification"
}
var myHeaders = new Headers();
myHeaders.append("client-secret", "<client_secret_here>");
var raw = JSON.stringify({
"additional_file": "data:image/png;base64,your_image_base64_here",
"file": "data:image/png;base64,your_image_base64_here",
"type": "document_verification"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.facia.ai/document-verification", requestOptions)
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.log('error', error));
curl --location 'https://api.facia.ai/document-verification' \
--header 'Content-Type: application/json' \
--header 'client-secret: <client_secret_here>' \
--data-raw '{
"additional_file": "data:image/png;base64,your_image_base64_here",
"file": "data:image/png;base64,your_image_base64_here",
"type": "document_verification"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.facia.ai/document-verification',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"additional_file": "data:image/png;base64,your_image_base64_here",
"file": "data:image/png;base64,your_image_base64_here",
"type": "document_verification"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'client-secret: <client_secret_here>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://api.facia.ai/document-verification"
payload = {
"additional_file": "data:image/png;base64,your_image_base64_here",
"file": "data:image/png;base64,your_image_base64_here",
"type": "document_verification"
}
headers = {
'Content-Type': 'application/json',
'client-secret': '<client_secret_here>'
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
require 'net/http'
require 'uri'
require 'json'
url = URI.parse('https://api.facia.ai/document-verification')
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url.path)
request['Content-Type'] = 'application/json'
request['client-secret'] = '<client_secret_here>'
request.body = {
"additional_file": "data:image/png;base64,your_image_base64_here",
"file": "data:image/png;base64,your_image_base64_here",
"type": "document_verification"
}.to_json
response = http.request(request)
puts response.body
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.InputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
try {
URL url = new URL("https://api.facia.ai/document-verification");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("client-secret", "<client_secret_here>");
conn.setDoOutput(true);
String jsonInputString = "{ \"additional_file\": \"data:image/png;base64,your_image_base64_here\", \"file\": \"data:image/png;base64,your_image_base64_here\", \"type\": \"document_verification\" }";
try(OutputStream os = conn.getOutputStream()) {
byte[] input = jsonInputString.getBytes("utf-8");
os.write(input, 0, input.length);
}
try(InputStream is = conn.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(is, "utf-8"))) {
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
System.out.println(response.toString());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("client-secret", "<client_secret_here>");
var json = "{\"additional_file\":\"data:image/png;base64,your_image_base64_here\",\"file\":\"data:image/png;base64,your_image_base64_here\",\"type\":\"document_verification\"}";
var content = new StringContent(json, Encoding.UTF8, "application/json");
HttpResponseMessage response = await client.PostAsync("https://api.facia.ai/document-verification", content);
string responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseString);
}
}
}
package main
import (
"bytes"
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.facia.ai/document-verification"
jsonStr := []byte(`{
"additional_file": "data:image/png;base64,your_image_base64_here",
"file": "data:image/png;base64,your_image_base64_here",
"type": "document_verification"
}`)
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("client-secret", "<client_secret_here>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
Request Parameters
Parameters | Description |
---|---|
type | Required: Yes Type: string Example: type=document_verification The service type being used. |
file | Required: Yes Type: string (Base64 encoded image) Example: file=data:image/png;base64,your_image_base64_here |
additional_file | Required: No Type: string (Base64 encoded image) Example: additional_file=data:image/png;base64,your_image_base64_here |
Response Sample
{
"status": true,
"message": "success",
"result": {
"data": {
"reference_id": "ABC12345678",
"event": "verification_declined",
"ocr_results": {
"name": {
"first_name": John,
"middle_name": null,
"last_name": Doe,
"full_name": "John Doe"
},
"dob": "1999-01-01",
"expiry_date": "2020-01-01",
"issue_date": "2020-01-10",
"document_number": "1234567892345",
"gender": "M",
"full_address": "123, Street, City, Country",
"age": 25,
"selected_type": [
"id_card"
]
},
"decline_reason": "Uploaded image is found on the internet."
}
}
}
Response Parameters
Parameters | Description |
---|---|
reference_id | Type: string Example: reference_id=ABC12345678 The unique identifier associated with each transaction. |
ocr_results | Type: object The object will include the extracted data from the provided card. |
event | Type: string Indicates the final decision of the transaction. Example: verification_accepted/declined |
decline_reason | Type: string Returns the reason based on which the case was declined. |
Declined Reasons
When a document verification request is declined, the API returns a specific reason in the decline_reason
field of the response. The following table lists all possible declined reasons that may be returned during document verification:
Identity Document Declined Reasons
Declined Reasons |
---|
Image of the face not found on the document. |
Image is altered or photoshopped. |
Copy of the image found on web. |
Document and Document Two does not belong to the same person. |
Document originality could not be verified. |
Name on the document doesn't match. |
DOB on the document doesn't match. |
Date on the document doesn't match. |
Issue date on the document doesn't match. |
Number on the document doesn't match. |
The issuing country of document is not supported, please upload a valid document. |
Document doesn't match the provided options. |
Age could not be verified. |
Face on the document doesn't match with camera image. |
The expiry date of the document does not match the record, please upload a document with valid expiry date. |
The document is expired, please upload a new document which is not expired. |
The uploaded image of the document is blur, please provide a clear photo of document. |
Face could not be detected in image, please upload image again with your face clearly visible. |
Document Quality and Authenticity Issues
Declined Reasons |
---|
Proof and Additional Proof are of different documents. |
Both Documents do not belong to the same person. |
Front and backside images of the document did not match, please upload images of the same document. |
Camera is not accessible for verification. |
Document proof is a screenshot. |
Document proof is altered/edited. |
Document proof is paper based which is not accepted. |
Document proof is punched/broken. |
Document proof is from another screen. |
Hologram is missing on the document. |
Document proof is not fully displayed. |
Document is blur. |
Front and backside images are not of the same document. |
Uploaded document is Black and White. |
Uploaded image of the document is edited or cropped. |
Uploaded image is found on the internet. |
Document is laminated. |
Document is scanned or colored copy. |
Document is paper-based or laminated. |
Uploaded document is a test card. |
Entire document is not visible. |
Uploaded document of the image is blur. |
The uploaded document doesn't match with the mentioned document type. |
Uploaded front side and backside are of different documents. |
Uploaded document is laminated. |
Document might be broken, damaged, or punched. |
Uploaded image of the document is a screenshot. |
Document is captured from another device. |
Document is paperbased or laminated. |
Uploaded image of the document is found on internet. |
Uploaded image is a test card. |
Uploaded document is black and white. |
Document is not found in the uploaded image. |
Data Verification Issues
Declined Reasons |
---|
Gender could not be verified. |
Place of issue could not be verified. |
Information on the document proof is not visible. |
Information on the document is edited. |
Information on the document is hidden. |
Proof and additional proof does not belong to the same person. |
Both documents should belong to the same person. |
Document should be from the provided country |
Date of Birth on the document is not clearly visible. |
Name on the document is not clearly visible. |
Document number is not clearly visible. |
Original document number could not be authenticated. |
E-document data does not match with provided document proof. |
Face on the E-document does not match with selfie. |
Picture on the document is not updated. |
The uploaded document is not matched with the mentioned document type. |
Uploaded document is expired. |
The issuing country of document is not supported. |
Gender is not mentioned in the uploaded document. |
Gender is unclear in the uploaded document. |
The Uploaded documents have different names. |
Information on the document is not readable. |
Issuing date of the document is not visible. |
Expire date is not found on the uploaded document. |
Expiry date of the document is not found. |
Name is not found on the uploaded document. |
Expire date of the uploaded document is not visible. |
Name in the uploaded document is not visible. |
Name is not found on the document. |
The document number on the document is invalid. |
Face On Document Issues
Declined Reasons |
---|
Face in the image is with wearing glasses. |
More than one face in one image. |
Face image doesn't match with the face on document. |
The uploaded face picture is blur and not clearly visible. |
The uploaded face picture does not match the face photo on the provided document. |
The face picture on the provided document is not clearly visible. |
Face in provided document is edited. |
Document Editing and Manipulation
Declined Reasons |
---|
Font in provided document is edited. |
Background in provided document is edited. |
Text in provided document is edited. |
MRZ in provided document is edited. |
Provided document is edited via applying filters. |
The provided document is edited. |
Additional Verification Issues
Declined Reasons |
---|
Nationality could not be verified. |
The provided document is broken. |
The provided document is photocopy(color or black & white). |
The provided document is scanned. |
The provided document is punched. |
The provided document is cracked. |
The provided document is cropped. |
The provided document is handwritten. |
Document does not belong to GCC countries. |
Document type is not supported. |
Document type is not allowed. |
MRZ not detected on the document. |
Document is not visible or present in the proof. |
Student card is not acceptable. |
Dual cards detected. |
The uploaded document is not supported. |
The uploaded document is inverted or in mirror view. |
The uploaded document is broken with affected data. |
The gender on the document is not clearly visible. |
The issue date on document is not present. |
The date of birth on document is not clearly visible. |
The nationality on the document is not clearly visible. |
The nationality on the document is not mentioned. |
The expiry date on document is not present. |
The name on document is not present. |
The date of birth on document is not present. |
The provided image is corrupted. |
Frontside of the document is not displayed. |
Backside of the document is not displayed. |
User Interaction Issues
Declined Reasons |
---|
The verification process was canceled by the user. |
End user did not submit complete verification proofs or data. |
Face could not be detected OR same side of the document is provided. |
The user does not want to share camera or documents. |
The complete verification data was not provided by the user. |
The proof has been uploaded and not captured in real time. |
Security and Fraud Detection
Declined Reasons |
---|
Document proofs do not belong to the same person. |
Document Proof inconsistent creation and modification dates found. |