Face Comparison

Instantpay's Face Compare API reliably verifies identity. It does this by comparing two facial images for similarity. This API uses advanced facial recognition tech. It gives a confidence score and threshold value. Businesses can use them to see if the images are of the same person.

The Face Compare API boosts security and matches identities. It suits many uses, from user authentication to fraud prevention. Integrating this tool will help businesses verify identities. It will also build trust with a precise, data-driven method.

Header Parameters

NameTypeDescriptionMandatory (M) , Optional (O)Provided by INSTANTPAY (Y/N)
X-Ipay-Auth-CodeStringAuth Code:1 (Fixed)MY
X-Ipay-Client-IdStringUnique Client IDMY
X-Ipay-Client-SecretStringUnique secret keyMY
X-Ipay-Endpoint-IpStringEnd Customer IP AddressMN

Request Parameters

This example requests information about matching faces in source and target images that are loaded from the local file system.

NameTypeMandatory (M) , Optional (O)Description
sourceImagemultipart/form-dataMUpload single source image. It must be .jpeg or .png and no larger than 5mb.
targetImagemultipart/form-dataMUpload single target image. It must be .jpeg or .png and no larger than 5mb.
latitudeStringMCurrent location latitude
longitudeStringMCurrent location longitude
externalRefStringMYour Unique Transaction Id

Sample Request

curl --location 'https://api.instantpay.in/identity/faceComparison' \
--header 'X-Ipay-Auth-Code: {{authCode}}' \
--header 'X-Ipay-Client-Id: {{clientId}}' \
--header 'X-Ipay-Client-Secret: {{clientSecret}}' \
--header 'X-Ipay-Endpoint-Ip: {{endPointIP}}' \
--form 'sourceImage=@"/Users/User_name/Downloads/download (1).jpeg"' \
--form 'targetImage=@"/Users/User_name/Downloads/download (2).jpeg"' \
--form 'latitude="12.1234"' \
--form 'longitude="75.1234"' \
--form 'externalRef="1709628696"'
POST /identity/faceComparison HTTP/1.1
Host: api.instantpay.in
X-Ipay-Auth-Code: {{authCode}}
X-Ipay-Client-Id: {{clientId}}
X-Ipay-Client-Secret: {{clientSecret}}
X-Ipay-Endpoint-Ip: {{endPointIP}}
Content-Length: 648
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="sourceImage"; filename="download (1).jpeg"
Content-Type: image/jpeg

(data)
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="targetImage"; filename="download (2).jpeg"
Content-Type: image/jpeg

(data)
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="latitude"

12.1234
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="longitude"

75.1234
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="externalRef"

1709628675
------WebKitFormBoundary7MA4YWxkTrZu0gW--

Response Parameters

NameTypeDescription
statuscodeStringInstantPay Status Code
actcodeStringAction Code
statusStringStatus message
dataArrayResponse Data (If Present)
timestampStringCurrent time (YYYY-MM-DD HH:II:SS)
ipay_uuidStringRequest reference number
orderidStringTransaction Id ( If transaction otherwise it is null )
environmentStringLive/Sandbox

📘

Note :

  • externalRef must be unique and in alpha numeric characters.
  • Click here for guidelines for entering data in latitude/ longitude parameter.

Sample Response

{
    "statuscode": "TXN",
    "actcode": null,
    "status": "Sucesses",
    "data": {
        "faceCompareResult": {
            "faceMatches": [
                {
                    "Similarity": 99.942138671875,
                    "Face": {
                        "BoundingBox": {
                            "Width": 0.47787919640541077,
                            "Height": 0.36140406131744385,
                            "Left": 0.354006826877594,
                            "Top": 0.32657408714294434
                        },
                        "Confidence": 99.99774932861328,
                        "Landmarks": [
                            {
                                "Type": "eyeLeft",
                                "X": 0.5139376521110535,
                                "Y": 0.4526228904724121
                            },
                            {
                                "Type": "eyeRight",
                                "X": 0.710635781288147,
                                "Y": 0.47408267855644226
                            },
                            {
                                "Type": "mouthLeft",
                                "X": 0.49215957522392273,
                                "Y": 0.5892491936683655
                            },
                            {
                                "Type": "mouthRight",
                                "X": 0.6558822393417358,
                                "Y": 0.606961190700531
                            },
                            {
                                "Type": "nose",
                                "X": 0.6081581115722656,
                                "Y": 0.5351571440696716
                            }
                        ],
                        "Pose": {
                            "Roll": 10.587671279907227,
                            "Yaw": 6.88578462600708,
                            "Pitch": 4.731213569641113
                        },
                        "Quality": {
                            "Brightness": 71.47499084472656,
                            "Sharpness": 83.14741516113281
                        }
                    }
                }
            ],
            "unmatchesFaces": [],
            "sourceImage": {
                "BoundingBox": {
                    "Width": 0.3474130630493164,
                    "Height": 0.36589315533638,
                    "Left": 0.30312424898147583,
                    "Top": 0.15900658071041107
                },
                "Confidence": 99.9916763305664
            }
        },
        "pool": {
            "referenceId": "1240305123729RREDB",
            "openingBalance": "25.10",
            "paymentAmount": "0.00",
            "mode": "DR",
            "closingBalance": "25.10"
        }
    },
    "timestamp": "2024-03-05 12:37:29",
    "ipay_uuid": "h0069b7d3fe0-d39f-4fda-ac4e-c4f525e0efa2-ibHYnAsxQdYO",
    "orderid": "1240305123729RREDB",
    "environment": "LIVE",
    "internalCode": null
}
Language
Click Try It! to start a request and see the response here!