> ## 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.

# Get Document

> Use this API to get your customer's document details from from DigiLocker after successful grant of consent.

<Note>Currently we do not support downloading of full documents through Digilocker API. This feature will be added in the future enhancements.</Note>


## OpenAPI

````yaml get /digilocker/document/{document_type}
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:
  /digilocker/document/{document_type}:
    get:
      tags:
        - Digilocker
      summary: Get Document
      description: >-
        Use this API to get your customer's document details from from
        DigiLocker after successful grant of consent.
      operationId: VrsDigilockerVerificationFetchDocument
      parameters:
        - $ref: '#/components/parameters/x_cf_signature'
        - name: document_type
          in: path
          description: It is the type of document to be verified.
          required: true
          schema:
            type: string
            enum:
              - AADHAAR
              - PAN
              - DRIVING_LICENSE
          example: AADHAAR
        - name: reference_id
          in: query
          description: >-
            It is the unique ID created by Cashfree Payments that you receive in
            the response of Create DigiLocker URL API.

            format: `int64`
          example: 12345
          schema:
            type: integer
        - name: verification_id
          in: query
          description: >-
            It is the unique ID you created to identify the Create DigiLocker
            URL API request.
          example: ABC00123
          schema:
            type: string
      responses:
        '200':
          $ref: '#/components/responses/DigiLockerVerificationGetDocumentResponse'
        '202':
          $ref: '#/components/responses/202'
        '400':
          $ref: '#/components/responses/Response400DigiLockerVerificationGetDocument'
        '401':
          $ref: '#/components/responses/Response401'
        '403':
          $ref: '#/components/responses/Response403'
        '404':
          $ref: '#/components/responses/Response404DigiLockerResponse'
        '422':
          $ref: '#/components/responses/Response422'
        '429':
          $ref: '#/components/responses/Response429'
        '500':
          $ref: '#/components/responses/Response500V2'
        '502':
          $ref: '#/components/responses/Response502V2AuthorizedSourceDown'
      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:
    '202':
      description: Validation in pending state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Validation Pending:
              value:
                type: validation_error
                code: validation_pending
                message: Validation in process check after some time
    DigiLockerVerificationGetDocumentResponse:
      description: Success response for retrieving the document from DigiLocker.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: >-
                  #/components/schemas/DigiLockerVerificationGetAadhaarDocumentResponseSchema
              - $ref: >-
                  #/components/schemas/DigiLockerVerificationGetPanDocumentResponseSchema
              - $ref: >-
                  #/components/schemas/DigiLockerVerificationGetDLDocumentResponseSchema
          examples:
            Aadhaar:
              value:
                reference_id: 408
                verification_id: test001
                status: SUCCESS
                uid: xxxxxxxx5647
                care_of: 'S/O: Fakkirappa Dollin'
                dob: 02-02-1995
                gender: M
                name: Mallesh Fakkirappa Dollin
                photo_link: /9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHB
                split_address:
                  country: India
                  dist: Haveri
                  house: Shri Kanaka Nilaya
                  landmark: ''
                  pincode: '581115'
                  po: Ranebennur
                  state: Karnataka
                  street: Umashankar Nagar 1st Main 5th Cross
                  subdist: Ranibennur
                  vtc: Ranibennur
                year_of_birth: 2000
                xml_file: <xml file link with 48hrs expiry>
                message: Aadhaar Card Exists
            Aadhaar Not Linked:
              value:
                reference_id: 408
                verification_id: test001
                status: AADHAAR_NOT_LINKED
                care_of: null
                dob: null
                gender: null
                name: null
                photo_link: null
                split_address:
                  country: null
                  dist: null
                  house: null
                  landmark: null
                  pincode: null
                  po: null
                  state: null
                  street: null
                  subdist: null
                  vtc: null
                uid: null
            Pan:
              value:
                reference_id: 408
                verification_id: test001
                status: SUCCESS
                pan: ABCPV1234D
                type: Individual
                dob: 02-02-1995
                name_pan_card: JOHN SNOW
                gender: Male
                xml_file: <xml file link with 48hrs expiry>
            Driving License:
              value:
                reference_id: 408
                verification_id: test001
                status: SUCCESS
                dl_number: KA51201900089895
                issued_at: RTO,RAIPUR RTO
                categories:
                  - class_of_vehicle: MCWG
                    description: Motor Cycle with Gear(Non Transport).
                    issue_date: 03-11-2022
                issue_date: 03-11-2022
                expiry_date: 16-09-2039
                name: JOHN DOE
                dob: 02-02-1994
                care_of: JOHN SNOW
                present_address: >-
                  FLAT NO D-901 SUN,BELLANDUR, BANGALORE SOUTH,BANGALORE,KA
                  560103
                permanent_address: >-
                  FLAT NO D-901 SUN,BELLANDUR, BANGALORE SOUTH,BANGALORE,KA
                  560103
                gender: Male
                photo_link: /9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHB
                xml_file: <xml file link with 48hrs expiry>
    Response400DigiLockerVerificationGetDocument:
      description: Validation errors for Get DigiLocker Document API.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Request Params Missing:
              $ref: '#/components/examples/RequestParamsMissing'
            Invalid Document_Type field:
              $ref: '#/components/examples/InvalidDocument_TypeField'
            DigiLocker Url Expired:
              $ref: '#/components/examples/DigiLockerUrlExpired'
            DigiLocker Session Expired:
              $ref: '#/components/examples/DigiLockerSessionExpired'
            DigiLocker Consent Not Granted:
              $ref: '#/components/examples/DigiLockerConsentNotGranted'
            User Detail Mismatch:
              $ref: '#/components/examples/UserDetailMismatch'
            Client ID/Client Secret in 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
    Response404DigiLockerResponse:
      description: Not found errors when IDs don't exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Validation Id not Found:
              value:
                type: not_found_error
                code: verification_id_value_invalid
                message: Please enter a valid verification_id
            Reference Id not Found:
              value:
                type: not_found_error
                code: reference_id_value_invalid
                message: Please enter a valid reference_id
    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
    Response502V2AuthorizedSourceDown:
      description: Gateway error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Bad Gateway:
              value:
                type: internal_error
                code: verification_failed
                message: >-
                  Authorised source is temporarily unavailable, please try again
                  shortly
  schemas:
    DigiLockerVerificationGetAadhaarDocumentResponseSchema:
      type: object
      properties:
        care_of:
          type: string
          description: It displays the name of the parent or guardian.
          example: John Snow
        dob:
          type: string
          description: It displays the date of birth of the individual.
          example: 02-02-1995
        gender:
          type: string
          description: It displays the gender of the individual.
          example: M
        name:
          type: string
          description: It displays the name of the individual.
          example: John Doe
        year_of_birth:
          type: integer
          description: It displays the year of birth of the individual.
          example: 2000
        photo_link:
          type: string
          description: >-
            It displays the Base64-encoded image of the individual whose
            document is to be retrieved.
          example: PHOTO_LINK
        message:
          type: string
          description: It displays details about the success or failure of the API request.
          example: Aadhaar Card Exists
        reference_id:
          type: integer
          description: >-
            It displays the unique ID created by Cashfree Payments for reference
            purposes.

            format: `int64`
          example: 1234
        status:
          type: string
          description: >-
            It displays the status of the aadhaar document fetch. Possible
            values are:
              - `SUCCESS`: Aadhaar successfully fetched
              - `AADHAAR_NOT_LINKED`: Aadhaar not linked
          example: SUCCESS
        split_address:
          type: object
          description: It contains the address information in individual components.
          properties:
            country:
              type: string
              description: It displays the name of the country as present in the document.
              example: India
            dist:
              type: string
              description: It displays the name of the district as present in the document.
              example: Haveri
            house:
              type: string
              description: It displays the name of the house as present in the document.
              example: House
            landmark:
              type: string
              description: It displays the name of the landmark as present in the document.
              example: Landmark
            pincode:
              type: string
              description: It displays the PIN code as present in the document.
              example: '560103'
            po:
              type: string
              description: >-
                It displays the name of the post office as present in the
                document.
              example: Post Office
            state:
              type: string
              description: It displays the name of the state as present in the document.
              example: State
            street:
              type: string
              description: It displays the name of the street as present in the document.
              example: Street
            subdist:
              type: string
              description: >-
                It displays the name of the sub district as present in the
                document.
              example: SubDist
            vtc:
              type: string
              description: >-
                It displays the name of the VTC (village, town, city) as present
                in the address.
              example: Vtc
          example:
            country: India
            dist: Haveri
            house: House
            landmark: Landmark
            pincode: '581112'
            po: Post Office
            state: State
            street: Street
            subdist: SubDist
            vtc: Vtc
        uid:
          type: string
          description: >-
            It displays the unique number assigned to the individual when
            applying for the aadhaar card.
          example: xxxxxxxx5678
        verification_id:
          type: string
          description: >-
            It displays the unique ID you created to identify the verification
            request.
          example: ABC00123
        xml_file:
          type: string
          description: >-
            It is the link which points to the zip file containing the XML file
            and has 48 hrs expiry.
          example: https://abc.xyz
    DigiLockerVerificationGetPanDocumentResponseSchema:
      type: object
      properties:
        reference_id:
          type: integer
          description: >-
            It displays the unique ID created by Cashfree Payments for reference
            purposes.

            format: `int64`
          example: 1234
        verification_id:
          type: string
          description: >-
            It displays the unique ID you created to identify the verification
            request.
          example: ABC00123
        status:
          type: string
          description: >-
            It displays the status of the pan document fetch. Possible values
            are:
              - `SUCCESS`: Pan successfully fetched.
          example: SUCCESS
        pan:
          type: string
          example: ABCPV1234D
          description: >-
            It displays the unique 10-character alphanumeric identifier issued
            by the Income Tax Department.
        type:
          type: string
          description: It displays the type of the PAN issued.
          example: Individual
        dob:
          type: string
          description: It displays the date of birth of the individual.
          example: 02-02-1995
        name_pan_card:
          type: string
          description: It displays the name displayed on the PAN card.
          example: JOHN DOE
        gender:
          type: string
          description: It displays the gender of the individual.
          example: Male
        xml_file:
          type: string
          description: >-
            It is the link which points to the zip file which contains the XML
            file and has 48 hrs expiry.
          example: https://abc.xyz
    DigiLockerVerificationGetDLDocumentResponseSchema:
      type: object
      properties:
        reference_id:
          type: integer
          description: >-
            It displays the unique ID created by Cashfree Payments for reference
            purposes.

            format: `int64`
          example: 1234
        verification_id:
          type: string
          description: >-
            It displays the unique ID you created to identify the verification
            request.
          example: ABC00123
        status:
          type: string
          description: >-
            It displays the status of the driving license document fetch.
            Possible values are:
              - `SUCCESS`: Driving License successfully fetched
          example: SUCCESS
        dl_number:
          description: It is the driving licence number of the individual.
          type: string
          example: KA0120198900984
        issued_at:
          type: string
          description: It displays the place where a driving license is issued.
        issue_date:
          type: string
          description: It displays the issue date of driving license.
          example: 03-11-2022
        categories:
          type: object
          properties:
            categories:
              type: array
              description: List of vehicle categories associated with the individual.
              items:
                type: object
                properties:
                  class_of_vehicle:
                    type: string
                    description: Type of vehicle category.
                    example: MCWG
                  description:
                    type: string
                    description: Description of the vehicle category.
                    example: Motor Cycle with Gear(Non Transport)
                  issue_date:
                    type: string
                    format: date
                    description: Date when the vehicle category was issued.
                    example: 03-11-2022
        expiry_date:
          type: string
          description: It displays the date until which the driving license is valid.
          example: 16-09-2039
        name:
          type: string
          description: It displays the name of the individual.
          example: John Doe
        dob:
          type: string
          description: It displays the date of birth of the individual.
          example: 02-02-1995
        care_of:
          type: string
          description: It displays the name of the parent or guardian.
          example: John Snow
        present_address:
          type: string
          description: It displays the current address of the owner of the vehicle.
          example: >-
            FLAT # 901 A BLOCK GOYAL ORCHID, LAKE VIEW APTS KARIAGRAHARA,
            BELLANDUR, Bangalore, Karnataka, 560103
        permanent_address:
          type: string
          description: It displays the permanent address of the owner of the vehicle.
          example: >-
            FLAT # 901 A BLOCK GOYAL ORCHID, LAKE VIEW APTS KARIAGRAHARA,
            BELLANDUR, Bangalore, Karnataka, 560103
        gender:
          type: string
          description: It displays the gender of the individual.
          example: Male
        photo_link:
          type: string
          description: >-
            It displays the link to the photo of the individual present in the
            document.
          example: PHOTO_LINK
        xml_file:
          type: string
          description: >-
            It is the link which points to the zip file which contains the XML
            file and has 48 hrs expiry.
          example: https://abc.xyz
    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:
    RequestParamsMissing:
      value:
        type: validation_error
        code: invalid_request
        message: Please provide verification_id or reference_id
    InvalidDocument_TypeField:
      value:
        type: validation_error
        code: document_type_value_invalid
        message: document_type should be AADHAAR.
    DigiLockerUrlExpired:
      value:
        type: validation_error
        code: url_expired
        message: Digilocker request URL is expired
    DigiLockerSessionExpired:
      value:
        type: validation_error
        code: session_expired
        message: Digilocker consent session expired
    DigiLockerConsentNotGranted:
      value:
        type: validation_error
        code: consent_not_granted
        message: Consent not provided for document
    UserDetailMismatch:
      value:
        type: validation_error
        code: user_detail_mismatch
        message: PAN card name of the user doesn't match with that in Aadhaar card
    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).

````