> ## 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 Payment Method

> Adds a payment method to a patient.



## OpenAPI

````yaml post /user/patient/payment-methods/create
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /user/patient/payment-methods/create:
    post:
      tags:
        - provider
        - user
        - mfa
      summary: Create Payment Method
      description: Adds a payment method to a patient.
      operationId: create_payment_method_user_patient_payment_methods_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
        - name: patient_id
          in: query
          required: true
          schema:
            type: string
            description: ID of the patient to add the payment method to
            title: Patient Id
          description: ID of the patient to add the payment method to
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RainforestPaymentMethod'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethodSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    RainforestPaymentMethod:
      properties:
        paymentMethodId:
          type: string
          title: Paymentmethodid
        paymentMethodConfigId:
          type: string
          title: Paymentmethodconfigid
        fingerprint:
          anyOf:
            - type: string
            - type: 'null'
          title: Fingerprint
        methodType:
          type: string
          title: Methodtype
        card:
          anyOf:
            - $ref: '#/components/schemas/RainforestCard'
            - type: 'null'
        ach:
          anyOf:
            - $ref: '#/components/schemas/RainforestACH'
            - type: 'null'
        applePay:
          anyOf:
            - $ref: '#/components/schemas/ApplePay'
            - type: 'null'
        billingContact:
          anyOf:
            - $ref: '#/components/schemas/BillingContact'
            - type: 'null'
        metadata:
          type: object
          title: Metadata
        createdAt:
          type: string
          title: Createdat
        updatedAt:
          type: string
          title: Updatedat
      type: object
      required:
        - paymentMethodId
        - paymentMethodConfigId
        - fingerprint
        - methodType
        - card
        - ach
        - applePay
        - billingContact
        - metadata
        - createdAt
        - updatedAt
      title: RainforestPaymentMethod
    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
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RainforestCard:
      properties:
        brand:
          type: string
          title: Brand
        last4:
          type: string
          title: Last4
        expMonth:
          type: integer
          title: Expmonth
        expYear:
          type: integer
          title: Expyear
      type: object
      required:
        - brand
        - last4
        - expMonth
        - expYear
      title: RainforestCard
      description: The card used to pay for the payin
    RainforestACH:
      properties:
        accountHolderType:
          type: string
          title: Accountholdertype
        accountNumberLast4:
          type: string
          title: Accountnumberlast4
        bankName:
          type: string
          title: Bankname
        routingNumber:
          type: string
          title: Routingnumber
      type: object
      required:
        - accountHolderType
        - accountNumberLast4
        - bankName
        - routingNumber
      title: RainforestACH
      description: The ACH used to pay for the payin
    ApplePay:
      properties:
        type:
          type: string
          title: Type
        brand:
          type: string
          title: Brand
        brandDesc:
          type: string
          title: Branddesc
        description:
          type: string
          title: Description
      type: object
      required:
        - type
        - brand
        - brandDesc
        - description
      title: ApplePay
    BillingContact:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        addressLine1:
          anyOf:
            - type: string
            - type: 'null'
          title: Addressline1
        addressLine2:
          anyOf:
            - type: string
            - type: 'null'
          title: Addressline2
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        postalCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Postalcode
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
      type: object
      required:
        - name
        - addressLine1
        - addressLine2
        - city
        - state
        - postalCode
        - country
        - email
        - phone
      title: BillingContact
    PaymentMethodType:
      type: string
      enum:
        - CARD
        - ACH
        - APPLE_PAY
      title: PaymentMethodType
    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

````