> ## 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 Patient Credit Payment

> Pay off a charge using the patient's available patient credit balance.



## OpenAPI

````yaml post /billing/payment/patient-credit/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/patient-credit/create:
    post:
      tags:
        - provider
        - billing
      summary: Create Patient Credit Payment
      operationId: create_patient_credit_payment_billing_payment_patient_credit_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
        payments:
          items:
            $ref: '#/components/schemas/ChargeTablePayment-Input'
          type: array
          title: Payments
        plannedPayments:
          items:
            $ref: '#/components/schemas/ChargeTablePlannedPayment'
          type: array
          title: Plannedpayments
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
        items:
          items:
            $ref: '#/components/schemas/ChargeItem'
          type: array
          title: Items
        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
        - adjustments
        - payments
        - plannedPayments
        - items
      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.
      type: object
      required:
        - id
        - amount
        - status
        - paymentMedium
        - createdDate
        - feeToPatient
      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:
            - 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.
        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.
        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.
        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.
      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
      type: object
      required:
        - id
        - amount
        - status
        - createdDate
        - paymentMedium
        - refunds
      title: ChargeTablePayment
    ChargeTablePlannedPayment:
      properties:
        id:
          type: string
          title: Id
        amount:
          type: integer
          title: Amount
        status:
          $ref: '#/components/schemas/PlannedPaymentStatus'
        paymentDate:
          type: string
          format: date-time
          title: Paymentdate
      type: object
      required:
        - id
        - amount
        - status
        - paymentDate
      title: ChargeTablePlannedPayment
    ChargeItem:
      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:
          type: string
          title: Chargeid
          description: Identifier of the charge this item is associated with
        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: integer
          title: Quantity
          description: Quantity of the item being charged
        discountAmount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Discountamount
          description: Discount amount for the item
        discountPercentage:
          anyOf:
            - type: number
            - type: 'null'
          title: Discountpercentage
          description: Discount percentage for the item
        discountReason:
          anyOf:
            - type: string
            - type: 'null'
          title: Discountreason
          description: Reason for discount
        price:
          type: integer
          title: Price
          description: Price of the item in cents
        soldPackageId:
          anyOf:
            - type: string
            - type: 'null'
          title: Soldpackageid
          description: Unique identifier for the sold package usage
        bankedQuantity:
          anyOf:
            - type: integer
            - type: 'null'
          title: Bankedquantity
          description: Quantity to bank for later use
        bankedItemId:
          anyOf:
            - type: string
            - type: 'null'
          title: Bankeditemid
          description: ID of banked item being used (for tracking usage)
        issuedDiscountId:
          anyOf:
            - type: string
            - type: 'null'
          title: Issueddiscountid
          description: Unique identifier for the specific issued discount instance used
        soldByProviderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Soldbyproviderid
          description: Unique identifier for the provider who sold the item
        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
        shipmentIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Shipmentids
          description: Optional list of shipment IDs to reduce the stock quantity of
      type: object
      required:
        - chargeId
        - 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
        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
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    UserType:
      type: string
      enum:
        - PROVIDER
        - PATIENT
        - ASSISTANT
      title: UserType
    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
      title: AdjustmentType
    PaymentMethodSummary:
      properties:
        id:
          type: string
          title: Id
        patientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Patientid
        rainforestPaymentMethodId:
          type: string
          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'
        isDefault:
          type: boolean
          title: Isdefault
          default: false
        isArchived:
          type: boolean
          title: Isarchived
          default: false
      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
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        creator:
          anyOf:
            - $ref: '#/components/schemas/UserTiny'
            - type: 'null'
      type: object
      required:
        - id
        - amount
        - reason
        - createdDate
      title: TableRefund
    PlannedPaymentStatus:
      type: string
      enum:
        - SCHEDULED
        - COMPLETED
        - FAILED
        - CANCELLED
      title: PlannedPaymentStatus
    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
    RefundReason:
      type: string
      enum:
        - DUPLICATE
        - DISPUTE
        - BOOKING_FEE
        - OTHER
      title: RefundReason

````