Skip to main content
POST
/
face-match
Face Match
curl --request POST \
  --url https://sandbox.cashfree.com/verification/face-match \
  --header 'Content-Type: multipart/form-data' \
  --header 'x-client-id: <api-key>' \
  --header 'x-client-secret: <api-key>' \
  --form verification_id=test_verification_id \
  --form first_image=@example-file \
  --form second_image=@example-file \
  --form threshold=0.75
{
"status": "SUCCESS",
"ref_id": 21637861,
"verification_id": "21637861",
"face_match_result": "YES",
"face_match_score": 0.95
}

Authorizations

x-client-id
string
header
required

Your unique client identifier issued by Cashfree. You can find this in your Merchant Dashboard.

x-client-secret
string
header
required

The secret key associated with your client ID. Use this to authenticate your API requests. You can find this in your Merchant Dashboard.

Headers

x-cf-signature
string

Send the signature if two-factor authentication is selected as Public Key. More details

Body

multipart/form-data

Find the request parameters to verify and compare facial features of your customer in two images

verification_id
string
default:12345678
required

It is the unique ID you need to create to identify the verification request. The maximum character limit is 50, and only alphanumeric characters, periods (.), hyphens (-), and underscores (_) are allowed.

Example:

"12345678"

first_image
file
required

It is the scanned copy of Image 1. Allowed file types are JPEG, JPG, and PNG, with a maximum file size of 5 MB for each file.

second_image
file
required

It is the scanned copy of Image 2. Allowed file types are JPEG, JPG, and PNG, with a maximum file size of 5 MB for each file.

threshold
string
default:0.75

It is the value to distinguish and match the facial features of the two images. The range is between 0 and 1. The default value is set as 0.75. We conclude that the images match when the analysis is or greater than the value set for threshold. Range: 0 < x < 1

Example:

"0.5"

Response

Success response for verifying facial features of your customer in two images

status
string

It displays the status of the API request. Possible values are:

  • SUCCESS: A successful face match returns all fields in the response.
  • MULTIPLE_FACE_DETECTED: Indicates that multiple faces were detected in one or both of the input images.
Example:

"SUCCESS"

ref_id
integer

It displays the unique ID created by Cashfree Payments for reference purposes. format: int64

Example:

2000

verification_id
string

It displays the unique ID you created to identify the API request.

Example:

"2000"

face_match_result
string

It displays the result of the face match verification request. Possible values are:

  • YES: The face match is positive i.e. the given 2 photos match.
  • NO: The face match is negative i.e. the given 2 photos don't match.
Example:

"YES/NO"

face_match_score
number

It displays the score of the face match verification request. Range: 0 < x < 1

Example:

0.8