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

> Get a Super Bill's full detail, including its linked charges and hydrated claim context.



## OpenAPI

````yaml get /billing/superbill/{superbill_id}
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /billing/superbill/{superbill_id}:
    get:
      tags:
        - Superbills
      summary: Get Superbill
      description: >-
        Get a Super Bill's full detail, including its linked charges and
        hydrated claim context.
      operationId: get_superbill_billing_superbill__superbill_id__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: superbill_id
          in: path
          required: true
          schema:
            type: string
            title: Superbill Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuperbillDetail'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SuperbillDetail:
      properties:
        id:
          type: string
          title: Id
        patientId:
          type: string
          title: Patientid
        eventId:
          anyOf:
            - type: string
            - type: 'null'
          title: Eventid
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        createdDate:
          type: string
          format: date-time
          title: Createddate
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
        charges:
          items:
            $ref: '#/components/schemas/ChargeDetailWithItems'
          type: array
          title: Charges
        context:
          $ref: '#/components/schemas/SuperbillContext'
      type: object
      required:
        - id
        - patientId
        - createdDate
        - charges
        - context
      title: SuperbillDetail
      description: >-
        Full Super Bill row + the aggregated editor context.


        `charges` carries the full ChargeDetailWithItems for each linked charge
        so

        the editor can render service-line cards across charges. `context`
        carries

        the aggregated patient/event/insurance/note-codes the editor needs.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ChargeDetailWithItems:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: A unique identifier for the charge. Auto-generated if not provided.
        patientId:
          type: string
          title: Patientid
          description: Identifier of the patient being charged.
        patient:
          anyOf:
            - $ref: '#/components/schemas/PatientSummary'
            - type: 'null'
          description: Summary details of the patient being charged.
        total:
          type: integer
          title: Total
          description: Total amount of the charge.
          default: 0
        totalOutstanding:
          type: integer
          title: Totaloutstanding
          description: Total outstanding amount that is yet to be paid.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the charge.
        status:
          $ref: '#/components/schemas/ChargeStatus'
          description: Current status of the charge.
          default: OUTSTANDING
        externalId:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalid
          description: External identifier for the charge, if applicable.
        externalCreatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Externalcreateddate
          description: >-
            The creation date of the charge in your external system, if
            applicable.
        ruleSetId:
          anyOf:
            - type: string
            - type: 'null'
          title: Rulesetid
          description: Identifier for the `RuleSet` applied to this `Charge`, if any.
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
          description: The date when the charge was created.
        creatorId:
          anyOf:
            - type: string
            - type: 'null'
          title: Creatorid
          description: >-
            Identifier of the `Provider` who created the charge (i.e. the
            Clinician, or relevant Biller).
        items:
          items:
            $ref: '#/components/schemas/ChargeItemDetail-Output'
          type: array
          title: Items
          default: []
        tips:
          items:
            $ref: '#/components/schemas/TipDetail'
          type: array
          title: Tips
          description: List of `Tips` in the `Charge`.
          default: []
        locationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationid
          description: Identifier of the `Location` where the charge was created.
        eventId:
          anyOf:
            - type: string
            - type: 'null'
          title: Eventid
          description: Identifier of the `Event` this charge is associated with, if any.
        memberId:
          anyOf:
            - type: string
            - type: 'null'
          title: Memberid
          description: Identifier of the `Member` this charge is associated with, if any.
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
          description: Any additional comments about the charge.
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
          description: Any additional metadata about the charge relevant to your system.
        merchantAccountId:
          anyOf:
            - type: string
            - type: 'null'
          title: Merchantaccountid
          description: Identifier of the `MerchantAccount` this charge is associated with.
        adjustments:
          items:
            $ref: '#/components/schemas/AdjustmentSummary'
          type: array
          title: Adjustments
          default: []
        payments:
          items:
            $ref: '#/components/schemas/ChargePaymentDetail-Output'
          type: array
          title: Payments
          default: []
        totalDiscount:
          type: integer
          title: Totaldiscount
          description: Total discount in cents from all items' DiscountUse records.
          readOnly: true
        totalDiscountPercentage:
          type: number
          title: Totaldiscountpercentage
          description: Discount as percentage of items subtotal (0-100).
          readOnly: true
      type: object
      required:
        - patientId
        - totalOutstanding
        - totalDiscount
        - totalDiscountPercentage
      title: ChargeDetailWithItems
    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).
    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
    PatientSummary:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier for the user.
        firstName:
          anyOf:
            - type: string
            - type: 'null'
          title: Firstname
          description: The user's first name.
        lastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastname
          description: The user's last name.
        phoneNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Phonenumber
          description: The user's phone number.
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: The user's email address.
        type:
          $ref: '#/components/schemas/UserType'
          description: The type of user.
        locationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationid
          description: The location of the user.
        externalId:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalid
          description: The user's external identifier if available.
        address:
          anyOf:
            - type: string
            - type: 'null'
          title: Address
          description: The user's primary address.
        addressLineTwo:
          anyOf:
            - type: string
            - type: 'null'
          title: Addresslinetwo
          description: Additional address information.
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
          description: The city of the user's address.
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
          description: The state of the user's address.
        zipCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Zipcode
          description: The postal code of the user's address.
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: The country of the user's address.
        createdDate:
          type: string
          format: date-time
          title: Createddate
          description: The date and time when the user was created.
        addressValid:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Addressvalid
          description: Whether the user's address is valid.
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
          description: Any additional metadata about the user relevant to your system.
        isArchived:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Isarchived
          description: Whether the user is archived.
        primaryLocationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Primarylocationid
          description: The primary location of the user.
        gender:
          anyOf:
            - type: string
            - type: 'null'
          title: Gender
          description: The gender of the patient.
        pronouns:
          anyOf:
            - type: string
            - type: 'null'
          title: Pronouns
          description: The patient's pronouns (e.g., 'he/him', 'she/her', 'they/them').
        preferredName:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Preferredname
          description: The patient's preferred name or nickname.
        dateOfBirth:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Dateofbirth
          description: The date of birth of the patient.
        patientMedications:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Patientmedications
          description: List of patient's self-reported medications.
        patientSource:
          anyOf:
            - $ref: '#/components/schemas/PatientSource'
            - type: 'null'
          description: The source of the patient.
        leadSource:
          anyOf:
            - type: string
            - type: 'null'
          title: Leadsource
          description: Flexible lead source for tracking patient acquisition.
        onSchedulingBlacklist:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Onschedulingblacklist
          description: Whether the patient is on the scheduling blacklist.
        surchargeDisabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Surchargedisabled
          description: Whether surcharges are disabled for this patient.
        optedInToSmsMarketing:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Optedintosmsmarketing
          description: Whether the patient has opted in to marketing SMS messages.
        optedInToEmailMarketing:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Optedintoemailmarketing
          description: Whether the patient has opted in to marketing email messages.
        optedInToSocialMedia:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Optedintosocialmedia
          description: >-
            Whether the patient has consented to appear on the practice's social
            media / marketing channels.
        aiScribeConsent:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Aiscribeconsent
          description: >-
            Whether the patient consents to AI scribe recording during visits.
            False auto-disables AI note generation for this patient.
        tags:
          anyOf:
            - items:
                $ref: '#/components/schemas/PatientTagSummary'
              type: array
            - type: 'null'
          title: Tags
          description: List of patient tags
        creditBalance:
          anyOf:
            - type: integer
            - type: 'null'
          title: Creditbalance
          description: Patient's credit balance in cents.
        preferredProviderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Preferredproviderid
          description: The preferred provider ID for this patient.
        dosespotPatientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Dosespotpatientid
          description: DoseSpot Patient ID for e-prescribing integration
      type: object
      required:
        - id
        - type
        - createdDate
      title: PatientSummary
    ChargeStatus:
      type: string
      enum:
        - OUTSTANDING
        - PAID
        - EXTERNAL_SETTLEMENT
        - VOID
        - WRITE_OFF
        - REFUNDED
        - CHARGEBACK
        - PAYMENT_PLAN
        - COLLECTIONS
      title: ChargeStatus
    ChargeItemDetail-Output:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Unique identifier for the charge item
        itemId:
          anyOf:
            - type: string
            - type: 'null'
          title: Itemid
          description: Optional unique identifier for the item
        chargeId:
          anyOf:
            - type: string
            - type: 'null'
          title: Chargeid
          description: >-
            Identifier of the charge this item is associated with (optional when
            creating charge)
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name of the item (None for items with associated inventory item)
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the item
        quantity:
          type: number
          title: Quantity
          description: Quantity of the item being charged
        discountReason:
          anyOf:
            - type: string
            - type: 'null'
          title: Discountreason
          description: Reason for discount
        price:
          type: integer
          title: Price
          description: Price of the item in cents
        discounts:
          items:
            $ref: >-
              #/components/schemas/decoda__schemas__inventory__item__DiscountUse-Output
          type: array
          title: Discounts
          description: List of discounts used for this charge item
          default: []
        soldByProviderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Soldbyproviderid
          description: Unique identifier for the provider who sold the item
        soldPackageId:
          anyOf:
            - type: string
            - type: 'null'
          title: Soldpackageid
          description: Identifier of the sold package this charge item is using
        taxAmount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Taxamount
          description: Tax amount for the item in cents
        pricingId:
          anyOf:
            - type: string
            - type: 'null'
          title: Pricingid
          description: Unique identifier for the pricing for the item
        type:
          $ref: '#/components/schemas/ItemType'
          description: Type of item (PRODUCT, MEDICATION, etc.)
          default: PRODUCT
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
          description: Category name for the associated item, when known
        savedQuantity:
          anyOf:
            - type: integer
            - type: 'null'
          title: Savedquantity
          description: >-
            Quantity of items saved for later use (creates discounts for saved
            items). Not persisted to database.
        serviceAddonId:
          anyOf:
            - type: string
            - type: 'null'
          title: Serviceaddonid
          description: ID of the service addon
        parentChargeItemId:
          anyOf:
            - type: string
            - type: 'null'
          title: Parentchargeitemid
          description: ID of the parent charge item
        billingCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Billingcode
          description: CPT / HCPCS billing code
        modifiers:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Modifiers
          description: Procedure modifiers, e.g. ['59']
        icd10Codes:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Icd10Codes
          description: ICD-10 diagnosis pointer codes
        ndcCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Ndccode
          description: NDC code, when applicable
        placeOfService:
          anyOf:
            - type: string
            - type: 'null'
          title: Placeofservice
          description: CMS Place of Service code, e.g. '11'
        shipmentIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Shipmentids
          description: Optional list of shipment IDs to reduce the stock quantity of
        doseComponentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Dosecomponentid
          description: >-
            For medication line items from an administration: the specific
            DoseComponent this line bills.
        recipients:
          anyOf:
            - items:
                $ref: '#/components/schemas/GiftCardRecipientInput'
              type: array
            - type: 'null'
          title: Recipients
          description: >-
            Per-card recipient info for gift-card line items. Positional: the
            Nth entry maps to the Nth issued card. Ignored for non-gift-card
            items.
        item:
          anyOf:
            - $ref: '#/components/schemas/ItemTiny'
            - type: 'null'
          description: Details of the item (None for custom charge items)
        locationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationid
          description: Location ID where the sale occurred
        locationName:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationname
          description: Location name where the sale occurred
        saleDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Saledate
          description: Date when the sale occurred
      type: object
      required:
        - quantity
        - price
      title: ChargeItemDetail
    TipDetail:
      properties:
        chargeId:
          type: string
          title: Chargeid
          description: Charge ID this tip belongs to
        amount:
          type: integer
          title: Amount
          description: Tip amount in cents
        providerId:
          type: string
          title: Providerid
          description: Provider ID receiving the tip
        percentage:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: Percentage
          description: Optional percentage used to calculate this tip. Not persisted.
        id:
          type: string
          title: Id
          description: Unique identifier for the tip
        provider:
          anyOf:
            - $ref: '#/components/schemas/ProviderTiny'
            - type: 'null'
          description: Provider receiving the tip
      type: object
      required:
        - chargeId
        - amount
        - providerId
      title: TipDetail
    AdjustmentSummary:
      properties:
        chargeId:
          type: string
          title: Chargeid
        providerId:
          anyOf:
            - type: string
            - type: 'null'
          title: Providerid
        locationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationid
        id:
          type: string
          title: Id
          description: Unique identifier for the adjustment
        amount:
          type: integer
          title: Amount
          description: Amount of the adjustment
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
          description: Reason for the adjustment
        createdDate:
          type: string
          format: date-time
          title: Createddate
          description: Date when the adjustment was created
        adjustmentType:
          $ref: '#/components/schemas/AdjustmentType'
          description: Type of the adjustment
      type: object
      required:
        - chargeId
        - id
        - amount
        - createdDate
        - adjustmentType
      title: AdjustmentSummary
    ChargePaymentDetail-Output:
      properties:
        paymentId:
          type: string
          title: Paymentid
          description: The unique identifier for the payment.
        amount:
          type: integer
          title: Amount
          description: The amount of the payment.
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
          description: The date and time the payment was created.
        chargeId:
          type: string
          title: Chargeid
          description: The unique identifier for the charge.
        payment:
          $ref: '#/components/schemas/Payment-Output'
          description: Detailed information about the payment.
      type: object
      required:
        - paymentId
        - amount
        - chargeId
        - payment
      title: ChargePaymentDetail
    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.
    UserType:
      type: string
      enum:
        - PROVIDER
        - PATIENT
        - ASSISTANT
      title: UserType
    PatientSource:
      type: string
      enum:
        - SELF_SCHEDULING
        - CALL
        - TEXT
        - MANUALLY_CREATED
        - UPLOADED_FROM_FILE
        - FORM
        - SEED_DATA
        - DEMO
        - EXTERNAL_INTEGRATION
        - REFERRAL
        - WEB_CHAT
        - META_ADS
        - GOOGLE_ADS
        - WEB_FORM
        - IMPORTED_CRM
        - OTHER
      title: PatientSource
    PatientTagSummary:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the patient tag
        name:
          type: string
          title: Name
          description: Name of the patient tag
        emoji:
          anyOf:
            - type: string
            - type: 'null'
          title: Emoji
          description: Emoji associated with the tag
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
          description: Color code for the tag (hex format)
        isActive:
          type: boolean
          title: Isactive
          description: Whether the tag is active
        createdDate:
          type: string
          format: date-time
          title: Createddate
          description: Date and time when the tag was created
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
          description: Date and time when the tag was last updated
      type: object
      required:
        - id
        - name
        - isActive
        - createdDate
      title: PatientTagSummary
    decoda__schemas__inventory__item__DiscountUse-Output:
      properties:
        discountId:
          anyOf:
            - type: string
            - type: 'null'
          title: Discountid
          description: Unique identifier for the discount (None if creating new discount)
        chargeItemId:
          anyOf:
            - type: string
            - type: 'null'
          title: Chargeitemid
          description: Unique identifier for the charge item
        amount:
          type: integer
          title: Amount
          description: Amount of the discount in cents
        order:
          type: integer
          title: Order
          description: Order in which the discount was applied (0-based)
        quantity:
          type: integer
          title: Quantity
          description: Number of units the discount applies to
        createDiscount:
          anyOf:
            - $ref: '#/components/schemas/CreateCustomDiscountRequest'
            - type: 'null'
          description: >-
            Data to create a new custom discount (only used if discount_id is
            None)
        discount:
          anyOf:
            - $ref: '#/components/schemas/DiscountOnChargeItemUse'
            - type: 'null'
          description: Hydrated discount (percentage/type) when loading persisted charges
      type: object
      required:
        - amount
        - order
        - quantity
      title: DiscountUse
    ItemType:
      type: string
      enum:
        - ITEM
        - SERVICE
        - PRODUCT
        - PACKAGE
        - MEMBERSHIP
        - MEDICATION
        - SERVICE_FEE
        - GIFT_CARD
      title: ItemType
    GiftCardRecipientInput:
      properties:
        patientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Patientid
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
        scheduledSendAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Scheduledsendat
        suppressRecipientNotification:
          type: boolean
          title: Suppressrecipientnotification
          description: >-
            When True, the recipient is not auto-notified (neither on activation
            nor via the scheduled-send heartbeat). Only meaningful when a
            recipient patient is set; staff can still send manually later.
          default: false
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: Optional provider-entered code for this individual gift card.
      type: object
      title: GiftCardRecipientInput
      description: |-
        One recipient/code entry on a gift-card charge item at checkout time.

        Positional: the Nth entry maps to the Nth pending IssuedGiftCard
        created for that line.

        `scheduled_send_at` is the time at which the recipient notification
        (SMS/email) should fire. It is stamped onto the pending IssuedGiftCard
        by `BillingService.__handle_gift_card_item` and picked up by the
        heartbeat-driven `GiftCardService.process_scheduled_sends`. None means
        "send as soon as the card is activated".
    ItemTiny:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the item
        name:
          type: string
          title: Name
          description: Name of the item
        brandName:
          anyOf:
            - type: string
            - type: 'null'
          title: Brandname
          description: Optional brand name of the item
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description of the item
        price:
          type: integer
          title: Price
          description: Price of the item in cents
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
          description: Category name (references category.name)
        unit:
          anyOf:
            - $ref: '#/components/schemas/Unit'
            - type: 'null'
          description: Unit of measurement for the item
        isPhysical:
          type: boolean
          title: Isphysical
          description: Whether the item is physical
          default: true
        isArchived:
          type: boolean
          title: Isarchived
          description: Whether the item is archived
          default: false
        internalNotes:
          anyOf:
            - type: string
            - type: 'null'
          title: Internalnotes
          description: Optional internal notes for the item
        sortOrder:
          anyOf:
            - type: integer
            - type: 'null'
          title: Sortorder
          description: Optional sort order for the item
        allowCustomPricing:
          type: boolean
          title: Allowcustompricing
          description: Whether custom pricing is allowed for this item
          default: false
        showInCheckOut:
          type: boolean
          title: Showincheckout
          description: Whether this item appears in checkout
          default: true
        type:
          $ref: '#/components/schemas/ItemType'
          description: Type of item (PRODUCT, MEDICATION, etc.)
          default: PRODUCT
        externalId:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalid
          description: Optional external ID for the item
        exemptedTaxIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Exemptedtaxids
          description: >-
            List of tax IDs that this item is exempted from (excludes from
            scope-based taxes)
        cost:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cost
          description: Cost of the item in cents
        cashPrice:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cashprice
          description: Cash price of the item in cents (for dual pricing)
        commissionable:
          type: boolean
          title: Commissionable
          description: Whether this item is eligible for commissions
          default: true
        tags:
          items:
            $ref: '#/components/schemas/ItemTagSummary'
          type: array
          title: Tags
          description: Tags assigned to this item
        hiddenInPatientPortal:
          type: boolean
          title: Hiddeninpatientportal
          description: Whether this item is hidden from the patient portal
          default: false
        hiddenInOnlineShop:
          type: boolean
          title: Hiddeninonlineshop
          description: Whether this item is hidden from the online shop
          default: true
        loyaltyPointsEarned:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Loyaltypointsearned
          description: Points earned when this item is purchased
        defaultCptCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Defaultcptcode
          description: Default CPT / HCPCS code for Super Bill autofill
        defaultModifiers:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Defaultmodifiers
          description: Default procedure modifiers for Super Bill autofill
        defaultIcd10Codes:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Defaulticd10Codes
          description: Default ICD-10 codes for Super Bill autofill
        defaultPlaceOfService:
          anyOf:
            - type: string
            - type: 'null'
          title: Defaultplaceofservice
          description: Default CMS Place of Service code for Super Bill autofill
      type: object
      required:
        - name
        - price
      title: ItemTiny
    ProviderTiny:
      properties:
        id:
          type: string
          title: Id
        firstName:
          type: string
          title: Firstname
        lastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastname
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
      type: object
      required:
        - id
        - firstName
      title: ProviderTiny
    AdjustmentType:
      type: string
      enum:
        - WRITE_OFF
        - ADJUSTMENT
        - EXTERNAL_SETTLEMENT
        - CASH_DISCOUNT
      title: AdjustmentType
    Payment-Output:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier for the payment.
        patientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Patientid
          description: The ID of the patient associated with the payment.
        payinId:
          anyOf:
            - type: string
            - type: 'null'
          title: Payinid
          description: The ID of the payin associated with the payment.
        amount:
          type: integer
          title: Amount
          description: The total amount of the payment.
        status:
          $ref: '#/components/schemas/PaymentStatus'
          description: The current status of the payment.
        currency:
          type: string
          title: Currency
          description: The currency in which the payment was made.
          default: USD
        payinConfigId:
          anyOf:
            - type: string
            - type: 'null'
          title: Payinconfigid
          description: The configuration ID for the payin.
        paymentMedium:
          type: string
          title: Paymentmedium
          description: The name of the payment medium.
        paymentMethodId:
          anyOf:
            - type: string
            - type: 'null'
          title: Paymentmethodid
          description: The ID of the payment method used.
        stripePaymentIntentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Stripepaymentintentid
          description: Stripe's payment intent ID if used.
        failedReason:
          anyOf:
            - type: string
            - type: 'null'
          title: Failedreason
          description: Reason for payment failure if applicable.
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
          description: The date and time the payment was last updated.
        createdDate:
          type: string
          format: date-time
          title: Createddate
          description: The date and time the payment was created.
        fee:
          type: integer
          title: Fee
          description: The fee charged by the payment processor.
          default: 0
        feeToPatient:
          type: integer
          title: Feetopatient
          description: The fee charged to the patient for the transaction.
          default: 0
        paymentMethod:
          anyOf:
            - $ref: '#/components/schemas/PaymentMethodSummary'
            - type: 'null'
          description: Summary of the payment method used.
        refunds:
          items:
            $ref: '#/components/schemas/RefundSummary-Output'
          type: array
          title: Refunds
          description: List of refunds associated with the payment.
          default: []
      type: object
      required:
        - id
        - amount
        - status
        - paymentMedium
        - createdDate
      title: Payment
    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
    CreateCustomDiscountRequest:
      properties:
        patientId:
          type: string
          title: Patientid
          description: ID of the patient
        itemId:
          anyOf:
            - type: string
            - type: 'null'
          title: Itemid
          description: ID of the item
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
          description: Category name
        itemType:
          anyOf:
            - $ref: '#/components/schemas/ItemType'
            - type: 'null'
          description: Item type
        type:
          anyOf:
            - $ref: '#/components/schemas/DiscountType'
            - type: 'null'
          description: >-
            Type of discount (defaults to CUSTOM, use GLOBAL for global
            discounts)
        percentage:
          anyOf:
            - type: number
              maximum: 100
              minimum: 0
            - type: 'null'
          title: Percentage
          description: Discount percentage (0-100)
        amount:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Amount
          description: Discount amount in cents
        quantity:
          anyOf:
            - type: integer
            - type: 'null'
          title: Quantity
          description: Quantity (None = infinite)
        expiryDate:
          anyOf:
            - type: string
            - type: 'null'
          title: Expirydate
          description: Expiry date
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
          description: Optional comment for the discount
        promotionId:
          anyOf:
            - type: string
            - type: 'null'
          title: Promotionid
          description: ID of the promotion this discount comes from
        discountTemplateId:
          anyOf:
            - type: string
            - type: 'null'
          title: Discounttemplateid
          description: >-
            ID of the discount template this in-cart benefit derives from (a
            package or membership being purchased in the same charge). Issuance
            nets the template's quantity by tagged usage.
      type: object
      required:
        - patientId
      title: CreateCustomDiscountRequest
      description: Schema for creating a custom discount (sent from frontend).
    DiscountOnChargeItemUse:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the discount
        type:
          $ref: '#/components/schemas/DiscountType'
          description: Type of discount
        percentage:
          anyOf:
            - type: number
            - type: 'null'
          title: Percentage
          description: Discount percentage (0-100)
        amount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Amount
          description: Fixed discount amount in cents, if any
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
          description: Optional comment for custom/global discounts
      type: object
      required:
        - id
        - type
      title: DiscountOnChargeItemUse
      description: |-
        Minimal discount fields hydrated on charge-item discount uses.

        Enough for checkout cash replay (percentage) and global-discount UI
        (type/comment) without pulling DiscountDetail.uses and related graphs.
    Unit:
      type: string
      enum:
        - AMPOULES
        - APPLICATORS
        - BOTTLES
        - BOXES
        - CAPSULES
        - CUPS
        - DOSES
        - G_PER_ML
        - GRAMS
        - IU
        - IU_PER_ML
        - OUNCES
        - FLUID_OUNCES
        - KG
        - KITS
        - LITERS
        - MCG
        - MG
        - MG_PER_ML
        - ML
        - MMOL
        - MICROGRAM_PER_ML
        - PACKS
        - PAIRS
        - PATCHES
        - PERCENTAGE
        - PIECES
        - POUCHES
        - ROLLS
        - SACHETS
        - SHEETS
        - SPRAYS
        - STRIPS
        - SYRINGES
        - TABLETS
        - TABLETS_PER_DAY
        - TESTS
        - TROCHES
        - TUBES
        - UNITS
        - VIALS
        - TREATMENTS
        - SESSIONS
        - PULSES
        - JOULES
        - CENTIMETERS
        - THREAD_COUNT
        - INJECTIONS
        - WRINKLE_UNITS
        - POUNDS
        - FEET
        - INCHES
      title: Unit
    ItemTagSummary:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
      type: object
      required:
        - id
        - name
      title: ItemTagSummary
    PaymentStatus:
      type: string
      enum:
        - CANCELED
        - CREATED
        - FAILED
        - IN_REVIEW
        - PRESENTING
        - PROCESSING
        - SUCCEEDED
      title: PaymentStatus
      description: >-
        Status of a Payment or Refund.


        NOTE for any "cash collected / refunded" or settlement-style query:

        both ``SUCCEEDED`` AND ``PROCESSING`` count as money committed.
        ``SUCCEEDED``

        means cleared in the bank account; ``PROCESSING`` means the transaction
        is

        in flight (e.g. ACH still settling) but the clinic should expect it.
        Most

        accounting / analytics aggregates that filter only on ``status ==
        SUCCEEDED``

        silently undercount real cash flow — use ``status IN (SUCCEEDED,
        PROCESSING)``

        unless you specifically want only fully-cleared funds.


        Use ``COMMITTED_PAYMENT_STATUSES`` below for the common case.
    PaymentMethodSummary:
      properties:
        id:
          type: string
          title: Id
        patientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Patientid
        rainforestPaymentMethodId:
          anyOf:
            - type: string
            - type: 'null'
          title: Rainforestpaymentmethodid
        brand:
          anyOf:
            - type: string
            - type: 'null'
          title: Brand
        last4:
          anyOf:
            - type: string
            - type: 'null'
          title: Last4
        expMonth:
          anyOf:
            - type: integer
            - type: 'null'
          title: Expmonth
        expYear:
          anyOf:
            - type: integer
            - type: 'null'
          title: Expyear
        accountHolderType:
          anyOf:
            - type: string
            - type: 'null'
          title: Accountholdertype
        accountNumberLast4:
          anyOf:
            - type: integer
            - type: 'null'
          title: Accountnumberlast4
        bankName:
          anyOf:
            - type: string
            - type: 'null'
          title: Bankname
        routingNumber:
          anyOf:
            - type: integer
            - type: 'null'
          title: Routingnumber
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        type:
          anyOf:
            - $ref: '#/components/schemas/PaymentMethodType'
            - type: 'null'
        cardType:
          anyOf:
            - $ref: '#/components/schemas/PaymentCardType'
            - type: 'null'
        isDefault:
          type: boolean
          title: Isdefault
          default: false
        isArchived:
          type: boolean
          title: Isarchived
          default: false
        availableMerchantIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Availablemerchantids
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
      type: object
      required:
        - id
        - patientId
        - rainforestPaymentMethodId
        - brand
        - last4
        - expMonth
        - expYear
        - accountHolderType
        - accountNumberLast4
        - bankName
        - routingNumber
        - description
        - type
      title: PaymentMethodSummary
    RefundSummary-Output:
      properties:
        id:
          type: string
          title: Id
        paymentId:
          type: string
          title: Paymentid
        amount:
          type: integer
          title: Amount
        reason:
          $ref: '#/components/schemas/RefundReason'
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        createdDate:
          type: string
          format: date-time
          title: Createddate
        status:
          $ref: '#/components/schemas/PaymentStatus'
        rainforestRefundId:
          anyOf:
            - type: string
            - type: 'null'
          title: Rainforestrefundid
        fee:
          type: integer
          title: Fee
          default: 0
        surchargeAmount:
          type: integer
          title: Surchargeamount
          default: 0
        reconciliationStatus:
          $ref: '#/components/schemas/RefundReconciliationStatus'
          default: NOT_REQUIRED
        refundDestination:
          $ref: '#/components/schemas/RefundDestination'
          default: ORIGINAL_METHOD
        patientCreditId:
          anyOf:
            - type: string
            - type: 'null'
          title: Patientcreditid
        items:
          items:
            $ref: '#/components/schemas/RefundItemSummary'
          type: array
          title: Items
      type: object
      required:
        - id
        - paymentId
        - amount
        - reason
        - createdDate
        - status
      title: RefundSummary
    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
    DiscountType:
      type: string
      enum:
        - GLOBAL
        - CUSTOM
        - MEMBERSHIP
        - PACKAGE
        - SAVED_ITEM
        - PROMOTION
      title: DiscountType
    PaymentMethodType:
      type: string
      enum:
        - CARD
        - ACH
        - APPLE_PAY
      title: PaymentMethodType
    PaymentCardType:
      type: string
      enum:
        - CREDIT
        - DEBIT
        - PREPAID
      title: PaymentCardType
    RefundReason:
      type: string
      enum:
        - DUPLICATE
        - DISPUTE
        - BOOKING_FEE
        - SERVICE_ISSUE
        - PRODUCT_RETURN
        - APPLIED_TO_OTHER_PURCHASE
        - PROVIDER_CANCELLATION
        - PATIENT_CANCELLATION
        - MEDICAL_REASON
        - GOODWILL
        - OTHER
      title: RefundReason
    RefundReconciliationStatus:
      type: string
      enum:
        - NOT_REQUIRED
        - PENDING
        - RECONCILED
      title: RefundReconciliationStatus
      description: >-
        Aggregate state of a refund's operational reversals (not its money
        movement).


        Correctness lives in the per-effect markers; this column is the index
        the

        reconcile-recovery worker queries to find refunds whose effects still
        need

        applying, plus a UI signal.


        - NOT_REQUIRED: no item carried any ``reversal_actions``.

        - PENDING: money settled (or settling); effects not yet fully applied.

        - RECONCILED: all selected reversals applied.
    RefundDestination:
      type: string
      enum:
        - ORIGINAL_METHOD
        - PATIENT_CREDIT
      title: RefundDestination
    RefundItemSummary:
      properties:
        id:
          type: string
          title: Id
        chargeItemId:
          type: string
          title: Chargeitemid
        pricingMode:
          $ref: '#/components/schemas/RefundItemPricingMode'
        amount:
          type: integer
          title: Amount
        taxAmount:
          type: integer
          title: Taxamount
          default: 0
        quantity:
          anyOf:
            - type: number
            - type: 'null'
          title: Quantity
        soldPackageId:
          anyOf:
            - type: string
            - type: 'null'
          title: Soldpackageid
        issuedGiftCardId:
          anyOf:
            - type: string
            - type: 'null'
          title: Issuedgiftcardid
        reversalActions:
          items:
            $ref: '#/components/schemas/RefundItemAction'
          type: array
          title: Reversalactions
      type: object
      required:
        - id
        - chargeItemId
        - pricingMode
        - amount
      title: RefundItemSummary
    RefundItemPricingMode:
      type: string
      enum:
        - QUANTITY
        - PACKAGE_REMAINING_VALUE
      title: RefundItemPricingMode
      description: How the backend derives one RefundItem's authoritative value.
    RefundItemAction:
      type: string
      enum:
        - RESTORE_INVENTORY
        - RESTORE_MEMBER_DISCOUNT
        - RESTORE_SAVED_ITEM
        - CANCEL_PACKAGE
        - RESTORE_PACKAGE_SESSION
        - REVERSE_MEMBERSHIP
        - DISABLE_GIFT_CARD
        - REVOKE_LOYALTY
        - REVOKE_BANKED_VALUE
      title: RefundItemAction
      description: >-
        Operational side effects a refunded item may reverse, selected per
        RefundItem.


        Stored as an ``ARRAY(TypedEnum(RefundItemAction))`` on
        ``refund_item.reversal_actions``.

        An empty array means the item refunds money only, with no operational
        reversal.

        Each value is applied by the reconciler after the refund's money
        movement succeeds,

        and every application writes an idempotent marker keyed by
        ``refund_item_id``.

````