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

# Autorizar pago ecommerce

> Procesa un pago ecommerce usando el API de autorizacion.

Este endpoint soporta flujos con Tarjeta, Yape, Transferencia Bancaria, QR, Cuotéalo y PagoEfectivo. Antes de consumirlo, solicita tu Access Token en [Autenticación](/autenticacion#param-post-token). Si necesitas la guia funcional paso a paso, revisa [Tarjeta](/payin/autorizacion-tarjeta), [Yape](/payin/autorizacion-yape), [Transferencia Bancaria](/payin/autorizacion-transferencia-bancaria), [QR](/payin/autorizacion-qr), [Cuotéalo](/payin/autorizacion-cuotealo) o [PagoEfectivo](/payin/autorizacion-pagoefectivo).



## OpenAPI

````yaml /openapi.json post /charges
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:
  /charges:
    post:
      tags:
        - PayIn
      summary: Autorizar pago ecommerce
      description: >-
        Procesa un pago ecommerce usando el API de autorizacion.


        Este endpoint soporta flujos con Tarjeta, Yape, Transferencia Bancaria,
        QR, Cuotéalo y PagoEfectivo. Antes de consumirlo, solicita tu Access
        Token en [Autenticación](/autenticacion#param-post-token). Si necesitas
        la guia funcional paso a paso, revisa
        [Tarjeta](/payin/autorizacion-tarjeta),
        [Yape](/payin/autorizacion-yape), [Transferencia
        Bancaria](/payin/autorizacion-transferencia-bancaria),
        [QR](/payin/autorizacion-qr), [Cuotéalo](/payin/autorizacion-cuotealo) o
        [PagoEfectivo](/payin/autorizacion-pagoefectivo).
      operationId: authorizeEcommercePayment
      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'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChargeAuthorizeRequest'
            examples:
              card:
                summary: Pago con tarjeta
                value:
                  action: authorize
                  channel: ecommerce
                  merchant_code: your_merchant_code
                  merchant_operation_number: '2391645'
                  payment_method:
                    method_name: CARD
                    method_details:
                      pan: '4051420006041115'
                      expiry_date: '1231'
                      security_code: '123'
                      card_holder:
                        first_name: Pedro
                        last_name: Miranda
                        email: pedro@pay-me.com
                        phone:
                          prefix: '51'
                          number: '999835685'
                      installments:
                        plan: '01'
                        number: '3'
                  payment_details:
                    amount: '15000'
                    currency: '604'
                    billing:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    shipping:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    customer:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    product_details: []
              yape:
                summary: Pago con Yape
                value:
                  action: authorize
                  channel: ecommerce
                  merchant_code: b0deb6f3-e51a-48a7-9268-f1441d46f7bd
                  merchant_operation_number: '5974484'
                  payment_method:
                    method_name: YAPE
                    method_details:
                      callback_url: https://pay-me.com/callback
                      phone:
                        country_code: '+51'
                        subscriber: '969929157'
                      otp: '557454'
                  payment_details:
                    amount: '15000'
                    currency: '604'
                    billing:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    shipping:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    customer:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    product_details: []
              bank_transfer:
                summary: Pago con transferencia bancaria
                value:
                  action: authorize
                  channel: ecommerce
                  merchant_code: your_merchant_code
                  merchant_operation_number: '5974483'
                  payment_method:
                    method_name: BANK_TRANSFER
                    method_details:
                      redirect_url: https://pay-me.com
                      callback_url: https://pay-me.com/callback
                  payment_details:
                    amount: '15000'
                    currency: '604'
                    billing:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    shipping:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    customer:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    product_details: []
              cuotealo:
                summary: Pago con Cuotealo
                value:
                  action: authorize
                  channel: ecommerce
                  merchant_code: your_merchant_code
                  merchant_operation_number: '5974483'
                  payment_method:
                    method_name: CUOTEALO
                    method_details:
                      redirect_url: https://pay-me.com
                      callback_url: https://pay-me.com/callback
                  payment_details:
                    amount: '15000'
                    currency: '604'
                    billing:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    shipping:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    customer:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    product_details: []
              pagoefectivo:
                summary: Pago con PagoEfectivo
                value:
                  action: authorize
                  channel: ecommerce
                  merchant_code: your_merchant_code
                  merchant_operation_number: '5974483'
                  payment_method:
                    method_name: PAGOEFECTIVO
                    method_details:
                      redirect_url: https://pay-me.com
                      callback_url: https://pay-me.com/callback
                  payment_details:
                    amount: '15000'
                    currency: '604'
                    billing:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    shipping:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    customer:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    product_details: []
              qr:
                summary: Pago con QR
                value:
                  action: authorize
                  channel: ecommerce
                  merchant_code: your_merchant_code
                  merchant_operation_number: '5733813'
                  payment_method:
                    method_name: QR
                    method_details:
                      callback_url: https://pay-me.com/callback
                  payment_details:
                    amount: '15000'
                    currency: '604'
                    billing:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    shipping:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    customer:
                      first_name: Pedro
                      last_name: Miranda
                      email: pedro@pay-me.com
                      phone:
                        country_code: '+51'
                        subscriber: '999835685'
                      location:
                        line_1: Av. Casimiro Ulloa 333
                        line_2: Miraflores
                        city: Lima
                        state: Lima
                        country: Peru
                    product_details: []
      responses:
        '200':
          description: Transaccion procesada correctamente.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeAuthorizeResponse'
              examples:
                card:
                  summary: Respuesta de pago con tarjeta
                  value:
                    success: 'true'
                    action: authorize
                    merchant_code: your_merchant_code
                    merchant_operation_number: '2391645'
                    transaction:
                      transaction_id: 5hk8rwa3h3cq9oyfs3a28v1ms
                      channel: ecommerce
                      state: AUTORIZADO
                      state_reason: Approval and completed successfully
                      amount: '15000'
                      currency: '604'
                      payment_method:
                        method_name: CARD
                        method_details:
                          masked_pan: 411111********1111
                          brand: VISA
                          bin: '411111'
                          last_pan: '9268'
                          card_type: DEBIT
                          card_country: PE
                          issuer: BANCO DE CREDITO DEL PERU - BCP
                          installments:
                            plan: NORMAL
                            installment_number: '2'
                      processor_response:
                        authorization_code: '055552'
                        brand_transaction_id: 100B
                        result_message:
                          code: '00'
                          description: Approval and completed successfully
                      additional_fields: null
                      lifecycle:
                        - state: REGISTRADO
                          date:
                            utc_time: '2024-03-12T22:49:36.018Z'
                            unix_time: 1710282940
                        - state: PENDIENTE
                          date:
                            utc_time: '2024-03-12T22:49:36.018Z'
                            unix_time: 1710282940
                        - state: AUTORIZADO
                          date:
                            utc_time: '2024-03-12T22:49:36.018Z'
                            unix_time: 1710282940
                    meta:
                      status:
                        code: '00'
                        message_ilgn:
                          - locale: es_PE
                            value: Procesado correctamente
                yape:
                  summary: Respuesta de pago con Yape
                  value:
                    success: 'true'
                    action: authorize
                    merchant_code: b0deb6f3-e51a-48a7-9268-f1441d46f7bd
                    merchant_operation_number: '2391645'
                    transaction:
                      transaction_id: 5hk8rwa3h3cq9oyfs3a28v1ms
                      channel: ecommerce
                      state: AUTORIZADO
                      state_reason: Pago exitoso con Yape
                      amount: '15000'
                      currency: '604'
                      payment_method:
                        method_name: YAPE
                        method_details:
                          phone:
                            country_code: '+51'
                            subscriber: '969929157'
                          masked_pan: 411111********1111
                          brand: VISA
                          bin: '411111'
                          last_pan: '9268'
                          card_type: DEBIT
                          card_country: PE
                          issuer: BANCO DE CREDITO DEL PERU - BCP
                      processor_response:
                        authorization_code: '055552'
                        brand_transaction_id: 100B
                        result_message:
                          code: '00'
                          description: Approval and completed successfully
                      additional_fields: null
                      lifecycle:
                        - state: REGISTRADO
                          date:
                            utc_time: '2024-03-12T22:49:36.018Z'
                            unix_time: 1710282940
                        - state: PENDIENTE
                          date:
                            utc_time: '2024-03-12T22:49:36.018Z'
                            unix_time: 1710282940
                        - state: AUTORIZADO
                          date:
                            utc_time: '2024-03-12T22:49:36.018Z'
                            unix_time: 1710282940
                    meta:
                      status:
                        code: '00'
                        message_ilgn:
                          - locale: es_PE
                            value: Procesado correctamente
                bank_transfer:
                  summary: Respuesta de pago con transferencia bancaria
                  value:
                    success: 'true'
                    action: authorize
                    merchant_code: your_merchant_code
                    merchant_operation_number: '2391645'
                    transaction:
                      transaction_id: 5hk8rwa3h3cq9oyfs3a28v1ms
                      channel: ecommerce
                      state: PENDIENTE
                      state_reason: Url generada para continuar con el pago
                      continue_url: >-
                        https://api.dev.alignet.io/payment/continue/card/81vrxn30vja1gwcfsdng4i5g5
                      amount: '15000'
                      currency: '604'
                      payment_method:
                        method_name: BANK_TRANSFER
                        method_details:
                          redirect_url: https://pay-me.com
                          callback_url: https://pay-me.com/callback
                      expiration_date:
                        utc_time: '2024-03-12T22:49:36.018Z'
                        unix_time: 1711585037
                      processor_response: null
                      additional_fields: null
                      lifecycle:
                        - state: REGISTRADO
                          date:
                            utc_time: '2024-03-12T22:49:36.018Z'
                            unix_time: 1710282940
                        - state: PENDIENTE
                          date:
                            utc_time: '2024-03-12T22:49:36.018Z'
                            unix_time: 1710282940
                    meta:
                      status:
                        code: '00'
                        message_ilgn:
                          - locale: es_PE
                            value: Procesado correctamente
                cuotealo:
                  summary: Respuesta de pago con Cuotealo
                  value:
                    success: 'true'
                    action: authorize
                    merchant_code: your_merchant_code
                    merchant_operation_number: '2391645'
                    transaction:
                      transaction_id: 5hk8rwa3h3cq9oyfs3a28v1ms
                      channel: ecommerce
                      state: PENDIENTE
                      state_reason: Url generada para continuar con el pago
                      continue_url: >-
                        https://api.dev.alignet.io/payment/continue/card/81vrxn30vja1gwcfsdng4i5g5
                      amount: '15000'
                      currency: '604'
                      payment_method:
                        method_name: CUOTEALO
                        method_details:
                          redirect_url: https://pay-me.com
                          callback_url: https://pay-me.com/callback
                      expiration_date:
                        utc_time: '2024-03-12T22:49:36.018Z'
                        unix_time: 1711585037
                      processor_response: null
                      additional_fields: null
                      lifecycle:
                        - state: REGISTRADO
                          date:
                            utc_time: '2024-03-12T22:49:36.018Z'
                            unix_time: 1710282940
                        - state: PENDIENTE
                          date:
                            utc_time: '2024-03-12T22:49:36.018Z'
                            unix_time: 1710282940
                    meta:
                      status:
                        code: '00'
                        message_ilgn:
                          - locale: es_PE
                            value: Procesado correctamente
                pagoefectivo:
                  summary: Respuesta de pago con PagoEfectivo
                  value:
                    success: 'true'
                    action: authorize
                    merchant_code: your_merchant_code
                    merchant_operation_number: '2391645'
                    transaction:
                      transaction_id: 5hk8rwa3h3cq9oyfs3a28v1ms
                      channel: ecommerce
                      state: PENDIENTE
                      state_reason: Codigo CIP generado exitosamente
                      amount: '15000'
                      currency: '604'
                      payment_method:
                        method_name: PAGOEFECTIVO
                        method_details:
                          callback_url: https://pay-me.com/callback
                      expiration_date:
                        utc_time: '2024-03-12T22:49:36.018Z'
                        unix_time: 1711585037
                      processor_response:
                        cip: '1508405'
                        cip_url: >-
                          https://pre1a.payment.pagoefectivo.pe/72217FA5-4580-4B16-A345-24F028F53356.html
                        result_message:
                          code: '100'
                          description: Solicitud exitosa.
                      additional_fields: null
                      lifecycle:
                        - state: REGISTRADO
                          date:
                            utc_time: '2024-03-12T22:49:36.018Z'
                            unix_time: 1710282940
                        - state: PENDIENTE
                          date:
                            utc_time: '2024-03-12T22:49:36.018Z'
                            unix_time: 1710282940
                    meta:
                      status:
                        code: '00'
                        message_ilgn:
                          - locale: es_PE
                            value: Procesado correctamente
                qr:
                  summary: Respuesta de pago con QR
                  value:
                    success: 'true'
                    action: authorize
                    merchant_code: your_merchant_code
                    merchant_operation_number: '2391645'
                    transaction:
                      transaction_id: 5hk8rwa3h3cq9oyfs3a28v1ms
                      channel: ecommerce
                      state: PENDIENTE
                      state_reason: QR generado exitosamente
                      amount: '15000'
                      currency: '604'
                      payment_method:
                        method_name: QR
                        method_details:
                          callback_url: https://pay-me.com/callback
                      expiration_date:
                        utc_time: '2024-03-12T22:49:36.018Z'
                        unix_time: 1711585037
                      processor_response:
                        date: '2024-03-26 19:17:19.599715'
                        qr_image: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...
                        qr_id: 6d5d1ffc79234991b5592b825d6ec097
                        result_message:
                          code: '0'
                          description: Exito
                      additional_fields: null
                      lifecycle:
                        - state: REGISTRADO
                          date:
                            utc_time: '2024-03-12T22:49:36.018Z'
                            unix_time: 1710282940
                        - state: PENDIENTE
                          date:
                            utc_time: '2024-03-12T22:49:36.018Z'
                            unix_time: 1710282940
                    meta:
                      status:
                        code: '00'
                        message_ilgn:
                          - locale: es_PE
                            value: Procesado correctamente
        '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:
    ChargeAuthorizeRequest:
      type: object
      additionalProperties: false
      required:
        - action
        - channel
        - merchant_code
        - merchant_operation_number
        - payment_method
        - payment_details
      properties:
        action:
          type: string
          description: Accion a ejecutar.
          example: authorize
        channel:
          type: string
          description: Canal de la transaccion.
          enum:
            - ecommerce
          example: ecommerce
        merchant_code:
          type: string
          description: Codigo del comercio.
          example: your_merchant_code
        merchant_operation_number:
          type: string
          description: Identificador unico de la operacion en el comercio.
          example: '2391645'
        payment_method:
          description: Metodo de pago y detalle especifico segun el flujo.
          oneOf:
            - $ref: '#/components/schemas/CardPaymentMethod'
            - $ref: '#/components/schemas/YapePaymentMethod'
            - $ref: '#/components/schemas/BankTransferPaymentMethod'
            - $ref: '#/components/schemas/CuotealoPaymentMethod'
            - $ref: '#/components/schemas/PagoEfectivoPaymentMethod'
            - $ref: '#/components/schemas/QrPaymentMethod'
          discriminator:
            propertyName: method_name
            mapping:
              CARD:
                $ref: '#/components/schemas/CardPaymentMethod'
              YAPE:
                $ref: '#/components/schemas/YapePaymentMethod'
              BANK_TRANSFER:
                $ref: '#/components/schemas/BankTransferPaymentMethod'
              CUOTEALO:
                $ref: '#/components/schemas/CuotealoPaymentMethod'
              PAGOEFECTIVO:
                $ref: '#/components/schemas/PagoEfectivoPaymentMethod'
              QR:
                $ref: '#/components/schemas/QrPaymentMethod'
        payment_details:
          $ref: '#/components/schemas/ChargePaymentDetails'
    ChargeAuthorizeResponse:
      type: object
      required:
        - success
        - action
        - merchant_code
        - merchant_operation_number
        - transaction
      properties:
        success:
          type: string
          example: 'true'
        action:
          type: string
          example: authorize
        merchant_code:
          type: string
          example: your_merchant_code
        merchant_operation_number:
          type: string
          example: '2391645'
        transaction:
          type: object
          required:
            - transaction_id
            - channel
            - state
            - amount
            - currency
            - payment_method
            - lifecycle
          properties:
            transaction_id:
              type: string
              example: 5hk8rwa3h3cq9oyfs3a28v1ms
            channel:
              type: string
              example: ecommerce
            state:
              type: string
              example: AUTORIZADO
            state_reason:
              type: string
              example: Approval and completed successfully
            continue_url:
              type: string
              example: >-
                https://api.dev.alignet.io/payment/continue/card/81vrxn30vja1gwcfsdng4i5g5
            amount:
              type: string
              example: '15000'
            currency:
              type: string
              example: '604'
            payment_method:
              description: Metodo de pago utilizado y detalle disponible segun el flujo.
              oneOf:
                - $ref: '#/components/schemas/CardTransactionPaymentMethod'
                - $ref: '#/components/schemas/YapeTransactionPaymentMethod'
                - $ref: '#/components/schemas/BankTransferTransactionPaymentMethod'
                - $ref: '#/components/schemas/CuotealoTransactionPaymentMethod'
                - $ref: '#/components/schemas/PagoEfectivoTransactionPaymentMethod'
                - $ref: '#/components/schemas/QrTransactionPaymentMethod'
            expiration_date:
              $ref: '#/components/schemas/TransactionExpirationDate'
            processor_response:
              $ref: '#/components/schemas/ProcessorResponse'
            additional_fields:
              type:
                - object
                - 'null'
              example: null
            lifecycle:
              type: array
              items:
                $ref: '#/components/schemas/TransactionLifecycleEvent'
        meta:
          $ref: '#/components/schemas/ChargeMeta'
    CardPaymentMethod:
      title: Tarjeta
      type: object
      required:
        - method_name
        - method_details
      properties:
        method_name:
          type: string
          enum:
            - CARD
          example: CARD
        method_details:
          $ref: '#/components/schemas/CardPaymentMethodDetails'
    YapePaymentMethod:
      title: Yape
      type: object
      required:
        - method_name
        - method_details
      properties:
        method_name:
          type: string
          enum:
            - YAPE
          example: YAPE
        method_details:
          $ref: '#/components/schemas/YapePaymentMethodDetails'
    BankTransferPaymentMethod:
      title: Transferencia bancaria
      type: object
      required:
        - method_name
        - method_details
      properties:
        method_name:
          type: string
          enum:
            - BANK_TRANSFER
          example: BANK_TRANSFER
        method_details:
          $ref: '#/components/schemas/BankTransferPaymentMethodDetails'
    CuotealoPaymentMethod:
      title: Cuotealo
      type: object
      required:
        - method_name
        - method_details
      properties:
        method_name:
          type: string
          enum:
            - CUOTEALO
          example: CUOTEALO
        method_details:
          $ref: '#/components/schemas/CuotealoPaymentMethodDetails'
    PagoEfectivoPaymentMethod:
      title: PagoEfectivo
      type: object
      required:
        - method_name
        - method_details
      properties:
        method_name:
          type: string
          enum:
            - PAGOEFECTIVO
          example: PAGOEFECTIVO
        method_details:
          $ref: '#/components/schemas/PagoEfectivoPaymentMethodDetails'
    QrPaymentMethod:
      title: QR
      type: object
      required:
        - method_name
        - method_details
      properties:
        method_name:
          type: string
          enum:
            - QR
          example: QR
        method_details:
          $ref: '#/components/schemas/QrPaymentMethodDetails'
    ChargePaymentDetails:
      type: object
      required:
        - amount
        - currency
        - billing
        - shipping
        - customer
        - product_details
      properties:
        amount:
          type: string
          description: Monto en centavos.
          example: '15000'
        currency:
          type: string
          description: Codigo de moneda.
          example: '604'
        billing:
          $ref: '#/components/schemas/PersonDetails'
        shipping:
          $ref: '#/components/schemas/PersonDetails'
        customer:
          $ref: '#/components/schemas/PersonDetails'
        product_details:
          type: array
          description: Detalle de productos asociados a la operacion.
          items:
            type: object
          example: []
    CardTransactionPaymentMethod:
      title: Tarjeta
      type: object
      required:
        - method_name
      properties:
        method_name:
          type: string
          enum:
            - CARD
          example: CARD
        method_details:
          $ref: '#/components/schemas/TransactionCardMethodDetails'
    YapeTransactionPaymentMethod:
      title: Yape
      type: object
      required:
        - method_name
      properties:
        method_name:
          type: string
          enum:
            - YAPE
          example: YAPE
        method_details:
          $ref: '#/components/schemas/TransactionYapeMethodDetails'
    BankTransferTransactionPaymentMethod:
      title: Transferencia bancaria
      type: object
      required:
        - method_name
      properties:
        method_name:
          type: string
          enum:
            - BANK_TRANSFER
          example: BANK_TRANSFER
        method_details:
          $ref: '#/components/schemas/TransactionBankTransferMethodDetails'
    CuotealoTransactionPaymentMethod:
      title: Cuotealo
      type: object
      required:
        - method_name
      properties:
        method_name:
          type: string
          enum:
            - CUOTEALO
          example: CUOTEALO
        method_details:
          $ref: '#/components/schemas/TransactionCuotealoMethodDetails'
    PagoEfectivoTransactionPaymentMethod:
      title: PagoEfectivo
      type: object
      required:
        - method_name
      properties:
        method_name:
          type: string
          enum:
            - PAGOEFECTIVO
          example: PAGOEFECTIVO
        method_details:
          $ref: '#/components/schemas/TransactionPagoEfectivoMethodDetails'
    QrTransactionPaymentMethod:
      title: QR
      type: object
      required:
        - method_name
      properties:
        method_name:
          type: string
          enum:
            - QR
          example: QR
        method_details:
          $ref: '#/components/schemas/TransactionQrMethodDetails'
    TransactionExpirationDate:
      type: object
      properties:
        utc_time:
          type: string
          example: '2024-03-12T22:49:36.018Z'
        unix_time:
          type: integer
          example: 1711585037
    ProcessorResponse:
      type:
        - object
        - 'null'
      properties:
        authorization_code:
          type: string
          example: '055552'
        brand_transaction_id:
          type: string
          example: 100B
        date:
          type: string
          example: '2024-03-26 19:17:19.599715'
        qr_image:
          type: string
          example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...
        qr_id:
          type: string
          example: 6d5d1ffc79234991b5592b825d6ec097
        cip:
          type: string
          example: '1508405'
        cip_url:
          type: string
          example: >-
            https://pre1a.payment.pagoefectivo.pe/72217FA5-4580-4B16-A345-24F028F53356.html
        origin_account:
          type: string
          example: '055552'
        request_id:
          type: string
          example: '055552'
        operation_id:
          type: string
          example: '055552'
        credit_status:
          type: string
          example: APPROVED
        payment_date:
          type: string
          example: '2024-06-24T11:01:20-05:00'
        operationNumber:
          type: string
          example: '1057462'
        reverse_date:
          type: string
          example: 05-07-2024 20:34:19
        reverse_code:
          type: string
          example: T90261
        result_message:
          $ref: '#/components/schemas/ProcessorResultMessage'
    TransactionLifecycleEvent:
      type: object
      required:
        - state
        - date
      properties:
        state:
          type: string
          example: AUTORIZADO
        date:
          $ref: '#/components/schemas/TransactionLifecycleDate'
    ChargeMeta:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/ChargeMetaStatus'
    CardPaymentMethodDetails:
      type: object
      required:
        - pan
        - expiry_date
        - security_code
        - card_holder
      properties:
        pan:
          type: string
          description: Numero de tarjeta.
          example: '4051420006041115'
        expiry_date:
          type: string
          description: Fecha de expiracion en formato MMYY.
          example: '1231'
        security_code:
          type: string
          description: Codigo de seguridad CVV.
          example: '123'
        card_holder:
          $ref: '#/components/schemas/CardHolderDetails'
        redirect_url:
          type: string
          description: URL de retorno al finalizar la autenticacion 3DS.
          example: https://pay-me.com
        callback_url:
          type: string
          description: URL host to host para notificaciones.
          example: https://pay-me.com/callback
        authentication_result:
          $ref: '#/components/schemas/CardAuthenticationResult'
        installments:
          $ref: '#/components/schemas/CardInstallmentsRequest'
    YapePaymentMethodDetails:
      type: object
      required:
        - phone
        - otp
      properties:
        callback_url:
          type: string
          description: URL donde se realizara la notificacion host to host.
          example: https://pay-me.com/callback
        phone:
          $ref: '#/components/schemas/PhoneWithCountryCode'
        otp:
          type: string
          description: Codigo OTP de la billetera Yape.
          example: '557454'
    BankTransferPaymentMethodDetails:
      type: object
      required:
        - redirect_url
      properties:
        redirect_url:
          type: string
          description: URL donde se realizara el redirect cuando finalice la autorizacion.
          example: https://pay-me.com
        callback_url:
          type: string
          description: URL donde se realizara la notificacion host to host.
          example: https://pay-me.com/callback
    CuotealoPaymentMethodDetails:
      type: object
      required:
        - redirect_url
      properties:
        redirect_url:
          type: string
          description: URL donde se realizara el redirect cuando finalice la autorizacion.
          example: https://pay-me.com
        callback_url:
          type: string
          description: URL donde se realizara la notificacion host to host.
          example: https://pay-me.com/callback
    PagoEfectivoPaymentMethodDetails:
      type: object
      required:
        - redirect_url
      properties:
        redirect_url:
          type: string
          description: URL donde se realizara el redirect cuando finalice la autorizacion.
          example: https://pay-me.com
        callback_url:
          type: string
          description: URL donde se realizara la notificacion host to host.
          example: https://pay-me.com/callback
    QrPaymentMethodDetails:
      type: object
      properties:
        callback_url:
          type: string
          description: URL donde se realizara la notificacion host to host.
          example: https://pay-me.com/callback
    PersonDetails:
      type: object
      required:
        - first_name
        - last_name
        - email
        - phone
        - location
      properties:
        first_name:
          type: string
          example: Pedro
        last_name:
          type: string
          example: Miranda
        email:
          type: string
          example: pedro@pay-me.com
        phone:
          $ref: '#/components/schemas/PhoneWithCountryCode'
        location:
          $ref: '#/components/schemas/LocationDetails'
    TransactionCardMethodDetails:
      type: object
      properties:
        masked_pan:
          type: string
          example: 411111********1111
        brand:
          type: string
          example: VISA
        bin:
          type: string
          example: '411111'
        last_pan:
          type: string
          example: '9268'
        card_type:
          type: string
          example: DEBIT
        card_country:
          type: string
          example: PE
        issuer:
          type: string
          example: BANCO DE CREDITO DEL PERU - BCP
        installments:
          $ref: '#/components/schemas/CardInstallmentsResponse'
        redirect_url:
          type: string
          example: https://pay-me.com
        callback_url:
          type: string
          example: https://pay-me.com/callback
    TransactionYapeMethodDetails:
      type: object
      properties:
        phone:
          $ref: '#/components/schemas/PhoneWithCountryCode'
        masked_pan:
          type: string
          example: 411111********1111
        brand:
          type: string
          example: VISA
        bin:
          type: string
          example: '411111'
        last_pan:
          type: string
          example: '9268'
        card_type:
          type: string
          example: DEBIT
        card_country:
          type: string
          example: PE
        issuer:
          type: string
          example: BANCO DE CREDITO DEL PERU - BCP
        callback_url:
          type: string
          example: https://pay-me.com/callback
    TransactionBankTransferMethodDetails:
      type: object
      required:
        - redirect_url
      properties:
        redirect_url:
          type: string
          example: https://pay-me.com
        callback_url:
          type: string
          example: https://pay-me.com/callback
    TransactionCuotealoMethodDetails:
      type: object
      required:
        - redirect_url
      properties:
        redirect_url:
          type: string
          example: https://pay-me.com
        callback_url:
          type: string
          example: https://pay-me.com/callback
    TransactionPagoEfectivoMethodDetails:
      type: object
      properties:
        callback_url:
          type: string
          example: https://pay-me.com/callback
    TransactionQrMethodDetails:
      type: object
      properties:
        masked_pan:
          type: string
          example: 411111********1111
        brand:
          type: string
          example: VISA
        bin:
          type: string
          example: '411111'
        last_pan:
          type: string
          example: '9268'
        card_type:
          type: string
          example: DEBIT
        card_country:
          type: string
          example: PE
        issuer:
          type: string
          example: BANCO DE CREDITO DEL PERU - BCP
        callback_url:
          type: string
          example: https://pay-me.com/callback
    ProcessorResultMessage:
      type: object
      properties:
        code:
          type: string
          example: '00'
        description:
          type: string
          example: Approval and completed successfully
    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
    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'
    CardHolderDetails:
      type: object
      required:
        - first_name
        - last_name
        - email
        - phone
      properties:
        first_name:
          type: string
          example: Pedro
        last_name:
          type: string
          example: Miranda
        email:
          type: string
          example: pedro@pay-me.com
        phone:
          $ref: '#/components/schemas/PhoneWithPrefix'
    CardAuthenticationResult:
      type: object
      description: Resultado de autenticacion 3DS obtenido previamente.
      properties:
        3ds_secure:
          $ref: '#/components/schemas/CardAuthentication3dsSecure'
    CardInstallmentsRequest:
      type: object
      properties:
        plan:
          type: string
          description: Plan de cuotas. 01 = Normal.
          example: '01'
        number:
          type: string
          example: '3'
    PhoneWithCountryCode:
      type: object
      required:
        - country_code
        - subscriber
      properties:
        country_code:
          type: string
          example: '+51'
        subscriber:
          type: string
          example: '999835685'
    LocationDetails:
      type: object
      required:
        - line_1
        - line_2
        - city
        - state
        - country
      properties:
        line_1:
          type: string
          example: Av. Casimiro Ulloa 333
        line_2:
          type: string
          example: Miraflores
        city:
          type: string
          example: Lima
        state:
          type: string
          example: Lima
        country:
          type: string
          example: Peru
    CardInstallmentsResponse:
      type: object
      properties:
        plan:
          type: string
          example: NORMAL
        installment_number:
          type: string
          example: '2'
    ChargeStatusMessage:
      type: object
      properties:
        locale:
          type: string
          example: es_PE
        value:
          type: string
          example: Procesado correctamente
    PhoneWithPrefix:
      type: object
      required:
        - prefix
        - number
      properties:
        prefix:
          type: string
          example: '51'
        number:
          type: string
          example: '999835685'
    CardAuthentication3dsSecure:
      type: object
      properties:
        version:
          type: string
          example: 2.1.0
        electronic_commerce_indicator:
          type: string
          example: '05'
        cardholder_authentication_verification_value:
          type: string
          example: AJkBB5NBeQAAAD3MYENQdAAAAAA=
        ds_transaction_id:
          type: string
          example: ABC123
        three_ds_server_transaction_id:
          type: string
          example: ABC123
        trans_status:
          type: string
          example: 'Y'

````