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

# Create Loyalty Points Payment

> Pay off a charge using the patient's loyalty points balance.



## OpenAPI

````yaml post /billing/payment/loyalty-points/create
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /billing/payment/loyalty-points/create:
    post:
      tags:
        - Payments
      summary: Create Loyalty Points Payment
      description: Pay off a charge using the patient's loyalty points balance.
      operationId: create_loyalty_points_payment_billing_payment_loyalty_points_create_post
      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
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChargeTable-Input'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ChargeTable-Input:
      properties:
        id:
          type: string
          title: Id
        total:
          type: integer
          title: Total
        totalOutstanding:
          type: integer
          title: Totaloutstanding
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        status:
          $ref: '#/components/schemas/ChargeStatus'
        patient:
          $ref: '#/components/schemas/PatientSummary'
        ruleSetId:
          anyOf:
            - type: string
            - type: 'null'
          title: Rulesetid
        externalCreatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Externalcreateddate
        createdDate:
          type: string
          format: date-time
          title: Createddate
        externalId:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalid
        creator:
          anyOf:
            - $ref: '#/components/schemas/UserTiny'
            - type: 'null'
        adjustments:
          items:
            $ref: '#/components/schemas/AdjustmentSummary'
          type: array
          title: Adjustments
          default: []
        payments:
          items:
            $ref: '#/components/schemas/ChargeTablePayment-Input'
          type: array
          title: Payments
          default: []
        plannedPayments:
          items:
            $ref: '#/components/schemas/ChargeTablePlannedPayment'
          type: array
          title: Plannedpayments
          default: []
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
        items:
          items:
            $ref: '#/components/schemas/ChargeItemDetail-Input'
          type: array
          title: Items
          default: []
        locationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationid
        tips:
          items:
            $ref: '#/components/schemas/TipDetail'
          type: array
          title: Tips
          description: List of `Tips` in the `Charge`.
          default: []
      type: object
      required:
        - id
        - total
        - totalOutstanding
        - status
        - patient
        - createdDate
      title: ChargeTable
    PaymentSummary:
      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
      type: object
      required:
        - id
        - amount
        - status
        - paymentMedium
        - createdDate
      title: Payment
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ChargeStatus:
      type: string
      enum:
        - OUTSTANDING
        - PAID
        - EXTERNAL_SETTLEMENT
        - VOID
        - WRITE_OFF
        - REFUNDED
        - CHARGEBACK
        - PAYMENT_PLAN
        - COLLECTIONS
      title: ChargeStatus
    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
    UserTiny:
      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.
      type: object
      required:
        - id
        - type
      title: UserTiny
    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
    ChargeTablePayment-Input:
      properties:
        id:
          type: string
          title: Id
        amount:
          type: integer
          title: Amount
        status:
          $ref: '#/components/schemas/PaymentStatus'
        createdDate:
          type: string
          format: date-time
          title: Createddate
        paymentMedium:
          type: string
          title: Paymentmedium
        paymentMethod:
          anyOf:
            - $ref: '#/components/schemas/PaymentMethodSummary'
            - type: 'null'
        refunds:
          items:
            $ref: '#/components/schemas/TableRefund-Input'
          type: array
          title: Refunds
        chargebackTier:
          anyOf:
            - $ref: '#/components/schemas/ChargebackTier'
            - type: 'null'
        chargebackDueDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Chargebackduedate
      type: object
      required:
        - id
        - amount
        - status
        - createdDate
        - paymentMedium
        - refunds
      title: ChargeTablePayment
    ChargeTablePlannedPayment:
      properties:
        id:
          type: string
          title: Id
        paymentPlanId:
          type: string
          title: Paymentplanid
        paymentMethodId:
          type: string
          title: Paymentmethodid
        amount:
          type: integer
          title: Amount
        status:
          $ref: '#/components/schemas/PlannedPaymentStatus'
        paymentDate:
          type: string
          format: date-time
          title: Paymentdate
      type: object
      required:
        - id
        - paymentPlanId
        - paymentMethodId
        - amount
        - status
        - paymentDate
      title: ChargeTablePlannedPayment
    ChargeItemDetail-Input:
      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/DiscountUse-Input'
          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
    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.
    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
    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
    AdjustmentType:
      type: string
      enum:
        - WRITE_OFF
        - ADJUSTMENT
        - EXTERNAL_SETTLEMENT
        - CASH_DISCOUNT
      title: AdjustmentType
    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
    TableRefund-Input:
      properties:
        id:
          type: string
          title: Id
        amount:
          type: integer
          title: Amount
        reason:
          $ref: '#/components/schemas/RefundReason'
        createdDate:
          type: string
          format: date-time
          title: Createddate
        status:
          $ref: '#/components/schemas/PaymentStatus'
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        creator:
          anyOf:
            - $ref: '#/components/schemas/UserTiny'
            - type: 'null'
        hasItemAttribution:
          type: boolean
          title: Hasitemattribution
          default: false
      type: object
      required:
        - id
        - amount
        - reason
        - createdDate
        - status
      title: TableRefund
    ChargebackTier:
      type: string
      enum:
        - ACTION_REQUIRED
        - IN_PROGRESS
        - FAVORABLE
        - UNFAVORABLE
      title: ChargebackTier
    PlannedPaymentStatus:
      type: string
      enum:
        - SCHEDULED
        - COMPLETED
        - FAILED
        - CANCELLED
      title: PlannedPaymentStatus
    DiscountUse-Input:
      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
    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
    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
    DiscountType:
      type: string
      enum:
        - GLOBAL
        - CUSTOM
        - MEMBERSHIP
        - PACKAGE
        - SAVED_ITEM
        - PROMOTION
      title: DiscountType

````