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

# Create Cost Estimate

> Creates a cost estimate for medical billing codes based on verification data.



## OpenAPI

````yaml post /v1/cost-estimate
openapi: 3.0.0
info:
  version: 1.0.0
  title: Sohar API
  license:
    name: MIT
servers:
  - url: https://api.soharhealth.com
security: []
paths:
  /v1/cost-estimate:
    post:
      tags:
        - CostEstimate
      summary: Create Cost Estimate
      description: >-
        Creates a cost estimate for medical billing codes based on verification
        data.
      operationId: createCostEstimate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCostEstimateRequest'
            example:
              verificationId: fb701ac1-1246-4860-b1ec-bd916b97a990
              tin: '752326127'
              networkStatus: inn
              tier: 1
              lines:
                - code: '90837'
                  contractedRate: 100
                - code: '99213'
                  contractedRate: 80
      responses:
        '201':
          description: A cost estimate
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCostEstimateResponse'
              example:
                requestId: fb701ac1-1246-4860-b1ec-bd916b97a990
                paidAmount: 180
                patientResponsibility: 120
                lines:
                  - code: '90837'
                    adjustments:
                      - reasonCode: '1'
                        amount: 50
                      - reasonCode: '2'
                        amount: 30
                  - code: '99213'
                    adjustments:
                      - reasonCode: '1'
                        amount: 25
                      - reasonCode: '3'
                        amount: 15
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - invalid_request_error
                    default: invalid_request_error
                  param:
                    type: string
                    example: ein
        '403':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - invalid_request_error
                    default: invalid_request_error
        '500':
          description: Internal error
      security:
        - BasicAuth: []
components:
  schemas:
    CreateCostEstimateRequest:
      type: object
      required:
        - verificationId
        - tin
        - networkStatus
        - lines
      properties:
        verificationId:
          type: string
          description: A Sohar Verification ID
          format: uuid
          example: fb701ac1-1246-4860-b1ec-bd916b97a990
        tin:
          type: string
          description: A Tax Identification Number (9 digits)
          example: '752326127'
        networkStatus:
          type: string
          description: >-
            Determines whether the benefits apply to patients in or out of
            network
          enum:
            - inn
            - oon
          example: inn
        tier:
          type: number
          nullable: true
          description: The benefits tier, if multiple benefits are available
          example: 1
        lines:
          type: array
          description: An array of billing lines with codes and contracted rates
          minItems: 1
          items:
            type: object
            required:
              - code
              - contractedRate
            properties:
              code:
                type: string
                description: The billing code
                example: '90837'
              contractedRate:
                type: number
                description: Contracted rate for this line
                minimum: 0
                exclusiveMinimum: true
                example: 150
    CreateCostEstimateResponse:
      type: object
      required:
        - requestId
        - verificationId
        - paidAmount
        - patientResponsibility
        - lines
      properties:
        requestId:
          type: string
          description: Unique identifier for the cost estimate request
          format: uuid
          example: 0942a568-b015-438e-b7be-d0234f401f35
        verificationId:
          type: string
          description: The Sohar ID for the verification used to create this cost estimate
          format: uuid
          example: fb701ac1-1246-4860-b1ec-bd916b97a990
        paidAmount:
          type: number
          description: The total amount paid by the payer in USD
          example: 80
        patientResponsibility:
          type: number
          description: The total amount owed by the patient in USD
          example: 120
        lines:
          type: array
          description: Cost estimate breakdown for each billing line
          items:
            type: object
            required:
              - code
              - adjustments
            properties:
              code:
                type: string
                description: The billing code for this line
                example: '90837'
              adjustments:
                type: array
                description: Claim adjustments for this line
                items:
                  type: object
                  required:
                    - reasonCode
                    - amount
                  properties:
                    reasonCode:
                      type: string
                      description: |
                        A claim adjustment reason code:
                        - "1": Deductible
                        - "2": Coinsurance
                        - "3": Copay
                      example: '1'
                      enum:
                        - '1'
                        - '2'
                        - '3'
                    amount:
                      type: number
                      description: The claim adjustment amount in USD
                      example: 120
  securitySchemes:
    BasicAuth:
      type: http
      scheme: bearer

````