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

# Create Customer Session

> Creates a customer session for enrolling and managing saved payment methods for future use

Creates a customer session for enrolling and managing payment methods. Use this to save cards, wallets, and other payment methods for future use. Requires a `customer_id` from [Create Customer](https://docs.y.uno/reference/customers/create-customer.md).


## OpenAPI

````yaml openapi/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: >-
                    The unique identifier of the account. You find this
                    information on [the Yuno
                    dashboard](https://dashboard.y.uno/) (UUID, 36 chars).
                country:
                  type: string
                  description: >-
                    The customer's country  (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: >-
                    The unique identifier of the customer, created using the
                    [Create
                    Customer](https://docs.y.uno/reference/create-customer)
                    endpoint (UUID, 36 chars).
                callback_url:
                  type: string
                  description: >-
                    The URL to redirect your customer after the enrollment is
                    made in the provider's environment (MAX 526; MIN 3).
                checkout_id:
                  type: string
                  description: >-
                    The unique identifier (UUID) of the Custom Checkout to use
                    for this enrollment session. Optional. When omitted, the
                    session uses the account's default checkout.
                metadata:
                  type: array
                  description: >-
                    Optional custom key–value tags for the payment method
                    enrolled with this session. They behave like the `metadata`
                    of a direct enrollment: stored with the enrolled payment
                    method, returned when you retrieve it and on the
                    `enrollment.enroll` webhook, and sent to the provider
                    integration with the enrollment, except the reserved
                    `gateway_options` entry, which is stored and returned but
                    not forwarded. Up to 120 items and 75000 characters in
                    total, counting every key and value.
                  items:
                    properties:
                      key:
                        type: string
                        description: >-
                          The metadata key (MAX 48. Value: MIN:1, MAX:48).
                          **[Case Sensitive]**
                      value:
                        type: string
                        description: >-
                          The metadata key value (MAX 512. Value: MIN:1,
                          MAX:512). **[Case Sensitive]**
                    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.