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

<Tip>
  Use link type `general` if you want Palomma to collect payment method details.
</Tip>


## OpenAPI

````yaml POST /payinLinks
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:
  /payinLinks:
    post:
      tags:
        - Payin Links
      summary: Creates a new Payin Link
      operationId: createPayinLink
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/PayinLinkGeneral'
                - $ref: '#/components/schemas/PayinLinkPSE'
                - $ref: '#/components/schemas/PayinLinkBancolombiaButton'
                - $ref: '#/components/schemas/PayinLinkNequiButton'
                - $ref: '#/components/schemas/PayinLinkCard'
                - $ref: '#/components/schemas/PayinLinkBancolombiaCollect'
      responses:
        '200':
          description: Payin Link created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayinLink'
        '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:
    PayinLinkGeneral:
      title: General
      type: object
      required:
        - customerId
        - redirectUrl
        - amount
        - type
        - availableTypes
      properties:
        reference:
          type: string
          description: >-
            An optional reference provided by the merchant to identify the Payin
            Link.
        description:
          type: string
          description: An optional description of the Payin Link.
        customerId:
          type: string
          description: The ID of the customer for whom the Payin Link is created.
        redirectUrl:
          type: string
          description: >-
            URL to which the customer will be redirected after the payment
            process.
        amount:
          type: number
          description: >-
            Amount to be paid in COP. Must be greater than $1500. The maxiumum
            is configured per merchant but defaults to $2.000.000. Contact us if
            you need to increase this limit.
        type:
          type: string
          enum:
            - general
        availableTypes:
          type: array
          description: >-
            The payment methods types that are available for the customer to
            select.
          items:
            type: string
            enum:
              - pse
              - bancolombiaButton
              - nequiButton
              - card
              - bancolombiaCollect
        expiration:
          type: string
          description: >-
            Datetime when link will expire in YYYY-MM-DDTHH:mm:ss format. By
            default, expiration is at the end of the day after the link
            creation. Minimum expiration is the current date and maximum
            expiration is at the end of the 7th day from creation. Links expire
            shortly after the specified datetime has passed.
        targetMerchantAccountId:
          type: string
          description: >-
            An optional account ID of the target merchant account for this Payin
            Link.
    PayinLinkPSE:
      title: PSE
      type: object
      required:
        - customerId
        - redirectUrl
        - amount
        - type
        - bank
      properties:
        reference:
          type: string
          description: >-
            An optional reference provided by the merchant to identify the Payin
            Link.
        description:
          type: string
          description: An optional description of the Payin Link.
        customerId:
          type: string
          description: The ID of the customer for whom the Payin Link is created.
        redirectUrl:
          type: string
          description: >-
            URL to which the customer will be redirected after the payment
            process.
        amount:
          type: number
          description: >-
            Amount to be paid in COP. Must be greater than $1.000. The maxiumum
            is configured per merchant but defaults to $2.000.000. Contact us if
            you need to increase this limit.
        type:
          type: string
          enum:
            - pse
        bank:
          $ref: '#/components/schemas/PseBank'
        expiration:
          type: string
          description: >-
            Datetime when link will expire in YYYY-MM-DDTHH:mm:ss format. By
            default, expiration is at the end of the day after the link
            creation. Minimum expiration is the current date and maximum
            expiration is at the end of the 7th day from creation. Links expire
            shortly after the specified datetime has passed.
        targetMerchantAccountId:
          type: string
          description: >-
            An optional account ID of the target merchant account for this Payin
            Link.
    PayinLinkBancolombiaButton:
      title: Bancolombia Button
      type: object
      required:
        - customerId
        - redirectUrl
        - amount
        - type
      properties:
        reference:
          type: string
          description: >-
            An optional reference provided by the merchant to identify the Payin
            Link.
        description:
          type: string
          description: An optional description of the Payin Link.
        customerId:
          type: string
          description: The ID of the customer for whom the Payin Link is created.
        redirectUrl:
          type: string
          description: >-
            URL to which the customer will be redirected after the payment
            process.
        amount:
          type: number
          description: >-
            Amount to be paid in COP. Must be greater than $1500. The maxiumum
            is configured per merchant but defaults to $2.000.000. Contact us if
            you need to increase this limit.
        type:
          type: string
          enum:
            - bancolombiaButton
        expiration:
          type: string
          description: >-
            Datetime when link will expire in YYYY-MM-DDTHH:mm:ss format. By
            default, expiration is at the end of the day after the link
            creation. Minimum expiration is the current date and maximum
            expiration is at the end of the 7th day from creation. Links expire
            shortly after the specified datetime has passed.
        targetMerchantAccountId:
          type: string
          description: >-
            An optional account ID of the target merchant account for this Payin
            Link.
    PayinLinkNequiButton:
      title: Nequi Button
      type: object
      required:
        - customerId
        - redirectUrl
        - amount
        - type
        - phoneNumber
      properties:
        reference:
          type: string
          description: >-
            An optional reference provided by the merchant to identify the Payin
            Link.
        description:
          type: string
          description: An optional description of the Payin Link.
        customerId:
          type: string
          description: The ID of the customer for whom the Payin Link is created.
        redirectUrl:
          type: string
          description: >-
            URL to which the customer will be redirected after the payment
            process.
        amount:
          type: number
          description: >-
            Amount to be paid in COP. Must be greater than $1500. The maxiumum
            is configured per merchant but defaults to $2.000.000. Contact us if
            you need to increase this limit.
        type:
          type: string
          enum:
            - nequiButton
        phoneNumber:
          type: string
          description: The phone number of the customer, required for Nequi payments.
        expiration:
          type: string
          description: >-
            Datetime when link will expire in YYYY-MM-DDTHH:mm:ss format. By
            default, expiration is at the end of the day after the link
            creation. Minimum expiration is the current date and maximum
            expiration is at the end of the 7th day from creation. Links expire
            shortly after the specified datetime has passed.
        targetMerchantAccountId:
          type: string
          description: >-
            An optional account ID of the target merchant account for this Payin
            Link.
    PayinLinkCard:
      title: Card
      type: object
      required:
        - customerId
        - redirectUrl
        - amount
        - type
        - card
      properties:
        reference:
          type: string
          description: >-
            An optional reference provided by the merchant to identify the Payin
            Link.
        description:
          type: string
          description: An optional description of the Payin Link.
        customerId:
          type: string
          description: The ID of the customer for whom the Payin Link is created.
        redirectUrl:
          type: string
          description: >-
            URL to which the customer will be redirected after the payment
            process.
        amount:
          type: number
          description: >-
            Amount to be paid in COP. Must be greater than $1500. The maxiumum
            is configured per merchant but defaults to $2.000.000. Contact us if
            you need to increase this limit.
        type:
          type: string
          enum:
            - card
        card:
          $ref: '#/components/schemas/Card'
        expiration:
          type: string
          description: >-
            Datetime when link will expire in YYYY-MM-DDTHH:mm:ss format. By
            default, expiration is at the end of the day after the link
            creation. Minimum expiration is the current date and maximum
            expiration is at the end of the 7th day from creation. Links expire
            shortly after the specified datetime has passed.
        targetMerchantAccountId:
          type: string
          description: >-
            An optional account ID of the target merchant account for this Payin
            Link.
    PayinLinkBancolombiaCollect:
      title: Bancolombia Collect
      type: object
      required:
        - customerId
        - redirectUrl
        - amount
        - type
      properties:
        reference:
          type: string
          description: >-
            An optional reference provided by the merchant to identify the Payin
            Link.
        description:
          type: string
          description: An optional description of the Payin Link.
        customerId:
          type: string
          description: The ID of the customer for whom the Payin Link is created.
        redirectUrl:
          type: string
          description: >-
            URL to which the customer will be redirected after the payment
            process.
        amount:
          type: number
          description: >-
            Amount to be paid in COP. Must be greater than $1500. The maxiumum
            is configured per merchant but defaults to $2.000.000. Contact us if
            you need to increase this limit.
        type:
          type: string
          enum:
            - bancolombiaCollect
        expiration:
          type: string
          description: >-
            Datetime when link will expire in YYYY-MM-DDTHH:mm:ss format. By
            default, expiration is at the end of the day after the link
            creation. Minimum expiration is the current date and maximum
            expiration is at the end of the 7th day from creation. Links expire
            shortly after the specified datetime has passed.
        targetMerchantAccountId:
          type: string
          description: >-
            An optional account ID of the target merchant account for this Payin
            Link.
    PayinLink:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the Payin Link.
          example: 01HPR5TEDFKT498V8CYY3RPCXP
        reference:
          type: string
          description: >-
            An optional reference provided by the merchant to identify the Payin
            Link.
        description:
          type: string
          description: Description of the Payin Link.
        customerId:
          type: string
          description: The ID of the customer for whom the Payin Link is created.
          example: 01HPR57X6QR5ZRKEEKBSDBW4RA
        customerDetails:
          $ref: '#/components/schemas/CustomerDetails'
        status:
          type: string
          enum:
            - pending
            - processing
            - approved
            - cancelled
          example: approved
          description: The current status of the Payin Link.
        statusMessage:
          $ref: '#/components/schemas/StatusMessage'
        paymentUrl:
          type: string
          description: URL to which the customer can go to complete the payment.
          example: >-
            http://payments.palomma.com/payinLinks?payinLinkId=01HPR5TEDFKT498V8CYY3RPCXP
        redirectUrl:
          type: string
          description: >-
            URL to which the customer will be redirected after the payment
            process.
          example: http://merchant.com/checkout
        amount:
          type: number
          description: The total amount to be paid in COP.
          example: 100000
        amountCollected:
          type: number
          description: The amount that has been collected in COP.
          example: 100000
        fee:
          type: number
          description: Any fee associated with the Payin Link.
          example: 500
        type:
          type: string
          description: The type of Payin Link
          enum:
            - general
            - pse
            - bancolombiaButton
            - nequiButton
            - card
            - bancolombiaCollect
        expiration:
          type: string
          description: >-
            Datetime when link will expire in YYYY-MM-DDTHH:mm:ss format. By
            default, expiration is at the end of the day after the link
            creation. Minimum expiration is the current date and maximum
            expiration is at the end of the 7th day from creation. Links expire
            shortly after the specified datetime has passed.
        targetMerchantAccountId:
          type: string
          description: Account ID of the target merchant account for this Payin Link.
          example: default
        createdAt:
          type: string
          format: date-time
          description: ISO string representing when the Payin Link was created.
        updatedAt:
          type: string
          format: date-time
          description: ISO string representing when the Payin Link was last updated.
    PseBank:
      type: string
      description: The list of banks supported by the Palomma API.
      enum:
        - alianza
        - ban100
        - bancamia
        - bancoagrario
        - avvillas
        - bbva
        - bancocajasocial
        - coopcentral
        - davivienda
        - bancodebogota
        - bancodeoccidente
        - falabella
        - finandina
        - gnbsudameris
        - itau
        - jpmorgancolombia
        - mundomujer
        - pichincha
        - bancopopular
        - santander
        - serfinanza
        - union
        - bancolombia
        - bancoomeva
        - cfa
        - citibank
        - coltefinanciera
        - confiar
        - coofinep
        - cotrafa
        - dale
        - daviplata
        - iris
        - lulo
        - movii
        - nequi
        - rappipay
        - scotiabankcolpatria
        - uala
        - crezcamos
        - nu
    Card:
      type: object
      required:
        - cardNumber
        - expirationMonth
        - expirationYear
        - cvv
      properties:
        cardNumber:
          type: string
          description: The card number without spaces or dashes.
          example: '4111111111111111'
          pattern: ^\d{13,19}$
        expirationMonth:
          type: string
          description: The month when the card expires, typically in MM format.
          example: '12'
          pattern: ^(0[1-9]|1[0-2])$
        expirationYear:
          type: string
          description: The year when the card expires, typically in YYYY format.
          example: '2023'
          pattern: ^\d{4}$
        cvv:
          type: string
          description: The card verification value/code, typically 3 or 4 digits.
          example: '123'
          pattern: ^\d{3,4}$
    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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````