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

# Geocoding

> Use this API to convert a physical address into geographic coordinates (latitude and longitude). This helps verify location accuracy, enable map integrations, calculate distances, and support location-based services.

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



## OpenAPI

````yaml post /geocoding
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:
  /geocoding:
    post:
      tags:
        - Geocoding
      summary: Geocoding
      description: >-
        Use this API to convert a physical address into geographic coordinates
        (latitude and longitude). This helps verify location accuracy, enable
        map integrations, calculate distances, and support location-based
        services.


        View the [test
        data](https://www.cashfree.com/docs/api-reference/vrs/data-to-test-integration#geocoding)
        and use the information to trigger the validations. The test data can be
        used only in the sandbox environment.
      operationId: VrsGeocoding
      parameters:
        - $ref: '#/components/parameters/global_x_api_version'
      requestBody:
        $ref: '#/components/requestBodies/GeocodingRequestBody'
      responses:
        '200':
          $ref: '#/components/responses/GeocodingResponse'
        '400':
          $ref: '#/components/responses/400Geocoding'
        '403':
          $ref: '#/components/responses/Response403'
        '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:
    global_x_api_version:
      description: API version to be used. Format is in YYYY-MM-DD.
      name: x-api-version
      in: header
      required: true
      schema:
        type: string
        default: '2024-12-01'
        example: '2024-12-01'
      example: '2024-12-01'
  requestBodies:
    GeocodingRequestBody:
      description: Find the request parameters to Access Token Generation.
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GeocodingRequestSchema'
  responses:
    GeocodingResponse:
      description: Response for geocoding API.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GeocodingResponseSchema'
          examples:
            VALID:
              value:
                reference_id: 123456
                verification_id: testVerificationId
                address: 123 Main Street, Koramangala, Bangalore
                status: VALID
                latitude: '37.7749'
                longitude: '-122.4194'
                geo_latitude: '37.7749'
                geo_longitude: '-122.4194'
                geo_country_code: IN
                city: Bangalore
                state: Karnataka
                state_code: KA
                country: India
                country_code: IN
                pincode: '560034'
                distance_in_kms: '0.5'
            INVALID:
              value:
                reference_id: 123457
                verification_id: testVerificationId2
                address: AAA BBB CCC
                status: INVALID
                latitude: null
                longitude: null
                geo_latitude: null
                geo_longitude: null
                geo_country_code: null
                city: null
                state: null
                state_code: null
                country: null
                country_code: null
                pincode: null
                distance_in_kms: null
    400Geocoding:
      description: Validation Errors Geocoding.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Address Missing:
              value:
                type: validation_error
                code: address_missing
                message: address is missing in the request.
            Invalid Address:
              value:
                type: validation_error
                code: address_value_invalid
                message: address should be valid.
            x-api-version Missing:
              value:
                type: validation_error
                code: address_value_invalid
                message: address should be valid.
    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
    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:
    GeocodingRequestSchema:
      type: object
      required:
        - address
        - verification_id
      properties:
        verification_id:
          type: string
          description: >-
            It displays the unique ID you created to identify the verification
            request.
          example: test_verification_id
        address:
          type: string
          example: 123 ABC Apartment,Bangalore Karnataka - 560034
          description: The full address for which coordinates are needed.
        country_code:
          type: string
          description: >-
            It is the country code used for more accurate latitude and longitude
            results.
          example: IN
        latitude:
          type: string
          description: Latitude to calculate distance from.
          example: '12.9274477'
        longitude:
          type: string
          example: '77.6326542'
          description: Longitude to calculate distance from.
    GeocodingResponseSchema:
      type: object
      properties:
        reference_id:
          type: integer
          description: >
            It displays the unique ID created by Cashfree Payments for reference
            purposes.

            format: `int64`
          example: 123456
        verification_id:
          type: string
          description: >-
            It displays the unique ID you created to identify the verification
            request.
          example: testVerificationId
        address:
          type: string
          description: >-
            The complete address, including location details, which was provided
            in the request.
          example: 123 Main Street, Koramangala, Bangalore
        status:
          type: string
          description: It displays the status of the address provided (VALID/INVALID).
          example: VALID
        latitude:
          type: string
          description: The latitude value provided in request.
          example: '37.7749'
        longitude:
          type: string
          description: The longitude value provided in request.
          example: '-122.4194'
        geo_latitude:
          type: string
          description: The actual latitude coordinate of the address from the source.
          example: '37.7749'
        geo_longitude:
          type: string
          description: The actual longitude coordinate of the address from the source.
          example: '-122.4194'
        geo_country_code:
          type: string
          description: The country code of the address.
          example: IN
        city:
          type: string
          description: The city name of the address.
          example: Bangalore
        state:
          type: string
          description: The state name of the address.
          example: Karnataka
        state_code:
          type: string
          description: The state code of the address.
          example: KA
        country:
          type: string
          description: The country name of the address.
          example: India
        country_code:
          type: string
          description: The country code of the address.
          example: IN
        pincode:
          type: string
          description: Pincode or ZIP code of the address.
          example: '560034'
        distance_in_kms:
          type: string
          description: >-
            Distance in kilometers from the latitude and longitude provided in
            the input request body to actual location.
          example: '0.5'
    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.
  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).

````