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

# Get Payment

> Devuelve un pago identificado por su `reference`.

El detalle incluye más información que cada ítem del listado `GET /payments` (por ejemplo, datos de contacto del beneficiario, centro de costo y proyectos del payable, e información del ERP).



## OpenAPI

````yaml GET /payments/{reference}
openapi: 3.1.0
info:
  title: Payana Accounts Payable API
  description: >-
    API pública para gestionar cuentas por pagar (payments) y beneficiarios
    (beneficiaries) en Payana, incluyendo notificaciones por webhooks cuando se
    procesan pagos.
  version: 1.0.0
servers:
  - url: https://api.prod.payana.cloud/public/api/v1
    description: Production
  - url: https://api.develop.payana.cloud/public/api/v1
    description: Develop
security:
  - apiKeyAuth: []
tags:
  - name: Payments
    description: Crear y listar pagos
  - name: Beneficiaries
    description: Crear, listar y consultar beneficiarios
  - name: Webhooks
    description: Eventos de webhooks enviados por Payana
  - name: Banks
    description: Listar y consultar bancos
  - name: Transactions In
    description: Transacciones entrantes (polling, mismo formato que webhooks)
  - name: Documents
    description: Listar, consultar y operar documentos (cuentas por pagar)
  - name: DIAN Events
    description: >-
      Encolar eventos DIAN (030 Acuse de recibo, 031 Reclamo, 032 Recibo del
      bien, 033 Aceptación expresa, 034 Aceptación tácita) para documentos
      identificados por CUFE. El procesamiento es asíncrono.
  - name: Fiscal Sync
    description: >-
      Disparar y consultar sincronización de documentos fiscales desde el SAT
      (México) o la DIAN (Colombia).
  - name: Workflow Steps
    description: >-
      Resolver el paso en que está parado un documento dentro de su flujo:
      aprobación, clasificación o etiquetado.
paths:
  /payments/{reference}:
    get:
      tags:
        - Payments
      summary: Get payment by reference
      description: >-
        Devuelve un pago identificado por su `reference`.


        El detalle incluye más información que cada ítem del listado `GET
        /payments` (por ejemplo, datos de contacto del beneficiario, centro de
        costo y proyectos del payable, e información del ERP).
      operationId: PaymentController.publicShow
      parameters:
        - name: reference
          in: path
          description: Referencia única del pago.
          required: true
          schema:
            type: string
            format: uuid
          example: aaea7db4-647c-4d92-9f86-89e34a68e1aa
      responses:
        '200':
          description: Payment retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicPayment'
              example:
                reference: aaea7db4-647c-4d92-9f86-89e34a68e1aa
                beneficiary:
                  reference: 616263a5-a677-4ad1-92ca-7e120adad8d4
                  name: 0411test STG
                  type: supplier
                  identifier_type: NIT
                  identifier_number: '1100'
                  contact_information:
                    - reference: 9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d
                      type: email
                      value: contacto@vendor.test
                document:
                  reference: b2c3d4e5-f6a7-4890-b123-c456d7890abc
                  type: invoice
                  document_number: FC-2024-001
                  fiscal_reference: >-
                    e19d3e7867371a12fd53b67a56db087faa871c9797993d9bbf7806ae4e1466ea
                  origin: fiscal_entity
                  amount: 10000
                  amount_currency: COP
                  is_canceled: false
                amount: 10000
                amount_currency: COP
                exchange_amount: 10000
                exchange_currency: null
                exchange_rate: null
                status: pending
                file_path: null
                receipt_file_path: null
                is_archived: false
                payable:
                  reference: a1cde862-db4f-427f-bd95-91a2f8dd06a1
                  type: supplier
                  status: pending
                  amount: 10000
                  amount_currency: COP
                  file_path: null
                  balance: 10000
                  issue_date: '2025-11-27'
                  expiration_date: '2025-11-28'
                  concept: Factura FC-2024-001
                  origin: fiscal_entity
                  cost_center: null
                  projects: []
                has_erp_payment: false
                erp_payment_reference: null
                is_fiscal_entity: true
                has_erp_payable: false
                erp_payable_reference: null
                erp_payable: null
                erp_payment: null
                batch: null
                tags: []
                accounting_receipt: null
                source_of_fund: null
                paid_at: null
                payment_method: null
                payment_gateway: null
                created_at: '2025-11-27T16:04:55.400+00:00'
                updated_at: '2025-11-27T16:04:55.400+00:00'
        '400':
          description: Bad request (ej. `reference` mal formada)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                status: 400
                message: Invalid input
                code: invalid_input
        '401':
          description: Invalid or missing authorization token
        '404':
          description: Payment not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                status: 404
                message: Payment not found
                code: payment_not_found
        '500':
          description: Internal server error
