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

# Consultar devolucion unitaria

> El API de Consulta Unitaria de Devolucion permite consultar una devolucion generada anteriormente por el API de Devoluciones.



## OpenAPI

````yaml /openapi.json get /refund/{merchant_code}/{merchant_operation_number}
openapi: 3.1.0
info:
  title: Alignet API
  version: 1.0.0
  description: >-
    Referencia OpenAPI para autenticacion, autorizacion, consulta, cancelacion,
    devoluciones y notificaciones de pagos ecommerce en PayIn.
servers:
  - url: https://auth.preprod.alignet.io
    description: Pre-Produccion
  - url: https://auth.alignet.io
    description: Produccion
security: []
paths:
  /refund/{merchant_code}/{merchant_operation_number}:
    get:
      tags:
        - Refunds
      summary: Consultar devolucion unitaria
      description: >-
        El API de Consulta Unitaria de Devolucion permite consultar una
        devolucion generada anteriormente por el API de Devoluciones.
      operationId: getRefundByMerchantOperationNumber
      parameters:
        - name: Authorization
          in: header
          required: true
          description: Token Bearer obtenido desde autenticacion.
          schema:
            type: string
            default: Bearer {{access_token}}
          example: Bearer {{access_token}}
        - name: ALG-API-VERSION
          in: header
          required: true
          description: Version del API a usar.
          schema:
            type: string
            default: '1709847567'
          example: '1709847567'
        - name: payment-facilitator-code
          in: header
          required: false
          description: Identificador del Facilitador de Pago.
          schema:
            type: string
          example: your_pf_code
        - name: merchant_code
          in: path
          required: true
          description: Identificador del comercio.
          schema:
            type: string
          example: 41bb301e-3c37-4332-accb-ed5ec19081e4
        - name: merchant_operation_number
          in: path
          required: true
          description: Numero de operacion registrado por el comercio.
          schema:
            type: string
          example: '239766'
      responses:
        '200':
          description: Consulta unitaria de devolucion obtenida correctamente.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundQueryResponse'
              example:
                success: 'true'
                merchant_code: 41bb301e-3c37-4332-accb-ed5ec19081e4
                operations_count: '1'
                operations:
                  - refund_id: 922178aa-ce4c-4c5f-8190-82fa7e009425
                    state: REGISTERED
                    refund_reason: Solicitud recibida y validada
                    type: TOTAL
                    merchant_operation_number: '239766'
                    transaction_id: bko66gpi8czns4tcde93q96vd
                    refund_amount: '1050'
                    transaction_amount: '1050'
                    currency: '604'
                    payment_method:
                      name: CARD
                      brand: VISA
                      masked_pan: 447411******2240
                    additional_fields:
                      canal: WEB
                      reason: cliente no reconocio el consumo
                      description: solicitud por desconocimiento
                    lifecycle:
                      - state: REGISTERED
                        date:
                          utc_time: '2025-05-26T06:06:45'
                          unix_time: 1748239605
                meta:
                  status:
                    code: '00'
                    message_ilgn:
                      - locale: es_PE
                        value: Se proceso correctamente la peticion
        '400':
          description: Request invalido.
        '401':
          description: Token invalido o expirado.
      servers:
        - url: https://api.preprod.alignet.io
          description: Pre-Produccion
        - url: https://api.alignet.io
          description: Produccion
components:
  schemas:
    RefundQueryResponse:
      type: object
      required:
        - success
        - merchant_code
        - operations_count
        - operations
        - meta
      properties:
        success:
          type: string
          enum:
            - 'true'
            - 'false'
          example: 'true'
        merchant_code:
          type: string
          example: 41bb301e-3c37-4332-accb-ed5ec19081e4
        operations_count:
          type: string
          example: '1'
        operations:
          type: array
          items:
            $ref: '#/components/schemas/RefundOperationResponse'
        meta:
          $ref: '#/components/schemas/ChargeMeta'
    RefundOperationResponse:
      type: object
      required:
        - refund_id
        - state
        - refund_reason
        - type
        - merchant_operation_number
        - transaction_id
        - refund_amount
        - transaction_amount
        - currency
        - payment_method
        - lifecycle
      properties:
        refund_id:
          type: string
          example: 922178aa-ce4c-4c5f-8190-82fa7e009425
        state:
          type: string
          enum:
            - REGISTERED
            - IN_PROCESS
            - RESOLVED
            - REJECTED
          example: REGISTERED
        refund_reason:
          type: string
          example: Solicitud recibida y validada
        type:
          type: string
          enum:
            - TOTAL
            - PARTIAL
          example: TOTAL
        merchant_operation_number:
          type: string
          example: '239766'
        transaction_id:
          type: string
          example: bko66gpi8czns4tcde93q96vd
        refund_amount:
          type: string
          example: '1050'
        transaction_amount:
          type: string
          example: '1050'
        currency:
          type: string
          example: '604'
        additional_fields:
          type:
            - object
            - 'null'
          additionalProperties: true
          example:
            canal: WEB
            reason: cliente no reconocio el consumo
            description: solicitud por desconocimiento
        payment_method:
          $ref: '#/components/schemas/RefundPaymentMethod'
        lifecycle:
          type: array
          items:
            $ref: '#/components/schemas/RefundLifecycleEvent'
    ChargeMeta:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/ChargeMetaStatus'
    RefundPaymentMethod:
      type: object
      required:
        - name
        - brand
        - masked_pan
      properties:
        name:
          type: string
          enum:
            - CARD
            - YAPE
            - CUOTEALO
          example: CARD
        brand:
          type: string
          example: VISA
        masked_pan:
          type: string
          example: 447411******2240
    RefundLifecycleEvent:
      type: object
      required:
        - state
        - date
      properties:
        state:
          type: string
          enum:
            - REGISTERED
            - IN_PROCESS
            - RESOLVED
            - REJECTED
          example: REGISTERED
        date:
          $ref: '#/components/schemas/TransactionLifecycleDate'
    ChargeMetaStatus:
      type: object
      properties:
        code:
          type: string
          description: >-
            Codigo del resultado tecnico del servicio o request. No valida si un
            pago fue autorizado o denegado; para eso usa el estado de la
            transaccion.
          example: '00'
        message_ilgn:
          type: array
          items:
            $ref: '#/components/schemas/ChargeStatusMessage'
    TransactionLifecycleDate:
      type: object
      required:
        - utc_time
        - unix_time
      properties:
        utc_time:
          type: string
          example: '2024-03-12T22:49:36.018Z'
        unix_time:
          type: integer
          example: 1710282940
    ChargeStatusMessage:
      type: object
      properties:
        locale:
          type: string
          example: es_PE
        value:
          type: string
          example: Procesado correctamente

````