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

# Get Superbill Context

> Return autofill data for the superbill page: linked event (location, service
segments with providers and NPIs), patient demographics, insurance coverages,
and guarantor.



## OpenAPI

````yaml get /billing/charge/{charge_id}/superbill-context
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /billing/charge/{charge_id}/superbill-context:
    get:
      tags:
        - Charges
      summary: Get Superbill Context
      description: >-
        Return autofill data for the superbill page: linked event (location,
        service

        segments with providers and NPIs), patient demographics, insurance
        coverages,

        and guarantor.
      operationId: get_superbill_context_billing_charge__charge_id__superbill_context_get
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: charge_id
          in: path
          required: true
          schema:
            type: string
            title: Charge Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuperbillContext'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SuperbillContext:
      properties:
        chargeId:
          type: string
          title: Chargeid
        patient:
          $ref: '#/components/schemas/SuperbillPatient'
        guarantor:
          $ref: '#/components/schemas/SuperbillGuarantor'
        event:
          anyOf:
            - $ref: '#/components/schemas/SuperbillEvent'
            - type: 'null'
        insuranceCoverages:
          items:
            $ref: '#/components/schemas/SuperbillInsuranceCoverage'
          type: array
          title: Insurancecoverages
        savedPayload:
          anyOf:
            - $ref: '#/components/schemas/SuperbillPayload'
            - type: 'null'
        noteCodes:
          anyOf:
            - $ref: '#/components/schemas/SuperbillNoteCodes'
            - type: 'null'
        serviceDefaults:
          items:
            $ref: '#/components/schemas/SuperbillServiceDefaults'
          type: array
          title: Servicedefaults
          default: []
        defaultPlaceOfService:
          anyOf:
            - type: string
            - type: 'null'
          title: Defaultplaceofservice
      type: object
      required:
        - chargeId
        - patient
        - guarantor
        - insuranceCoverages
      title: SuperbillContext
      description: >-
        Autofill data for the superbill page: event details + insurance +
        guarantor.


        If staff has previously saved a draft for this charge, `saved_payload`
        carries

        their last-known values so the page can hydrate the editor (overrides
        autofill).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SuperbillPatient:
      properties:
        id:
          type: string
          title: Id
        firstName:
          type: string
          title: Firstname
        lastName:
          type: string
          title: Lastname
        dateOfBirth:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Dateofbirth
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        phoneNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Phonenumber
        address:
          anyOf:
            - type: string
            - type: 'null'
          title: Address
        addressLineTwo:
          anyOf:
            - type: string
            - type: 'null'
          title: Addresslinetwo
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        zipCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Zipcode
      type: object
      required:
        - id
        - firstName
        - lastName
      title: SuperbillPatient
    SuperbillGuarantor:
      properties:
        name:
          type: string
          title: Name
        relationship:
          type: string
          title: Relationship
        patientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Patientid
      type: object
      required:
        - name
        - relationship
      title: SuperbillGuarantor
    SuperbillEvent:
      properties:
        id:
          type: string
          title: Id
        start:
          type: string
          format: date-time
          title: Start
        end:
          type: string
          format: date-time
          title: End
        location:
          anyOf:
            - $ref: '#/components/schemas/SuperbillLocation'
            - type: 'null'
        serviceSegments:
          items:
            $ref: '#/components/schemas/SuperbillServiceSegment'
          type: array
          title: Servicesegments
      type: object
      required:
        - id
        - start
        - end
        - serviceSegments
      title: SuperbillEvent
    SuperbillInsuranceCoverage:
      properties:
        id:
          type: string
          title: Id
        isPrimary:
          type: boolean
          title: Isprimary
        inNetwork:
          type: boolean
          title: Innetwork
        insurerName:
          type: string
          title: Insurername
        memberId:
          type: string
          title: Memberid
        groupId:
          anyOf:
            - type: string
            - type: 'null'
          title: Groupid
        policyHolderName:
          type: string
          title: Policyholdername
        policyHolderDob:
          type: string
          format: date
          title: Policyholderdob
        pverifyCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Pverifycode
        phoneNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Phonenumber
        coverageType:
          anyOf:
            - type: string
            - type: 'null'
          title: Coveragetype
        planName:
          anyOf:
            - type: string
            - type: 'null'
          title: Planname
        planType:
          anyOf:
            - type: string
            - type: 'null'
          title: Plantype
        effectiveDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Effectivedate
        eligibilityNote:
          anyOf:
            - type: string
            - type: 'null'
          title: Eligibilitynote
        claimsAddress:
          anyOf:
            - type: string
            - type: 'null'
          title: Claimsaddress
      type: object
      required:
        - id
        - isPrimary
        - inNetwork
        - insurerName
        - memberId
        - policyHolderName
        - policyHolderDob
      title: SuperbillInsuranceCoverage
    SuperbillPayload:
      properties:
        services:
          items:
            $ref: '#/components/schemas/SuperbillServiceLine'
          type: array
          title: Services
        serviceDetails:
          $ref: '#/components/schemas/SuperbillServiceDetails'
        insurance:
          $ref: '#/components/schemas/SuperbillInsuranceInput'
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        includeCodeSummary:
          type: boolean
          title: Includecodesummary
          default: true
      type: object
      required:
        - services
        - serviceDetails
        - insurance
      title: SuperbillPayload
      description: >-
        Full superbill document state — what staff fills in + what was
        autofilled.
    SuperbillNoteCodes:
      properties:
        noteId:
          type: string
          title: Noteid
        cptCodes:
          items:
            type: string
          type: array
          title: Cptcodes
          default: []
        icd10Codes:
          items:
            type: string
          type: array
          title: Icd10Codes
          default: []
        cptModifiers:
          additionalProperties:
            items:
              type: string
            type: array
          type: object
          title: Cptmodifiers
          default: {}
      type: object
      required:
        - noteId
      title: SuperbillNoteCodes
      description: >-
        Codes already extracted onto the linked clinical note by the scribe
        flow.
    SuperbillServiceDefaults:
      properties:
        itemId:
          type: string
          title: Itemid
        defaultCptCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Defaultcptcode
        defaultModifiers:
          items:
            type: string
          type: array
          title: Defaultmodifiers
          default: []
        defaultIcd10Codes:
          items:
            type: string
          type: array
          title: Defaulticd10Codes
          default: []
        defaultPlaceOfService:
          anyOf:
            - type: string
            - type: 'null'
          title: Defaultplaceofservice
      type: object
      required:
        - itemId
      title: SuperbillServiceDefaults
      description: >-
        Expected codes configured on an Item. Used as priors when seeding a
        Super Bill line.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    SuperbillLocation:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        addressLineOne:
          anyOf:
            - type: string
            - type: 'null'
          title: Addresslineone
        addressLineTwo:
          anyOf:
            - type: string
            - type: 'null'
          title: Addresslinetwo
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        zipCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Zipcode
        phoneNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Phonenumber
      type: object
      required:
        - id
        - name
      title: SuperbillLocation
    SuperbillServiceSegment:
      properties:
        id:
          type: string
          title: Id
        serviceId:
          anyOf:
            - type: string
            - type: 'null'
          title: Serviceid
        serviceName:
          anyOf:
            - type: string
            - type: 'null'
          title: Servicename
        start:
          type: string
          format: date-time
          title: Start
        end:
          type: string
          format: date-time
          title: End
        provider:
          anyOf:
            - $ref: '#/components/schemas/SuperbillProvider'
            - type: 'null'
      type: object
      required:
        - id
        - start
        - end
      title: SuperbillServiceSegment
    SuperbillServiceLine:
      properties:
        chargeItemId:
          anyOf:
            - type: string
            - type: 'null'
          title: Chargeitemid
        included:
          type: boolean
          title: Included
          default: true
        billingCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Billingcode
        billingCodeDescription:
          anyOf:
            - type: string
            - type: 'null'
          title: Billingcodedescription
        modifiers:
          items:
            type: string
          type: array
          title: Modifiers
          default: []
        icd10Codes:
          items:
            type: string
          type: array
          title: Icd10Codes
          default: []
        ndcCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Ndccode
        placeOfService:
          anyOf:
            - type: string
            - type: 'null'
          title: Placeofservice
        startDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Startdate
        endDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Enddate
        quantity:
          type: number
          title: Quantity
          default: 1
        quantityLabel:
          type: string
          enum:
            - QUANTITY
            - UNITS
          title: Quantitylabel
          default: QUANTITY
        billedChargeCents:
          type: integer
          title: Billedchargecents
          default: 0
      type: object
      title: SuperbillServiceLine
      description: |-
        One service row on the superbill — sent back when sending/exporting.

        `charge_item_id` is the durable link back to the originating ChargeItems
        row when a line was seeded from a charge item. Lines added inline in the
        editor (with no backing charge item) leave it None. Saves use this id to
        denormalize per-line codes back onto the right row; position is unsafe
        because adding / removing lines in the editor shifts the indexes.
    SuperbillServiceDetails:
      properties:
        renderingProviderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Renderingproviderid
        renderingProviderName:
          anyOf:
            - type: string
            - type: 'null'
          title: Renderingprovidername
        renderingProviderNpi:
          anyOf:
            - type: string
            - type: 'null'
          title: Renderingprovidernpi
        billingProviderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Billingproviderid
        billingProviderName:
          anyOf:
            - type: string
            - type: 'null'
          title: Billingprovidername
        billingProviderNpi:
          anyOf:
            - type: string
            - type: 'null'
          title: Billingprovidernpi
        tin:
          anyOf:
            - type: string
            - type: 'null'
          title: Tin
        otherProviderName:
          anyOf:
            - type: string
            - type: 'null'
          title: Otherprovidername
        placeOfService:
          anyOf:
            - type: string
            - type: 'null'
          title: Placeofservice
        facilityName:
          anyOf:
            - type: string
            - type: 'null'
          title: Facilityname
        startDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Startdate
        endDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Enddate
        hospitalAdmitDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Hospitaladmitdate
        dateOfInjury:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Dateofinjury
        priorAuthNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Priorauthnumber
      type: object
      title: SuperbillServiceDetails
    SuperbillInsuranceInput:
      properties:
        coverageType:
          anyOf:
            - type: string
            - type: 'null'
          title: Coveragetype
        payerName:
          anyOf:
            - type: string
            - type: 'null'
          title: Payername
        planName:
          anyOf:
            - type: string
            - type: 'null'
          title: Planname
        planType:
          anyOf:
            - type: string
            - type: 'null'
          title: Plantype
        insuranceId:
          anyOf:
            - type: string
            - type: 'null'
          title: Insuranceid
        groupId:
          anyOf:
            - type: string
            - type: 'null'
          title: Groupid
        effectiveDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Effectivedate
        eligibilityNote:
          anyOf:
            - type: string
            - type: 'null'
          title: Eligibilitynote
        claimsAddress:
          anyOf:
            - type: string
            - type: 'null'
          title: Claimsaddress
        guarantorName:
          anyOf:
            - type: string
            - type: 'null'
          title: Guarantorname
      type: object
      title: SuperbillInsuranceInput
    SuperbillProvider:
      properties:
        id:
          type: string
          title: Id
        firstName:
          type: string
          title: Firstname
        lastName:
          type: string
          title: Lastname
        npi:
          anyOf:
            - type: string
            - type: 'null'
          title: Npi
        credentials:
          anyOf:
            - type: string
            - type: 'null'
          title: Credentials
      type: object
      required:
        - id
        - firstName
        - lastName
      title: SuperbillProvider

````