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

# Crear sesión de cliente

> Crea una sesión de cliente para inscribir y gestionar métodos de pago guardados para uso futuro

Crea una sesión de cliente para inscribir y gestionar métodos de pago. Úsala para guardar tarjetas, billeteras y otros métodos de pago para uso futuro. Requiere un `customer_id` de [Crear cliente](https://docs.y.uno/es/reference/customers/create-customer.md).


## OpenAPI

````yaml openapi/es/customer-sessions-enrollment/create-customer-session.json POST /customers/sessions
openapi: 3.1.0
info:
  title: customer-api
  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: []
paths:
  /customers/sessions:
    post:
      summary: Create Customer Session
      operationId: create-customer-session
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - account_id
                - country
                - customer_id
              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).
                country:
                  type: string
                  description: >-
                    El país del cliente  (MAX 2; MIN 2; [ISO
                    3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
                  enum:
                    - AR
                    - BO
                    - BR
                    - CL
                    - CO
                    - CR
                    - EC
                    - SV
                    - GT
                    - HN
                    - MX
                    - NI
                    - PA
                    - PY
                    - PE
                    - US
                    - UY
                customer_id:
                  type: string
                  description: >-
                    El identificador único del cliente, creado con el endpoint
                    [Create
                    Customer](https://docs.y.uno/es/reference/customers/create-customer)
                    (UUID, 36 caracteres).
                callback_url:
                  type: string
                  description: >-
                    La URL a la que se redirige a tu cliente después de realizar
                    la inscripción en el entorno del proveedor (MAX 526; MIN 3).
                checkout_id:
                  type: string
                  description: >-
                    El identificador único (UUID) del Custom Checkout que se
                    usará para esta sesión de inscripción. Opcional. Si se
                    omite, la sesión usa el checkout predeterminado de la
                    cuenta.
                metadata:
                  type: array
                  description: >-
                    Etiquetas personalizadas opcionales de clave y valor para el
                    método de pago inscrito con esta sesión. Se comportan como
                    el `metadata` de una inscripción directa: se almacenan con
                    el método de pago inscrito, se devuelven cuando lo recuperas
                    y en el webhook `enrollment.enroll`, y se envían a la
                    integración del proveedor junto con la inscripción, excepto
                    la entrada reservada `gateway_options`, que se almacena y se
                    devuelve, pero no se reenvía. Hasta 120 elementos y 75000
                    caracteres en total, contando cada clave y cada valor.
                  items:
                    properties:
                      key:
                        type: string
                        description: >-
                          La clave de la metadata (MAX 48. Valor: MIN:1,
                          MAX:48). **[Distingue mayúsculas y minúsculas]**
                      value:
                        type: string
                        description: >-
                          El valor de la clave de la metadata (MAX 512. Valor:
                          MIN:1, MAX:512). **[Distingue mayúsculas y
                          minúsculas]**
                    required:
                      - key
                      - value
                    type: object
            examples:
              Customer session:
                value:
                  account_id: 8beac4de-5f6f-11ed-9b6a-0242ac120002
                  customer_id: ae106483-65ee-463b-8782-9794022b3112
                  country: US
                  callback_url: >-
                    https://www.google.com/?customerSession=7dd71f21-9e4c-439a-9c6d-58f240bd28df
                  created_at: '2025-05-07T20:00:18.721786Z'
                  checkout_id: 6822f80c-684e-41a3-8628-78963d3d60f7
                  metadata:
                    - key: on_behalf_of
                      value: acct_1A2b3C4d5E6f7G8h
                    - key: order_ref
                      value: ABC-123
      responses:
        '201':
          description: '201'
          content:
            application/json:
              examples:
                Customer session:
                  value:
                    customer_session: 7dd71f21-9e4c-439a-9c6d-58f240bd28df
                    customer_id: ae106483-65ee-463b-8782-9794022b3112
                    country: US
                    callback_url: >-
                      https://www.google.com/?customerSession=7dd71f21-9e4c-439a-9c6d-58f240bd28df
                    created_at: '2025-05-07T20:00:18.721786Z'
                    checkout_id: 6822f80c-684e-41a3-8628-78963d3d60f7
              schema:
                type: object
                properties:
                  customer_session:
                    type: string
                    example: 7dd71f21-9e4c-439a-9c6d-58f240bd28df
                  customer_id:
                    type: string
                    example: ae106483-65ee-463b-8782-9794022b3112
                  country:
                    type: string
                    example: US
                  callback_url:
                    type: string
                    example: >-
                      https://www.google.com/?customerSession=7dd71f21-9e4c-439a-9c6d-58f240bd28df
                  created_at:
                    type: string
                    example: '2025-05-07T20:00:18.721786Z'
                  checkout_id:
                    type: string
                    example: 6822f80c-684e-41a3-8628-78963d3d60f7
                  metadata:
                    type: array
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Bad Request:
                  value:
                    code: INVALID_REQUEST
                    messages:
                      - Invalid request
                Customer Not Found:
                  value:
                    code: CUSTOMER_NOT_FOUND
                    messages:
                      - Customer not found
                  summary: Customer Not Found
              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
      name: private-secret-key
      x-default: <Your private-secret-key>

````

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