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

# Create a new payin

> Creates a new payin request.



## OpenAPI

````yaml /openapi.yaml post /payins
openapi: 3.0.0
info:
  title: HelloPay API
  description: HelloPay Backend API Documentation
  version: '1.0'
  contact: {}
servers: []
security: []
tags: []
paths:
  /payins:
    post:
      tags:
        - Payins
      summary: Create a new payin
      description: Creates a new payin request.
      operationId: PayinsController_createPayin
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePayinDto'
      responses:
        '201':
          description: Payin successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayinResponse'
        '400':
          description: Invalid input data
        '401':
          description: Unauthorized
components:
  schemas:
    CreatePayinDto:
      type: object
      properties:
        amountInCents:
          type: number
          description: Payment amount in cents
          example: 100000
          minimum: 1
        currency:
          type: string
          description: Payment currency
          example: COP
        rail:
          type: string
          description: Payment rail type
          example: BRE_B
        reference:
          type: string
          description: Unique reference for the payment
          example: INV-2024-001
        inlineCustomer:
          description: Customer data
          allOf:
            - $ref: '#/components/schemas/CustomerDataDto'
        pse:
          description: PSE payment details (required when type is PSE)
          allOf:
            - $ref: '#/components/schemas/PseDto'
        breb:
          description: BREB payment details (required when type is BRE_B)
          allOf:
            - $ref: '#/components/schemas/BrebDto'
        callbackUrl:
          type: string
          description: Callback URL
          example: https://example.com/callback
      required:
        - amountInCents
        - currency
        - rail
        - reference
    PayinResponse:
      type: object
      properties:
        id:
          type: string
          description: Payin ID
          example: 123e4567-e89b-12d3-a456-426614174000
        amount:
          type: number
          description: Payin amount
          example: 100000
        amountInCents:
          type: number
          description: Payin amount in cents
          example: 10000000
        confirmedAmount:
          type: object
          description: Payin confirmed amount
          example: 100000
        confirmedAmountInCents:
          type: object
          description: Payin confirmed amount in cents
          example: 10000000
        currency:
          type: string
          description: Payin currency
          example: COP
        status:
          type: string
          description: Payin status
          example: PENDING
        settlementStatus:
          type: object
          description: Payin settlement status
          example: PENDING_SETTLEMENT
        rail:
          type: string
          description: Payin rail
          example: BRE_B
        reference:
          type: string
          description: Payin reference
          example: INV-2024-001
        paymentLinkId:
          type: object
          description: Payin payment link ID
          example: 123e4567-e89b-12d3-a456-426614174000
        inlineCustomer:
          type: object
          description: Payin inline customer
          example: John Doe
        errorCode:
          type: object
          description: Payin error code
          example: null
        createdAt:
          format: date-time
          type: string
          description: Payin created at
          example: '2024-01-01T00:00:00.000Z'
        updatedAt:
          format: date-time
          type: string
          description: Payin updated at
          example: '2024-01-01T00:00:00.000Z'
        resultAt:
          type: object
          description: Payin result at
          example: '2024-01-01T00:00:00.000Z'
        chargebackAt:
          type: object
          description: Payin chargeback at
          example: '2024-01-01T00:00:00.000Z'
        organizationId:
          type: string
          description: Payin organization ID
          example: 123e4567-e89b-12d3-a456-426614174000
        sourceData:
          description: Payin pse response
          allOf:
            - $ref: '#/components/schemas/BrebDto'
        callbackUrl:
          type: object
          description: Payin callback URL
          example: https://example.com/callback
      required:
        - id
        - amount
        - amountInCents
        - confirmedAmount
        - confirmedAmountInCents
        - currency
        - status
        - settlementStatus
        - rail
        - reference
        - createdAt
        - updatedAt
        - organizationId
    CustomerDataDto:
      type: object
      properties:
        name:
          type: string
          description: Customer full name
          example: John Doe
        idType:
          type: string
          description: Type of identification document
          enum:
            - CO_CC
            - CO_CE
            - CO_NIT
            - MXN_RFC
            - PASSPORT
          example: CO_CC
        idNumber:
          type: string
          description: Identification document number
          example: '1234567890'
        phone:
          type: string
          description: Customer phone number
          example: '+573001234567'
        email:
          type: string
          description: Customer email address
          example: john.doe@example.com
      required:
        - name
        - idType
        - idNumber
        - phone
        - email
    PseDto:
      type: object
      properties:
        bank:
          type: string
          description: PSE bank
          example: CO_BANCOLOMBIA
        personType:
          type: string
          description: PSE person type
          enum:
            - INDIVIDUAL
            - BUSINESS
          example: INDIVIDUAL
      required:
        - bank
        - personType
    BrebDto:
      type: object
      properties:
        keyString:
          type: string
          description: BREB payment key string
          example: breb-key-string
      required:
        - keyString

````