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

# Indian Cheque v2

> Processes a cheque image and extracts structured information using OCR technology

**Image Requirements:**

* Clear, high-resolution image
* Cheque should be flat and well-lit
* All text should be clearly visible
* Supported formats: JPG, JPEG, PNG


## OpenAPI

````yaml POST /v2/ocr/cheque/
openapi: 3.0.0
info:
  title: KonnectNXT API Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://bgv.konnectnxt.com/api
    description: Production
  - url: https://testbgv.konnectnxt.com/api
    description: QA
security:
  - bearerAuth: []
paths:
  /v2/ocr/cheque/:
    post:
      tags:
        - OCR
      summary: Extract data from cheque image
      description: >-
        Processes a cheque image and extracts structured information using OCR
        technology
      operationId: extractChequeData
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChequeOcrRequest'
            examples:
              Example:
                summary: Basic cheque OCR request
                value:
                  document_url: https://example.com/images/cheque-sample.jpg
                  micr_details: true
      responses:
        '200':
          description: Cheque data extracted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChequeOcrSuccessResponse'
        '400':
          description: Bad request due to invalid input data.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
                  - $ref: '#/components/schemas/APIErrorData'
              examples:
                Document URL Missing:
                  summary: Document URL missing
                  value:
                    status: error
                    code: 400
                    message: '`document_url` is required.'
                    data: null
                Invalid Document URL:
                  summary: Invalid Document URL
                  value:
                    status: error
                    code: 400
                    message: Enter a valid `document_url`
                    data: null
                Invalid MICR Details:
                  summary: Invalid MICR Details Parameter
                  value:
                    status: error
                    code: 400
                    message: Enter true or false for `micr_details`
                    data: null
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          description: Unprocessable Entity - Image processing failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_WithCredits'
              examples:
                Image Non Compliant:
                  summary: Image is non compliant to request/quality standard
                  value:
                    status: error
                    code: 422
                    message: ''
                    data: null
                Invalid URL:
                  summary: No cheque detected in image
                  value:
                    status: error
                    code: 422
                    message: INVALID_URL
                    data: null
        '500':
          $ref: '#/components/responses/500'
components:
  schemas:
    ChequeOcrRequest:
      type: object
      required:
        - document_url
      properties:
        document_url:
          type: string
          format: uri
          description: |+
            Publicly accessible URL of the cheque image to be processed.

            **Requirements:**
            - Must be a valid HTTP/HTTPS URL
            - Image must be publicly accessible
            - Supported formats: JPG, JPEG, PNG

          example: https://example.com/images/cheque-front.jpg
        micr_details:
          type: boolean
          description: Fetch MICR details
          example: true
          default: true
    ChequeOcrSuccessResponse:
      allOf:
        - $ref: '#/components/schemas/APIBaseResponse'
        - type: object
          required:
            - data
          properties:
            data:
              $ref: '#/components/schemas/ChequeData'
        - $ref: '#/components/schemas/Credits'
    Error:
      allOf:
        - $ref: '#/components/schemas/APIBaseResponse'
    APIErrorData:
      type: object
      properties:
        data:
          type: object
          nullable: true
          example: null
    Error_WithCredits:
      allOf:
        - $ref: '#/components/schemas/Error'
        - $ref: '#/components/schemas/APIErrorData'
        - $ref: '#/components/schemas/Credits'
    APIBaseResponse:
      type: object
      required:
        - status
        - code
        - message
      properties:
        status:
          $ref: '#/components/schemas/APIStatus'
        code:
          $ref: '#/components/schemas/HTTPCode'
        message:
          $ref: '#/components/schemas/APIMessage'
    ChequeData:
      type: object
      description: Extracted cheque information
      properties:
        account_name:
          type: string
          nullable: true
          description: Name of the account holder as printed on the cheque
          example: John Doe
        account_no:
          type: string
          nullable: true
          description: Bank account number
          example: '123456789012'
        bank_name:
          type: string
          nullable: true
          description: Name of the bank
          example: ICICI Bank
        bank_address:
          type: string
          nullable: true
          description: Bank branch address
          example: Mumbai Branch, Maharashtra
        ifsc_code:
          type: string
          nullable: true
          description: Indian Financial System Code (11 characters)
          pattern: ^[A-Z]{4}0[A-Z0-9]{6}$
          example: ICIC0001234
        date_of_issue:
          type: string
          format: date
          nullable: true
          description: Date written on the cheque (YYYY-MM-DD format)
          example: '2024-01-15'
        is_scanned:
          type: boolean
          nullable: true
          description: Indicates whether the cheque has been scanned
          example: false
        micr_cheque_number:
          type: string
          nullable: true
          description: Unique cheque number from MICR line (typically 6 digits)
          example: '000123'
        micr_code:
          type: string
          nullable: true
          description: MICR code at the bottom of cheque
          example: '400240001'
    Credits:
      type: object
      properties:
        credits_used:
          $ref: '#/components/schemas/CreditsUsed'
        credits_left:
          $ref: '#/components/schemas/CreditsLeft'
      required:
        - credits_used
        - credits_left
    APIStatus:
      type: string
      enum:
        - success
        - error
      description: Overall status of the API
    HTTPCode:
      type: integer
      description: HTTP status code
      example: 400
    APIMessage:
      type: string
      description: Description of the response or error
      example: Invalid request parameters
    CreditsUsed:
      type: integer
      description: Represents the total number of credits used in this request.
      example: 3
    CreditsLeft:
      type: integer
      description: 'Represents the remaining credits available for use. '
      example: 4040
  responses:
    '401':
      description: Unauthorized
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/APIErrorData'
          examples:
            Missing Token:
              summary: Bearer token is missing or invalid.
              value:
                status: error
                code: 401
                message: Bearer token is missing or invalid.
                data: null
            Incorrect Token Format:
              summary: Token format is incorrect
              value:
                status: error
                code: 401
                message: Token format is incorrect
                data: null
            No Admin Found:
              summary: No admin found for this request
              value:
                status: error
                code: 401
                message: No admin user found for this organization
                data: null
            Invalid API Key:
              summary: Invalid API Key
              value:
                status: error
                code: 401
                message: Invalid API key (organization ID)
                data: null
            User not Found:
              summary: User not found
              value:
                status: error
                code: 401
                message: User not found.
                data: null
    '403':
      description: Forbidden
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/APIErrorData'
          examples:
            Token Revoked:
              summary: Token access has been Revoked, Contact Support.
              value:
                status: error
                code: 403
                message: Token access has been Revoked, Contact Support.
                data: null
            Token Inactive:
              summary: Token is Inactive, Contact Support.
              value:
                status: error
                code: 403
                message: Token is Inactive, Contact Support.
                data: null
    '500':
      description: Internal Server Error
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/APIErrorData'
          examples:
            Internal Server Error:
              summary: Internal Server Error.
              value:
                status: error
                code: 500
                message: Internal Server Error.
                data: null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key issued by KonnectNXT. Pass as `Authorization: Bearer
        <your_api_key>`.

````