> ## Documentation Index
> Fetch the complete documentation index at: https://www.cashfree.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Face Match

> Use this API to match the facial features of your customer in one image with another. You can compare an image with another image or with an image in an ID.

View the [test data](https://www.cashfree.com/docs/api-reference/vrs/data-to-test-integration#face-match) and use the information to trigger the validations. The test data can be used only in the sandbox environment.



## OpenAPI

````yaml post /face-match
openapi: 3.0.0
info:
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  contact:
    email: developers@cashfree.com
    name: API Support
    url: https://discord.com/invite/QdZkNSxXsB
  title: Cashfree Verification API's.
  version: '2023-12-18'
  description: >-
    Cashfree's Verification APIs provide different types of verification to our
    merchants.
servers:
  - description: Sandbox Server
    url: https://sandbox.cashfree.com/verification
  - description: Production Server
    url: https://api.cashfree.com/verification
security: []
tags:
  - name: Aadhaar
    description: Operations related to Aadhaar verification.
  - name: BAV V2
    description: Operations related to Bank account verification v2.
  - name: PAN
    description: Operations related to PAN verification.
  - name: Digilocker
    description: Operations related to Digilocker verification.
  - name: E-sign
    description: Operations related to E-sign verification.
  - name: Reverse Penny Drop
    description: Operations related to Reverse Penny Drop verification.
  - name: UPI Penny Drop
    description: Operations related to UPI Penny Drop verification.
  - name: Mobile Penny Drop
    description: Operations related to Mobile Penny Drop verification.
  - name: IP
    description: Operation related to IP verification.
  - name: UPI
    description: Operations related to UPI verification.
  - name: Passport
    description: Operation related to Passport verification.
  - name: CIN
    description: Operation related to CIN verification.
  - name: Name Match
    description: Operation related to Name Match verification.
  - name: PAN to GSTIN
    description: Operation related to PAN to GSTIN.
  - name: Face Match
    description: Operation related to Face Match verification.
  - name: Voter ID
    description: Operation related to Voter ID verification.
  - name: Reverse Geocoding
    description: Operation related to Reverse Geocoding.
  - name: Vehicle RC
    description: Operation related to Vehicle RC verification.
  - name: Driving License
    description: Operation related to Driving License verification.
  - name: GSTIN
    description: Operation related to GSTIN verification.
  - name: Account Aggregator
    description: Operations related to Account aggregator.
  - name: OTPLess
    description: Operations related to OTPLess Verification.
  - name: 1-Click
    description: Operations related to 1-Click.
  - name: Smart OCR
    description: Operations related to Smart OCR.
  - name: Geocoding
    description: Operations related to Geocoding.
  - name: Udyam
    description: Operation related to Udyam verification.
  - name: PAN to Udyam
    description: Operation related to PAN to Udyam.
paths:
  /face-match:
    post:
      tags:
        - Face Match
      summary: Face Match
      description: >-
        Use this API to match the facial features of your customer in one image
        with another. You can compare an image with another image or with an
        image in an ID.


        View the [test
        data](https://www.cashfree.com/docs/api-reference/vrs/data-to-test-integration#face-match)
        and use the information to trigger the validations. The test data can be
        used only in the sandbox environment.
      operationId: VrsFaceMatchVerification
      parameters:
        - $ref: '#/components/parameters/x_cf_signature'
      requestBody:
        description: >-
          Find the request parameters to verify and compare facial features of
          your customer in two images.
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - first_image
                - verification_id
                - second_image
              example:
                verification_id: test_verification_id
                first_image: <image_file>
                second_image: <image_file>
                threshold: '0.75'
              properties:
                verification_id:
                  description: >-
                    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.
                  type: string
                  example: '12345678'
                  default: '12345678'
                first_image:
                  description: >-
                    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.
                  type: string
                  format: binary
                  example: FIRST_IMAGE
                second_image:
                  description: >-
                    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.
                  type: string
                  format: binary
                  example: SECOND_IMAGE
                threshold:
                  description: >-
                    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`
                  type: string
                  example: '0.5'
                  default: '0.75'
      responses:
        '200':
          $ref: '#/components/responses/FaceMatchSuccessResponse'
        '400':
          $ref: '#/components/responses/Response400FaceMatch'
        '401':
          $ref: '#/components/responses/Response401'
        '403':
          $ref: '#/components/responses/Response403'
        '409':
          $ref: '#/components/responses/Response409DuplicateId'
        '422':
          $ref: '#/components/responses/Response422'
        '429':
          $ref: '#/components/responses/Response429'
        '500':
          $ref: '#/components/responses/Response500V2'
        '502':
          $ref: '#/components/responses/Response502V2'
      security:
        - XClientID: []
          XClientSecret: []
components:
  parameters:
    x_cf_signature:
      description: >-
        Send the signature if two-factor authentication is selected as Public
        Key.  [More
        details](https://www.cashfree.com/docs/api-reference/vrs/getting-started#2fa-api-signature-generation).
      name: x-cf-signature
      in: header
      required: false
      schema:
        type: string
      example: ''
  responses:
    FaceMatchSuccessResponse:
      description: >-
        Success response for verifying facial features of your customer in two
        images.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FaceMatchResponseSchema'
          examples:
            Positive face match:
              value:
                status: SUCCESS
                ref_id: 21637861
                verification_id: '21637861'
                face_match_result: 'YES'
                face_match_score: 0.95
            Negative face match:
              value:
                status: SUCCESS
                ref_id: 21637861
                verification_id: '21637861'
                face_match_result: 'NO'
                face_match_score: 0.1
            Multiple face detected:
              value:
                status: MULTIPLE_FACE_DETECTED
                ref_id: 21637861
                verification_id: '21637861'
                face_match_result: 'NO'
                face_match_score: 0
    Response400FaceMatch:
      description: Validation errors for Face Match API.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            File size exceeded:
              $ref: '#/components/examples/FileSizeExceeded'
            Invalid file format:
              $ref: '#/components/examples/InvalidFileFormatImage'
            First image is not uploaded:
              $ref: '#/components/examples/FirstImageIsNotUploaded'
            Second image is not uploaded:
              $ref: '#/components/examples/SecondImageIsNotUploaded'
            Verifcation Id character limit exceeded:
              $ref: '#/components/examples/VerificationIDCharacterLimitExceeded'
            Invalid Verification ID:
              $ref: '#/components/examples/InvalidVerificationId'
            Client ID/Client Secret Missing:
              $ref: '#/components/examples/XClientIdMissing'
            Using-Test-Credentials-in-Prod:
              $ref: '#/components/examples/UsingTestCredentialsInProd'
    Response401:
      description: Invalid client ID and client secret combination.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Invalid client ID and client secret combination:
              value:
                type: authentication_error
                code: authentication_failed
                message: Invalid clientId and clientSecret combination
    Response403:
      description: Authentication error (IP not whitelisted).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            IP not whitelisted:
              value:
                type: authentication_error
                code: ip_validation_failed
                message: >-
                  IP not whitelisted your current ip is 106.51.91.104.For IP
                  whitelisting assistance, visit our guide at
                  https://www.cashfree.com/docs/secure-id/get-started/integration/ip-whitelisting-verification
            x-cf-signature header missing:
              value:
                type: validation_error
                code: authentication_failed
                message: x-cf-signature missing in the request header
    Response409DuplicateId:
      description: Conflict error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Conflict Error:
              value:
                type: validation_error
                code: verification_id_already_exists
                message: verification ID already exists
    Response422:
      description: >-
        Validation error because of insufficient balance to process this
        request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Insufficient balance:
              value:
                type: validation_error
                code: insufficient_balance
                message: Insufficient balance to process this request
    Response429:
      description: Rate limit exceed error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Rate limit error per operation:
              value:
                type: rate_limit_error
                code: too_many_requests_per_operation
                message: Too many requests for this operation, rate limit reached
            Rate limit error per IP:
              value:
                type: rate_limit_error
                code: too_many_requests_per_ip
                message: Too many requests from the IP, rate limit reached
    Response500V2:
      description: Internal error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Internal Server Error:
              value:
                type: internal_error
                code: verification_failed
                message: something went wrong
    Response502V2:
      description: Gateway error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Bad Gateway:
              value:
                type: internal_error
                code: verification_failed
                message: verification attempt failed
  schemas:
    FaceMatchResponseSchema:
      type: object
      properties:
        status:
          type: string
          description: >-
            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:
          type: integer
          description: >-
            It displays the unique ID created by Cashfree Payments for reference
            purposes.

            format: `int64`
          example: 2000
        verification_id:
          type: string
          description: It displays the unique ID you created to identify the API request.
          example: '2000'
        face_match_result:
          type: string
          description: >-
            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:
          type: number
          description: |-
            It displays the score of the face match verification request.
            Range: `0 < x < 1`
          example: 0.8
    ErrorResponseSchema:
      type: object
      properties:
        code:
          type: string
          example: x-client-id_missing
        error:
          type: object
          example:
            ref_id: 102
        message:
          type: string
          example: x-client-id is missing in the request.
          description: It displays the outcome of the error.
        type:
          type: string
          example: validation_error
          description: It displays the type of error.
  examples:
    FileSizeExceeded:
      value:
        type: validation_error
        code: file_size_exceeded
        message: File size exceeded 10MB limit
    InvalidFileFormatImage:
      value:
        type: validation_error
        code: file_format_invalid
        message: please upload the file of valid format(jpeg/jpg/png)
    FirstImageIsNotUploaded:
      value:
        type: validation_error
        code: first_image_missing
        message: First image is missing in the request
    SecondImageIsNotUploaded:
      value:
        type: validation_error
        code: second_image_missing
        message: Second image is missing in the request
    VerificationIDCharacterLimitExceeded:
      value:
        type: validation_error
        code: verification_id_length_exceeded
        message: verification_id can include a maximum of 50 characters.
    InvalidVerificationId:
      value:
        type: validation_error
        code: verification_id_value_invalid
        message: verification_id can include only alphanum, dot, hyphen and underscores
    XClientIdMissing:
      value:
        type: validation_error
        code: x-client-id_missing
        message: x-client-id is missing in the request.
    UsingTestCredentialsInProd:
      value:
        type: validation_error
        code: x-client-secret_value_invalid
        message: Client secret belongs to test environment
  securitySchemes:
    XClientID:
      type: apiKey
      in: header
      name: x-client-id
      description: >-
        Your unique client identifier issued by Cashfree. You can find this in
        your [Merchant
        Dashboard](https://merchant.cashfree.com/verificationsuite/developers/api-keys).
    XClientSecret:
      type: apiKey
      in: header
      name: x-client-secret
      description: >-
        The secret key associated with your client ID. Use this to authenticate
        your API requests. You can find this in your [Merchant
        Dashboard](https://merchant.cashfree.com/verificationsuite/developers/api-keys).

````