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

> Create a loyalty points payment and return its resulting loyalty state.



## OpenAPI

````yaml post /billing/payment-terminal/charge/create-loyalty-points-settled
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-terminal/charge/create-loyalty-points-settled:
    post:
      tags:
        - Payment Terminals
      summary: Create Loyalty Points Settled
      description: Create a loyalty points payment and return its resulting loyalty state.
      operationId: >-
        create_loyalty_points_settled_billing_payment_terminal_charge_create_loyalty_points_settled_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
        - name: amount
          in: query
          required: true
          schema:
            type: integer
            title: Amount
        - name: grant_ids
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: Specific grant IDs to use for payment
            title: Grant Ids
          description: Specific grant IDs to use for payment
        - name: absorbed_source_charge_ids
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: >-
              Outstanding charges absorbed into this checkout; archived on
              payment success.
            title: Absorbed Source Charge Ids
          description: >-
            Outstanding charges absorbed into this checkout; archived on payment
            success.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/ChargeDetail-Input'
              title: Charge Creates
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoyaltyPointsPaymentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ChargeDetail-Input:
      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/ChargeItem-Input'
          type: array
          title: Items
          description: List of `Items` in the `Charge`.
          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.
        payments:
          items:
            $ref: '#/components/schemas/ChargePaymentDetail-Input'
          type: array
          title: Payments
          description: List of `Payments` in the `Charge`.
          default: []
        adjustments:
          items:
            $ref: '#/components/schemas/AdjustmentSummary'
          type: array
          title: Adjustments
          description: List of `Adjustments` in the `Charge`.
          default: []
      type: object
      required:
        - patientId
        - totalOutstanding
      title: ChargeDetail
      description: Unified Charge model for both creation and representation.
    LoyaltyPointsPaymentResponse:
      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
        loyaltyPoints:
          anyOf:
            - $ref: '#/components/schemas/LoyaltyPointState'
            - type: 'null'
      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
    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
    ChargeItem-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.
      type: object
      required:
        - quantity
        - price
      title: ChargeItem
    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
    ChargePaymentDetail-Input:
      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-Input'
          description: Detailed information about the payment.
      type: object
      required:
        - paymentId
        - amount
        - chargeId
        - payment
      title: ChargePaymentDetail
    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
    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.
    LoyaltyPointState:
      properties:
        grants:
          $ref: '#/components/schemas/Page_LoyaltyPointGrantSummary_'
        available:
          $ref: '#/components/schemas/AvailableLoyaltyPointsResponse'
        log:
          items:
            $ref: '#/components/schemas/LoyaltyPointTransactionSummary'
          type: array
          title: Log
      type: object
      required:
        - grants
        - available
        - log
      title: LoyaltyPointState
      description: Complete server state needed to update loyalty-point query caches.
    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
    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".
    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
    Payment-Input:
      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-Input'
          type: array
          title: Refunds
          description: List of refunds associated with the payment.
          default: []
      type: object
      required:
        - id
        - amount
        - status
        - paymentMedium
        - createdDate
      title: Payment
    AdjustmentType:
      type: string
      enum:
        - WRITE_OFF
        - ADJUSTMENT
        - EXTERNAL_SETTLEMENT
        - CASH_DISCOUNT
      title: AdjustmentType
    Page_LoyaltyPointGrantSummary_:
      properties:
        data:
          items:
            $ref: '#/components/schemas/LoyaltyPointGrantSummary'
          type: array
          title: Data
        total:
          type: integer
          title: Total
      type: object
      required:
        - data
        - total
      title: Page[LoyaltyPointGrantSummary]
    AvailableLoyaltyPointsResponse:
      properties:
        totalAvailable:
          type: integer
          title: Totalavailable
        grants:
          items:
            $ref: '#/components/schemas/AvailableLoyaltyGrant'
          type: array
          title: Grants
        count:
          type: integer
          title: Count
        redemptionRateCentsPerPoint:
          type: integer
          title: Redemptionratecentsperpoint
      type: object
      required:
        - totalAvailable
        - grants
        - count
        - redemptionRateCentsPerPoint
      title: AvailableLoyaltyPointsResponse
    LoyaltyPointTransactionSummary:
      properties:
        id:
          type: string
          title: Id
        balanceId:
          type: string
          title: Balanceid
          description: ID of the loyalty grant this transaction belongs to
        type:
          $ref: '#/components/schemas/BalanceTransactionType'
        amount:
          type: integer
          title: Amount
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
        createdDate:
          type: string
          format: date-time
          title: Createddate
        actor:
          anyOf:
            - $ref: '#/components/schemas/UserTiny'
            - type: 'null'
      type: object
      required:
        - id
        - balanceId
        - type
        - amount
        - createdDate
      title: LoyaltyPointTransactionSummary
      description: One entry in a patient's loyalty-points activity log.
    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.
    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-Input:
      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
    LoyaltyPointGrantSummary:
      properties:
        id:
          type: string
          title: Id
        patientId:
          type: string
          title: Patientid
        amount:
          type: integer
          title: Amount
        amountRemaining:
          type: integer
          title: Amountremaining
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
        expiryDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expirydate
        memberId:
          anyOf:
            - type: string
            - type: 'null'
          title: Memberid
        sourceType:
          $ref: '#/components/schemas/LoyaltyPointSourceType'
        createdDate:
          type: string
          format: date-time
          title: Createddate
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
        voidedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Voidedat
        creator:
          anyOf:
            - $ref: '#/components/schemas/UserTiny'
            - type: 'null'
      type: object
      required:
        - id
        - patientId
        - amount
        - amountRemaining
        - sourceType
        - createdDate
      title: LoyaltyPointGrantSummary
    AvailableLoyaltyGrant:
      properties:
        grantId:
          type: string
          title: Grantid
        remainingPoints:
          type: integer
          title: Remainingpoints
        totalPoints:
          type: integer
          title: Totalpoints
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
        expiryDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expirydate
        createdDate:
          type: string
          format: date-time
          title: Createddate
      type: object
      required:
        - grantId
        - remainingPoints
        - totalPoints
        - createdDate
      title: AvailableLoyaltyGrant
    BalanceTransactionType:
      type: string
      enum:
        - REDEMPTION
        - REDEMPTION_REVERSAL
        - REFUND
        - ADJUSTMENT_INCREASE
        - ADJUSTMENT_DECREASE
        - EXPIRY
        - PURCHASE_REFUND
        - VOID
        - TRANSFER_OUT
        - TRANSFER_IN
      title: BalanceTransactionType
    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
    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
    LoyaltyPointSourceType:
      type: string
      enum:
        - PURCHASE
        - MEMBERSHIP_CYCLE
        - PROMOTION
        - MANUAL
        - IMPORT
      title: LoyaltyPointSourceType
    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``.

````