> ## Documentation Index
> Fetch the complete documentation index at: https://docs.old.palomma.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Payin Source



## OpenAPI

````yaml POST /payinSources
openapi: 3.0.0
info:
  title: Palomma API
  description: This API includes functionality of the Palomma API.
  version: 1.0.0
servers:
  - url: https://api.palomma.com/v0
    description: Production server
  - url: https://sandbox.api.palomma.com/v0
    description: Sandbox server
security:
  - BearerAuth: []
paths:
  /payinSources:
    post:
      tags:
        - Payin Sources
      summary: Creates a new Payin Source
      operationId: createPayinSource
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/PayinSourceBankAccount'
                - $ref: '#/components/schemas/PayinSourceBancolombiaToken'
                - $ref: '#/components/schemas/PayinSourceNequiToken'
      responses:
        '200':
          description: Payin Source created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayinSource'
        '400':
          description: Bad Request - Invalid input provided
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Description of the error due to bad request.
        '401':
          description: >-
            Unauthorized - Authentication credentials were not provided or are
            invalid
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Description of the error due to unauthorized access.
        '500':
          description: Internal Server Error - An error occurred on the server
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Description of the internal server error.
components:
  schemas:
    PayinSourceBankAccount:
      title: Bank Account
      type: object
      required:
        - customerId
        - redirectUrl
        - type
        - bankAccount
      properties:
        reference:
          type: string
          description: >-
            An optional reference provided by the merchant to identify the Payin
            Source.
        description:
          type: string
          description: An optional description of the Payin Source.
        customerId:
          type: string
          description: The ID of the customer for whom the Payin Source is created.
        redirectUrl:
          type: string
          description: >-
            URL to which the customer will be redirected after the authorization
            process.
        type:
          type: string
          enum:
            - bankAccount
        bankAccount:
          $ref: '#/components/schemas/BcolDirectDebitBankAccount'
          type: object
        partialPayinsEnabled:
          type: boolean
          description: >-
            Only available for Bancolombia. Partial debit will be made if the
            account does not have sufficient funds to debit the total amount. By
            default, no partial debits will be made.
    PayinSourceBancolombiaToken:
      title: Bancolombia Token
      type: object
      required:
        - customerId
        - redirectUrl
        - type
      properties:
        reference:
          type: string
          description: >-
            An optional reference provided by the merchant to identify the Payin
            Source.
        description:
          type: string
          description: An optional description of the Payin Source.
        customerId:
          type: string
          description: The ID of the customer for whom the Payin Source is created.
        redirectUrl:
          type: string
          description: >-
            URL to which the customer will be redirected after the authorization
            process.
        type:
          type: string
          enum:
            - bancolombiaToken
    PayinSourceNequiToken:
      title: Nequi Token
      type: object
      required:
        - customerId
        - redirectUrl
        - type
        - phoneNumber
      properties:
        reference:
          type: string
          description: >-
            An optional reference provided by the merchant to identify the Payin
            Source.
        description:
          type: string
          description: An optional description of the Payin Source.
        customerId:
          type: string
          description: The ID of the customer for whom the Payin Source is created.
        redirectUrl:
          type: string
          description: >-
            URL to which the customer will be redirected after the authorization
            process.
        type:
          type: string
          enum:
            - nequiToken
        phoneNumber:
          type: string
          description: Customer’s phone number.
    PayinSource:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for this Payin Source.
          example: 01HPR7A40E44S0WDR189YXA8GH
        reference:
          type: string
          description: Reference sent in by merchant to identify Payin Source.
        description:
          type: string
          description: An extra metadata field that can be included for visibility.
        customerId:
          type: string
          description: Reference to customer who owns this Payin Source.
        customerDetails:
          $ref: '#/components/schemas/CustomerDetails'
        status:
          type: string
          description: Status of the Payin Source.
          enum:
            - pending
            - processing
            - active
            - cancelled
        statusMessage:
          $ref: '#/components/schemas/StatusMessage'
        authUrl:
          type: string
          description: >-
            URL where the customer should be redirected to complete the account
            authentication and debit authorization.
        redirectUrl:
          type: string
          description: URL where the customer will be redirected after auth flow.
        partialPayinsEnabled:
          type: boolean
          description: >-
            Only available for Bancolombia. Partial debit will be made if the
            account does not have sufficient funds to debit the total amount. By
            default, no partial debits will be made.
        type:
          type: string
          description: Type of Payin Source created.
          enum:
            - bankAccount
            - bancolombiaToken
            - nequiToken
        createdAt:
          type: string
          format: date-time
          description: ISO string indicating when the Payin Source was created.
        updatedAt:
          type: string
          format: date-time
          description: ISO string indicating when the Payin Source was last updated.
    BcolDirectDebitBankAccount:
      type: object
      properties:
        bank:
          $ref: '#/components/schemas/BcolDirectDebitBank'
        accountType:
          type: string
          description: The type of the bank account.
          enum:
            - savings
            - checking
        accountNumber:
          type: string
          description: The bank account number.
    CustomerDetails:
      type: object
      properties:
        reference:
          type: string
          description: >-
            An optional reference provided by the merchant to identify the
            customer.
        name:
          type: string
          description: >-
            First and last name for a natural person, and company name for a
            juridical person.
          example: Pepito Perez
        documentType:
          type: string
          description: Colombian ID type for customer.
          enum:
            - cc
            - ce
            - nit
        documentNumber:
          type: string
          description: Colombian ID number for customer.
          example: '1037551022'
        email:
          type: string
          description: Customer’s email.
          format: email
          example: pepito@gmail.com
        phoneNumber:
          type: string
          description: Customer’s phone number.
          example: '3013111111'
    StatusMessage:
      type: string
      description: >-
        Additional detail on the status. Only present when status is
        "cancelled".
      enum:
        - AUTHENTICATION_FAILED
        - CUSTOMER_CANCELLATION
        - DECLINED_BY_BANK
        - EXPIRED
        - INVALID_ACCOUNT
        - NOT_ENOUGH_FUNDS
        - ERROR
    BcolDirectDebitBank:
      type: string
      description: The list of banks supported by the Palomma API.
      enum:
        - santander
        - coofinep
        - avvillas
        - rappipay
        - nequi
        - bancoagrario
        - bancoomeva
        - coopcentral
        - citibank
        - bancodeoccidente
        - bancodebogota
        - bancocajasocial
        - serfinanza
        - bancopopular
        - daviplata
        - bancolombia
        - scotiabankcolpatria
        - gnbsudameris
        - itau
        - bbva
        - davivienda
        - mibanco
        - multibank
        - mundomujer
        - juriscoop
        - itauhelm
        - jpmorgancolombia
        - btgpactual
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````