> ## 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 Rainforest Payin Config

> Create a Rainforest payin config and session for collecting an insurance payment.



## OpenAPI

````yaml post /billing/insurance-payment/create-rainforest-payin-config
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /billing/insurance-payment/create-rainforest-payin-config:
    post:
      tags:
        - provider
        - billing
      summary: Create Rainforest Payin Config
      operationId: >-
        create_rainforest_payin_config_billing_insurance_payment_create_rainforest_payin_config_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/InsurancePaymentCreate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayinComponentSetupResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    InsurancePaymentCreate:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the insurance payment.
        insurer:
          type: string
          title: Insurer
          description: Name of the insurer.
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
          description: Optional comment about the payment.
        amount:
          type: integer
          title: Amount
          description: Amount of the payment.
        currency:
          type: string
          title: Currency
          description: Currency of the payment.
          default: USD
        locationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationid
          description: Location of the payment.
        creatorId:
          anyOf:
            - type: string
            - type: 'null'
          title: Creatorid
          description: ID of the provider who created this payment.
      type: object
      required:
        - id
        - insurer
        - amount
      title: InsurancePaymentCreate
    PayinComponentSetupResponse:
      properties:
        sessionKey:
          type: string
          title: Sessionkey
        payinConfigId:
          type: string
          title: Payinconfigid
        paymentMethods:
          items:
            $ref: '#/components/schemas/PaymentMethodSummary'
          type: array
          title: Paymentmethods
          default: []
        sandbox:
          type: boolean
          title: Sandbox
      type: object
      required:
        - sessionKey
        - payinConfigId
        - sandbox
      title: PayinComponentSetupResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
    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
    PaymentMethodType:
      type: string
      enum:
        - CARD
        - ACH
        - APPLE_PAY
      title: PaymentMethodType

````