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

# Enroll Payment Method

This request enrolls a payment method for a customer. With the information provided by Yuno after the customer selects the payment method to enroll, you will be able to save it for future purchases in the payment method object created.

Note that this request requires an `X-Idempotency-Key`. Check the [Authentication](/reference/authentication#idempotency).

<Note>
  **Webhooks**

  We recommend listening to [Webhooks](/docs/configure-webhooks) to stay up to date with the state of the enrolled payment methods of your customers.
</Note>

In case a customer enrolls the same card twice but with new expiration date or cardholder info, we will unenroll the previously enrolled card and keep the new one.

## Available payment methods for enrollment

The following payment methods can be enrolled using this endpoint:

| Payment Method           | Type                   |
| ------------------------ | ---------------------- |
| **Cards**                | `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>
  **Payment Method Availability**

  When you retrieve the payment methods available to enroll, only the ones which you have connected, created a route, and added to your checkout will be present. For more information about enrollment workflows, see the [Enroll Payment Methods](/docs/enroll-payment-methods) guide.
</Note>


## OpenAPI

````yaml openapi/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
security:
  - sec0: []
    sec1: []
    sec2: []
paths:
  /customers/sessions/{customer_session}/payment-methods:
    post:
      summary: Enroll Payment Method
      operationId: enroll-payment-method-checkout
      parameters:
        - name: customer_session
          in: path
          description: >-
            The customer session that has been created for the enrollment using
            the [Create Customer
            Session](https://docs.y.uno/reference/create-customer-session)
            endpoint (UUID, 36 chars).
          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: >-
                    The unique identifier of the account. You find this
                    information on [the Yuno
                    dashboard](https://dashboard.y.uno/) (UUID, 36 chars).
                payment_method_type:
                  type: string
                  description: >-
                    The payment method type (MAX 255; MIN 3; [Payment Type
                    List](/reference/payment-type-list)).
                  enum:
                    - CARD
                    - MERCADO_PAGO_WALLET
                    - NEQUI
                    - BANCOLOMBIA_TOKENBOX
                    - NU_PAY_ENROLLMENT
                country:
                  type: string
                  description: >-
                    The transaction's country code (MAX 2; MIN 2; [ISO
                    3166-1](/reference/country-reference)).
                  enum:
                    - AR
                    - BO
                    - BR
                    - CL
                    - CO
                    - CR
                    - EC
                    - SV
                    - GT
                    - HN
                    - MX
                    - NI
                    - PA
                    - PY
                    - PE
                    - US
                    - UY
                verify:
                  type: object
                  description: >-
                    Indicates whether to verify the payment with a verify
                    transaction or not. You’ll need to have a provider defined
                    in your CARD route. False by default. Access the [Card
                    Verification](/docs/card-verification) page for more
                    details.
                  required:
                    - vault_on_success
                  properties:
                    vault_on_success:
                      type: boolean
                      description: >-
                        Indicates whether to verify the payment with a verify
                        transaction or not. You’ll need to have a provider
                        defined in your CARD route. False by default.
                    currency:
                      type: string
                      description: >-
                        Currency of the card verification. For a full list of
                        currency codes, see [Country
                        reference](/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: Enroll
                    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: Enroll with card verification
                    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>

````