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

# Preview Pre-auth Bundle

> Builds the pre-auth FHIR bundle from a full request without sending it.



## OpenAPI

````yaml post /abdm/nhcx/v1/preauth/preview
openapi: 3.1.0
info:
  description: ABHA Registration and login APIs
  title: Registration
  version: 1.0.0
servers:
  - description: Production
    url: https://api.eka.care
  - description: Stage/Sandbox
    url: https://api.dev.eka.care
security: []
paths:
  /abdm/nhcx/v1/preauth/preview:
    post:
      summary: Preview Pre-auth Bundle
      description: Builds the pre-auth FHIR bundle from a full request without sending it.
      parameters:
        - description: Eka User ID (OID)
          in: header
          name: X-Pt-Id
          schema:
            type: string
        - description: Partner User ID
          in: header
          name: X-Partner-Pt-Id
          schema:
            type: string
        - description: Partner HIP ID
          in: header
          name: X-Hip-Id
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModelsPreAuthRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: {}
                type:
                  - 'null'
                  - object
          description: OK
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NhcxError'
          description: ''
        5XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NhcxError'
          description: ''
      security:
        - authApiKey: []
components:
  schemas:
    ModelsPreAuthRequest:
      properties:
        abha_number:
          type: string
        accident_info:
          $ref: '#/components/schemas/ModelsAccidentInfo'
          description: Accident details (optional conditional form section)
        admission_type:
          description: 'The NDHM claim-type code: "OPD", "IPD", or "EMR". Defaults to "OPD".'
          type: string
        auth_type:
          description: >-
            Beneficiary authentication. AuthType "consent" (default) sends the
            Authentication Consent Questionnaire response (Consent) and OMITS
            the biometric X-Token; "biometric" sends UserToken as the X-Token.
            The payer requires one or the other.
          type: string
        case_number:
          description: >-
            An OPTIONAL override for the pre-auth case / intimation number sent
            as Claim.identifier. PMJAY does not issue a case number at
            eligibility or pre-auth, so this is normally left blank and a random
            UUID is generated. Provide it only if a specific value must be used
            (e.g. resubmission/enhancement referencing an earlier pre-auth).
          type: string
        clinical_notes:
          type: string
        consent:
          $ref: '#/components/schemas/ModelsPreAuthConsent'
          description: Authentication Consent Questionnaire response
        diagnosis:
          description: Clinical (form inputs)
          items:
            $ref: '#/components/schemas/ModelsDiagnosisCoding'
          type:
            - array
            - 'null'
        documents:
          description: Documents (file uploads from form)
          items:
            $ref: '#/components/schemas/ModelsClaimDocument'
          type: array
        estimated_amount:
          type: number
        hfr_facility_id:
          type: string
        hospital_address:
          type: string
        hospital_name:
          type: string
        items:
          description: >-
            NHCX procedure items with stratification (preferred over
            ServiceCodes in the NHCX flow).
          items:
            $ref: '#/components/schemas/ModelsNHCXPreAuthItem'
          type: array
        member_id:
          type: string
        participant_id:
          description: set server-side from auth token
          type: string
        patient_details:
          $ref: '#/components/schemas/ModelsPatientDetails'
        payer_id:
          description: Required identifiers
          type: string
        planned_end_date:
          format: date-time
          type:
            - 'null'
            - string
        planned_start_date:
          description: ISO 8601 — parsed from frontend datetime-local
          format: date-time
          type:
            - 'null'
            - string
        priority:
          description: '"normal" | "urgent" | "stat"'
          type: string
        procedure_codes:
          items:
            type: string
          type: array
        product_id:
          description: NHCX plan identifiers — used to auto-enrich Items from the plan DB.
          type: string
        product_name:
          type: string
        provider_id:
          description: >-
            Provider & patient (auto-populated by SDK from store; optional for
            backward compat)
          type: string
        provider_name:
          type: string
        remarks:
          type: string
        request_type:
          description: '"InitialRequest" | "FollowUp" | "Enhancement"'
          type: string
        service_breakdown:
          description: Cost estimate (auto-filled from package)
          items:
            $ref: '#/components/schemas/ModelsServiceBreakdown'
          type: array
        service_codes:
          description: Procedure & dates (form inputs)
          items:
            type: string
          type:
            - array
            - 'null'
        treating_doctor:
          $ref: '#/components/schemas/ModelsTreatingDoctor'
          description: Care team (form inputs)
        user_token:
          description: biometric User Token (30-min), used when AuthType=biometric
          type: string
      required:
        - payer_id
        - member_id
        - request_type
        - abha_number
      type: object
    NhcxError:
      properties:
        error:
          type: string
        issues:
          description: >-
            Every validation problem found, when the backend rejects a submit
            before it reaches the payer
          items:
            type: string
          type: array
        updated_at:
          description: 'Only on a 409 from the draft save: the stored draft''s version'
          type: string
      type: object
    ModelsAccidentInfo:
      properties:
        date:
          format: date-time
          type:
            - 'null'
            - string
        description:
          type: string
        type:
          description: MVA, Work, etc.
          type: string
      type: object
    ModelsPreAuthConsent:
      properties:
        answers:
          items:
            $ref: '#/components/schemas/ModelsPreAuthQuestionnaireAnswer'
          type:
            - array
            - 'null'
        questionnaire_url:
          type: string
      type: object
    ModelsDiagnosisCoding:
      properties:
        code:
          type: string
        display:
          type: string
        system:
          description: defaults to ICD-10 if empty
          type: string
      required:
        - code
        - display
      type: object
    ModelsClaimDocument:
      properties:
        content:
          description: base64-encoded inline content
          type: string
        content_type:
          description: e.g. "application/pdf"
          type: string
        creation_date:
          description: '"YYYY-MM-DD"'
          type: string
        description:
          type: string
        title:
          type: string
        type:
          description: LAB_REPORT / RADIOLOGY / DISCHARGE_SUMMARY …
          type: string
        url:
          description: presigned URL (optional if content provided)
          type: string
      required:
        - type
        - content_type
      type: object
    ModelsNHCXPreAuthItem:
      properties:
        claim_amount:
          type: number
        procedure_code:
          type: string
        procedure_name:
          type: string
        quantity:
          type: integer
        questionnaire_answers:
          description: >-
            Carries STG form answers for this procedure. Each answer maps to one
            Claim.supportingInfo entry with valueString.
          items:
            $ref: '#/components/schemas/ModelsPreAuthQuestionnaireAnswer'
          type: array
        speciality_code:
          type: string
        speciality_name:
          type: string
        strat_code:
          type: string
        strat_display:
          type: string
        supporting_docs:
          description: >-
            Provides actual document content keyed by MandCode. Each entry maps
            to one Claim.supportingInfo entry with valueAttachment.
          items:
            $ref: '#/components/schemas/ModelsPreAuthDocInput'
          type: array
      type: object
    ModelsPatientDetails:
      properties:
        abha_number:
          type: string
        age:
          description: optional; derived server-side if absent
          type: integer
        dob:
          description: YYYY-MM-DD
          type: string
        email:
          type: string
        gender:
          description: '"male"/"female"/"other" or title-case variants'
          type: string
        mobile:
          type: string
        name:
          type: string
        relation:
          type: string
      required:
        - name
      type: object
    ModelsServiceBreakdown:
      properties:
        description:
          type: string
        net_amount:
          description: quantity × unit_price
          type: number
        quantity:
          description: units or days
          type: number
        service_code:
          description: NHCX / SNOMED code
          type: string
        unit_price:
          description: per-unit price
          type: number
      required:
        - service_code
      type: object
    ModelsTreatingDoctor:
      properties:
        hpr_id:
          description: ABDM Health Professional Registry ID (e.g. 12-1212-1212-1212)
          type: string
        name:
          type: string
        qualification:
          type: string
        registration_id:
          description: NMC / council registration no.
          type: string
        specialty:
          description: SNOMED specialty label or free text
          type: string
      required:
        - name
      type: object
    ModelsPreAuthQuestionnaireAnswer:
      properties:
        answer: {}
        link_id:
          type: string
        question:
          type: string
        questionnaire_url:
          description: STG questionnaire URL
          type: string
      type: object
    ModelsPreAuthDocInput:
      properties:
        content:
          description: base64 inline payload
          type: string
        content_type:
          description: '"application/pdf"'
          type: string
        creation:
          description: '"YYYY-MM-DD"'
          type: string
        doc_id:
          description: >-
            DocID — see ClaimSupportingDoc.DocID: a reference to a stored draft
            attachment, hydrated server-side when Content is empty.
          type: string
        mand_code:
          description: e.g. "MAND0006" — matches the plan's mandatory doc
          type: string
        title:
          type: string
        url:
          description: presigned S3 URL (preferred)
          type: string
      type: object
  securitySchemes:
    authApiKey:
      description: The API requires a Bearer token (JWT) for authentication.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.