components:
  schemas:
    PublicPayment:
      type: object
      description: >-
        Pago en su representación pública detallada, devuelta por `GET
        /payments/{reference}`.
      properties:
        reference:
          type: string
        beneficiary:
          description: Beneficiario del pago.
          anyOf:
            - type: object
              properties:
                reference:
                  type: string
                name:
                  type: string
                type:
                  type: string
                identifier_type:
                  type:
                    - string
                    - 'null'
                identifier_number:
                  type:
                    - string
                    - 'null'
                contact_information:
                  type: array
                  items:
                    type: object
                    properties:
                      reference:
                        type: string
                      type:
                        type: string
                      value:
                        type: string
            - type: 'null'
        document:
          description: >-
            Documento fuente del pago a través del payable. `null` en pagos
            manuales o anticipos sin documento.
          anyOf:
            - $ref: '#/components/schemas/PaymentDocument'
            - type: 'null'
        amount:
          type: number
        amount_currency:
          $ref: '#/components/schemas/Currency'
        exchange_amount:
          type:
            - number
            - 'null'
        exchange_currency:
          anyOf:
            - $ref: '#/components/schemas/Currency'
            - type: 'null'
        exchange_rate:
          type:
            - number
            - 'null'
        status:
          $ref: '#/components/schemas/PaymentStatus'
        file_path:
          type:
            - string
            - 'null'
        receipt_file_path:
          type:
            - string
            - 'null'
        is_archived:
          type: boolean
        payable:
          description: Payable asociado al pago, con su centro de costo y proyectos.
          type:
            - object
            - 'null'
        has_erp_payment:
          type: boolean
        erp_payment_reference:
          type:
            - string
            - 'null'
        is_fiscal_entity:
          type: boolean
        has_erp_payable:
          type: boolean
        erp_payable_reference:
          type:
            - string
            - 'null'
        erp_payable:
          description: Información del payable en el ERP, si existe.
          type:
            - object
            - 'null'
        erp_payment:
          description: Información del pago en el ERP, si existe.
          type:
            - object
            - 'null'
        batch:
          description: Lote de pagos asociado, si existe.
          type:
            - object
            - 'null'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/PaymentTag'
        accounting_receipt:
          type:
            - object
            - 'null'
        source_of_fund:
          type:
            - object
            - 'null'
        paid_at:
          type:
            - string
            - 'null'
          format: date-time
        payment_method:
          type:
            - string
            - 'null'
        payment_gateway:
          type:
            - string
            - 'null'
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          $ref: '#/components/schemas/ErrorObject'
      example:
        success: false
        error:
          code: VALIDATION_ERROR
          message: The request contains invalid data
          details:
            amount:
              - Amount must be greater than 0
            beneficiary_id:
              - Beneficiary does not exist
    PaymentDocument:
      type: object
      description: Resumen del documento asociado al pago a través del payable.
      properties:
        reference:
          type: string
          format: uuid
          description: Referencia interna del documento en Payana.
        type:
          type: string
          description: Tipo de documento (p. ej. `invoice`, `credit_note`).
        document_number:
          type: string
          description: Número de documento visible (p. ej. número de factura).
        fiscal_reference:
          type:
            - string
            - 'null'
          description: >-
            Referencia fiscal del documento (CUFE en Colombia, UUID del CFDI en
            México).
        origin:
          type:
            - string
            - 'null'
          description: Origen del documento (p. ej. `fiscal_entity`, `manual`, `api`).
        amount:
          type: number
          description: Monto total del documento.
        amount_currency:
          $ref: '#/components/schemas/Currency'
        is_canceled:
          type: boolean
          description: Indica si el documento fue cancelado ante el SAT/DIAN.
    Currency:
      type: string
      enum:
        - USD
        - COP
        - MXN
        - EUR
    PaymentStatus:
      type: string
      enum:
        - pending
        - in_process
        - processed
        - failed
      description: >-
        Estado del pago: `pending` (creado, sin procesar), `in_process` (en
        procesamiento), `processed` (acreditado) o `failed` (rechazado).
    PaymentTag:
      type: object
      description: Etiqueta de un pago.
      properties:
        name:
          type: string
    ErrorObject:
      type: object
      required:
        - code
        - message
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
        details:
          anyOf:
            - $ref: '#/components/schemas/ErrorDetails'
            - type: 'null'
    ErrorCode:
      type: string
      enum:
        - VALIDATION_ERROR
        - UNAUTHORIZED
        - FORBIDDEN
        - NOT_FOUND
        - CONFLICT
        - RATE_LIMITED
        - INTERNAL_ERROR
    ErrorDetails:
      type: object
      additionalProperties:
        type: array
        items:
          type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: api-key
      description: API key provista por Payana.

````