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

# Update Payment Medium

> Update the payment medium for an external settlement payment.

Only non-card payments can have their medium changed.
The new payment medium must be a valid external settlement type.



## OpenAPI

````yaml post /billing/payment/update-medium
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/update-medium:
    post:
      tags:
        - Payments
      summary: Update Payment Medium
      description: |-
        Update the payment medium for an external settlement payment.

        Only non-card payments can have their medium changed.
        The new payment medium must be a valid external settlement type.
      operationId: update_payment_medium_billing_payment_update_medium_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:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePaymentMediumRequest'
        required: true
      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:
    UpdatePaymentMediumRequest:
      properties:
        paymentId:
          type: string
          title: Paymentid
          description: The ID of the payment to update.
        newPaymentMedium:
          type: string
          title: Newpaymentmedium
          description: The new payment medium name.
      type: object
      required:
        - paymentId
        - newPaymentMedium
      title: UpdatePaymentMediumRequest
      description: Request to update the payment medium for an external settlement payment.
    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
    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

````