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

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# Inscribir un método de pago

> Inscribe el método de pago seleccionado por un cliente para uso futuro durante el checkout

Esta solicitud inscribe un método de pago para un cliente. Con la información que Yuno proporciona después de que el cliente selecciona el método de pago a inscribir, podrás guardarlo para compras futuras en el objeto de método de pago creado.

Ten en cuenta que esta solicitud requiere un `X-Idempotency-Key`. Consulta [Authentication](https://docs.y.uno/es/reference/getting-started/authentication.md#idempotency).

> [!NOTE]
>
> **Webhooks**
>
> Recomendamos escuchar [Webhooks](https://docs.y.uno/es/docs/webhooks/configure-webhooks.md) para mantenerte al día con el estado de los métodos de pago inscritos de tus clientes.

Si un cliente inscribe la misma tarjeta dos veces pero con una nueva fecha de vencimiento o con otros datos del titular de la tarjeta, daremos de baja la inscripción de la tarjeta inscrita anteriormente y conservaremos la nueva.

## Métodos de pago disponibles para la inscripción

Los siguientes métodos de pago pueden inscribirse usando este endpoint:

| Método de pago | Tipo |
| - | - |
| **Tarjetas** | `CARD` |
| **Nupay** | `NU_PAY_ENROLLMENT` |
| **PayPal** | `PAYPAL_ENROLLMENT` |
| **Daviplata** | `DAVIPLATA_ENROLLMENT` |
| **MercadoPago Wallet** | `WALLET_CONNECT` |
| **dLocal Yape** | `YAPE_ENROLLMENT` |
| **dLocal Smart PIX** | `SMART_PIX` |
| **Astropay** | `ASTROPAY_ENROLLABLE` |
| **Adyen PIX Biométrico** | `PIX_BIOMETRICO` |

> [!NOTE]
>
> **Disponibilidad de métodos de pago**
>
> Cuando obtienes los métodos de pago disponibles para inscribir, solo estarán presentes los que hayas conectado, para los que hayas creado una ruta y que hayas agregado a tu checkout. Para más información sobre los flujos de inscripción, consulta la guía [Enroll Payment Methods](https://docs.y.uno/es/docs/payment-features/enrollment/enroll-payment-methods.md).


## OpenAPI

````yaml openapi/es/payment-methods-checkout/enroll-payment-method-checkout.json POST /customers/sessions/{customer_session}/payment-methods
openapi: 3.1.0
info:
  title: customer-api-register-payment-method
  version: 1.0.2
servers:
  - url: https://api-sandbox.y.uno/v1
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
security:
  - sec0: []
    sec1: []
    sec2: []
paths:
  /customers/sessions/{customer_session}/payment-methods:
    post:
      summary: Inscribir método de pago
      operationId: enroll-payment-method-checkout
      parameters:
        - name: customer_session
          in: path
          description: >-
            La sesión de cliente creada para la inscripción mediante el endpoint
            [Create Customer
            Session](https://docs.y.uno/es/reference/customer-sessions-enrollment/create-customer-session)
            (UUID, 36 caracteres).
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - account_id
                - payment_method_type
                - country
              properties:
                account_id:
                  type: string
                  description: >-
                    El identificador único de la cuenta. Encuentras este dato en
                    [el dashboard de Yuno](https://dashboard.y.uno/) (UUID, 36
                    caracteres).
                payment_method_type:
                  type: string
                  description: >-
                    El tipo de método de pago (MAX 255; MIN 3; [Lista de tipos
                    de pago](/es/reference/payment-type-list)).
                  enum:
                    - CARD
                    - MERCADO_PAGO_WALLET
                    - NEQUI
                    - BANCOLOMBIA_TOKENBOX
                    - NU_PAY_ENROLLMENT
                country:
                  type: string
                  description: >-
                    El código de país de la transacción (MAX 2; MIN 2; [ISO
                    3166-1](/es/reference/country-reference)).
                  enum:
                    - AR
                    - BO
                    - BR
                    - CL
                    - CO
                    - CR
                    - EC
                    - SV
                    - GT
                    - HN
                    - MX
                    - NI
                    - PA
                    - PY
                    - PE
                    - US
                    - UY
                account_updater:
                  type: boolean
                  description: >-
                    Control por tarjeta para Card Account Updater. Cuando se
                    define en `false`, esta tarjeta se excluye de Card Account
                    Updater y no recibirá actualizaciones automáticas de los
                    datos de la tarjeta. Cuando se omite, la tarjeta sigue la
                    configuración de Account Updater de tu cuenta. Se aplica en
                    la inscripción.
                payment_method:
                  type: object
                  description: Opciones de inscripción opcionales para el método de pago.
                  properties:
                    network_token:
                      type: boolean
                      description: >-
                        Opcional. Solo `CARD`. Control por tarjeta para los
                        [network
                        tokens](/es/docs/security-and-compliance/network-tokens#choose-per-card).
                        `false`: Yuno no aprovisiona un network token para esta
                        tarjeta, incluidas las tarjetas inscritas sin CVV.
                        `true` u omitido: Yuno aprovisiona uno como hasta ahora.
                        Requiere que tu organización esté incorporada a los
                        network tokens para la red de la tarjeta; cuando no lo
                        está, no se aprovisiona ningún token y la inscripción no
                        falla.
                verify:
                  type: object
                  description: >-
                    Indica si se debe verificar el pago con una transacción de
                    verificación o no. Necesitas tener un proveedor definido en
                    tu ruta CARD. False por defecto. Accede a la página
                    [Verificación de
                    tarjetas](/es/docs/security-and-compliance/card-verification)
                    para más detalles.
                  required:
                    - vault_on_success
                  properties:
                    vault_on_success:
                      type: boolean
                      description: >-
                        Indica si se debe verificar el pago con una transacción
                        de verificación o no. Necesitas tener un proveedor
                        definido en tu ruta CARD. False por defecto.
                    currency:
                      type: string
                      description: >-
                        Moneda de la verificación de la tarjeta. Para ver la
                        lista completa de códigos de moneda, consulta la
                        [Referencia de países](/es/reference/country-reference)
                        (MAX 3; MIN 3; ISO 4217).
            examples:
              Enroll:
                value:
                  payment_method_type: CARD
                  country: US
                  account_id: '{{account_id}}'
              Enroll with card verification:
                value:
                  account_id: '{{account_id}}'
                  payment_method_type: CARD
                  country: US
                  verify:
                    vault_on_success: true
                    currency: USD
      responses:
        '201':
          description: '201'
          content:
            application/json:
              examples:
                Enroll:
                  value:
                    id: 0395199e-a99c-4a85-acac-6c916f43fa74
                    account_id: 493e9374-510a-4201-9e09-de669d75f256
                    name: Visa Credit Card
                    description: Visa Credit Card
                    type: VISA
                    category: CARD
                    country: US
                    status: READY_TO_ENROLL
                    created_at: '2024-06-06T13:14:18.799434Z'
                    updated_at: '2024-06-06T13:14:18.799437Z'
                    enrollment:
                      session: 6641e30d-ca7a-440f-b97c-24231eac6dab
                      sdk_required_action: false
                    provider:
                      id: YUNO
                      type: YUNO
                      provider_status: null
                    customer_payer:
                      first_name: John
                      last_name: Doe
                      email: john.doe@email.com
                      gender: M
                      date_of_birth: '1990-02-28'
                      document:
                        document_number: '123456789'
                        document_type: SSN
                      phone:
                        number: '1234567890'
                        country_code: '1'
                      billing_address:
                        address_line_1: 123 Main St
                        address_line_2: Apt 4B
                        country: US
                        state: NY
                        city: New York
                        zip_code: '10001'
                    verify:
                      vault_on_success: false
                      payment: null
                    preferred: null
                Enroll with card verification:
                  value:
                    id: 51887489-60d3-45a9-b895-81d3c1c3aec6
                    account_id: 493e9374-510a-4201-9e09-de669d75f256
                    name: Visa Credit Card
                    description: Visa Credit Card
                    type: VISA
                    category: CARD
                    country: US
                    status: READY_TO_ENROLL
                    created_at: '2024-06-06T13:19:57.828087Z'
                    updated_at: '2024-06-06T13:19:57.828089Z'
                    enrollment:
                      session: 238fc319-4a31-4568-be7f-c475e8fbe230
                      sdk_required_action: false
                    provider:
                      id: YUNO
                      type: YUNO
                      provider_status: null
                    customer_payer:
                      first_name: John
                      last_name: Doe
                      email: john.doe@email.com
                      gender: M
                      date_of_birth: '1990-02-28'
                      document:
                        document_number: '123456789'
                        document_type: SSN
                      phone:
                        number: '1234567890'
                        country_code: '1'
                      billing_address:
                        address_line_1: 123 Main St
                        address_line_2: Apt 4B
                        country: US
                        state: NY
                        city: New York
                        zip_code: '10001'
                    verify:
                      vault_on_success: true
                      currency: USD
                      payment: null
                    preferred: null
              schema:
                oneOf:
                  - title: Inscribir
                    type: object
                    properties:
                      id:
                        type: string
                        example: 0395199e-a99c-4a85-acac-6c916f43fa74
                      account_id:
                        type: string
                        example: 493e9374-510a-4201-9e09-de669d75f256
                      name:
                        type: string
                        example: Visa Credit Card
                      description:
                        type: string
                        example: Visa Credit Card
                      type:
                        type: string
                        example: VISA
                      category:
                        type: string
                        example: CARD
                      country:
                        type: string
                        example: US
                      status:
                        type: string
                        example: READY_TO_ENROLL
                      created_at:
                        type: string
                        example: '2024-06-06T13:14:18.799434Z'
                      updated_at:
                        type: string
                        example: '2024-06-06T13:14:18.799437Z'
                      enrollment:
                        type: object
                        properties:
                          session:
                            type: string
                            example: 6641e30d-ca7a-440f-b97c-24231eac6dab
                          sdk_required_action:
                            type: boolean
                            example: false
                            default: true
                      provider:
                        type: object
                        properties:
                          id:
                            type: string
                            example: YUNO
                          type:
                            type: string
                            example: YUNO
                          provider_status: {}
                      customer_payer:
                        type: object
                        properties:
                          first_name:
                            type: string
                            example: John
                          last_name:
                            type: string
                            example: Doe
                          email:
                            type: string
                            example: john.doe@email.com
                          gender:
                            type: string
                            example: M
                          date_of_birth:
                            type: string
                            example: '1990-02-28'
                          document:
                            type: object
                            properties:
                              document_number:
                                type: string
                                example: '123456789'
                              document_type:
                                type: string
                                example: SSN
                          phone:
                            type: object
                            properties:
                              number:
                                type: string
                                example: '1234567890'
                              country_code:
                                type: string
                                example: '1'
                          billing_address:
                            type: object
                            properties:
                              address_line_1:
                                type: string
                                example: 123 Main St
                              address_line_2:
                                type: string
                                example: Apt 4B
                              country:
                                type: string
                                example: US
                              state:
                                type: string
                                example: NY
                              city:
                                type: string
                                example: New York
                              zip_code:
                                type: string
                                example: '10001'
                      verify:
                        type: object
                        properties:
                          vault_on_success:
                            type: boolean
                            example: false
                            default: true
                          payment: {}
                      preferred: {}
                  - title: Inscribir con verificación de tarjeta
                    type: object
                    properties:
                      id:
                        type: string
                        example: 51887489-60d3-45a9-b895-81d3c1c3aec6
                      account_id:
                        type: string
                        example: 493e9374-510a-4201-9e09-de669d75f256
                      name:
                        type: string
                        example: Visa Credit Card
                      description:
                        type: string
                        example: Visa Credit Card
                      type:
                        type: string
                        example: VISA
                      category:
                        type: string
                        example: CARD
                      country:
                        type: string
                        example: US
                      status:
                        type: string
                        example: READY_TO_ENROLL
                      created_at:
                        type: string
                        example: '2024-06-06T13:19:57.828087Z'
                      updated_at:
                        type: string
                        example: '2024-06-06T13:19:57.828089Z'
                      enrollment:
                        type: object
                        properties:
                          session:
                            type: string
                            example: 238fc319-4a31-4568-be7f-c475e8fbe230
                          sdk_required_action:
                            type: boolean
                            example: false
                            default: true
                      provider:
                        type: object
                        properties:
                          id:
                            type: string
                            example: YUNO
                          type:
                            type: string
                            example: YUNO
                          provider_status: {}
                      customer_payer:
                        type: object
                        properties:
                          first_name:
                            type: string
                            example: John
                          last_name:
                            type: string
                            example: Doe
                          email:
                            type: string
                            example: john.doe@email.com
                          gender:
                            type: string
                            example: M
                          date_of_birth:
                            type: string
                            example: '1990-02-28'
                          document:
                            type: object
                            properties:
                              document_number:
                                type: string
                                example: '123456789'
                              document_type:
                                type: string
                                example: SSN
                          phone:
                            type: object
                            properties:
                              number:
                                type: string
                                example: '1234567890'
                              country_code:
                                type: string
                                example: '1'
                          billing_address:
                            type: object
                            properties:
                              address_line_1:
                                type: string
                                example: 123 Main St
                              address_line_2:
                                type: string
                                example: Apt 4B
                              country:
                                type: string
                                example: US
                              state:
                                type: string
                                example: NY
                              city:
                                type: string
                                example: New York
                              zip_code:
                                type: string
                                example: '10001'
                      verify:
                        type: object
                        properties:
                          vault_on_success:
                            type: boolean
                            example: true
                            default: true
                          currency:
                            type: string
                            example: USD
                          payment: {}
                      preferred: {}
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Bad Request:
                  value:
                    code: INVALID_REQUEST
                    messages:
                      - Invalid request
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: INVALID_REQUEST
                  messages:
                    type: array
                    items:
                      type: string
                      example: Invalid request
        '401':
          description: '401'
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    code: INVALID_CREDENTIALS
                    messages:
                      - Invalid credentials
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: INVALID_CREDENTIALS
                  messages:
                    type: array
                    items:
                      type: string
                      example: Invalid credentials
        '403':
          description: '403'
          content:
            application/json:
              examples:
                Forbidden:
                  value:
                    code: AUTHORIZATION_REQUIRED
                    messages:
                      - The merchant has no authorization to use this API.
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: AUTHORIZATION_REQUIRED
                  messages:
                    type: array
                    items:
                      type: string
                      example: The merchant has no authorization to use this API.
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: public-api-key
      x-default: <Your public-api-key>
    sec1:
      type: apiKey
      in: header
      x-default: <Your private-secret-key>
      name: private-secret-key
    sec2:
      type: apiKey
      in: header
      name: X-Idempotency-Key
      x-default: <Your X-Idempotency-Key>

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.