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

# Move Payment

> Move a payment and all related objects from one patient to another.

This function updates:
1. The payment itself (patient_id)
2. Payment method used for the payment (patient_id) if it exists
3. All charges associated with this payment (patient_id)
4. All alerts related to the payment (patient_id)
5. All alerts related to the charges (patient_id)
6. All alerts related to adjustments of the charges (patient_id)
7. All alerts related to refunds of the payment (patient_id)



## OpenAPI

````yaml post /billing/payment/move
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/move:
    post:
      tags:
        - provider
        - billing
      summary: Move Payment
      description: |-
        Move a payment and all related objects from one patient to another.

        This function updates:
        1. The payment itself (patient_id)
        2. Payment method used for the payment (patient_id) if it exists
        3. All charges associated with this payment (patient_id)
        4. All alerts related to the payment (patient_id)
        5. All alerts related to the charges (patient_id)
        6. All alerts related to adjustments of the charges (patient_id)
        7. All alerts related to refunds of the payment (patient_id)
      operationId: move_payment_billing_payment_move_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/MovePaymentRequest'
        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:
    MovePaymentRequest:
      properties:
        paymentId:
          type: string
          title: Paymentid
          description: The ID of the payment to move.
        newPatientId:
          type: string
          title: Newpatientid
          description: The ID of the patient to move the payment to.
      type: object
      required:
        - paymentId
        - newPatientId
      title: MovePaymentRequest
      description: Request to move a payment from one patient to another.
    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
    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

````