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

# Get customer session by sessionId

> Retrieves a customer session by its sessionId with all data hydrated including customer details and purchases. The session must belong to the authenticated provider.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/sdk/customers/customer-sessions/{sessionId}
openapi: 3.0.0
info:
  contact: {}
  description: The SolvaPay REST API specification
  title: SolvaPay REST API
  version: '1.0'
servers: []
security: []
tags: []
paths:
  /v1/sdk/customers/customer-sessions/{sessionId}:
    get:
      tags:
        - Customers
      summary: Get customer session by sessionId
      description: >-
        Retrieves a customer session by its sessionId with all data hydrated
        including customer details and purchases. The session must belong to the
        authenticated provider.
      operationId: CustomerSdkController_getCustomerSession
      parameters:
        - description: Customer session ID/token
          in: path
          name: sessionId
          required: true
          schema:
            example: e3f1c2d4b6a89f001122334455667788
            type: string
      responses:
        '200':
          content:
            application/json:
              example:
                createdAt: '2025-01-01T11:45:00.000Z'
                customer:
                  email: customer@example.com
                  externalRef: auth_user_12345
                  name: John Doe
                  purchases:
                    - amount: 9900
                      currency: USD
                      endDate: '2025-11-27T10:00:00Z'
                      productName: API Gateway Manager
                      productRef: prd_abc123
                      reference: pur_1A2B3C4D
                      startDate: '2025-10-27T10:00:00Z'
                      status: active
                  reference: cus_3c4d5e6f7g8h
                customerUrl: >-
                  https://solvapay.com/customer/manage?id=e3f1c2d4b6a89f001122334455667788
                expiresAt: '2025-01-01T12:00:00.000Z'
                sessionId: e3f1c2d4b6a89f001122334455667788
                status: active
                updatedAt: '2025-01-01T11:45:00.000Z'
              schema:
                $ref: '#/components/schemas/GetCustomerSessionResponse'
          description: Customer session retrieved successfully
        '404':
          content:
            application/json:
              schema:
                example:
                  error: Not Found
                  message: 'Customer session not found: e3f1c2d4b6a89f001122334455667788'
                  statusCode: 404
          description: Customer session not found
      security:
        - SecretKey: []
components:
  schemas:
    GetCustomerSessionResponse:
      properties:
        createdAt:
          description: Session creation date
          example: '2025-01-01T11:45:00.000Z'
          type: string
        customer:
          allOf:
            - $ref: '#/components/schemas/CustomerResponse'
          description: Customer object from session data
        customerUrl:
          description: >-
            Full customer URL based on backend configuration (ready to redirect
            customer)
          example: >-
            https://solvapay.com/customer/manage?id=e3f1c2d4b6a89f001122334455667788
          type: string
        expiresAt:
          description: Session expiration date
          example: '2025-01-01T12:00:00.000Z'
          type: string
        sessionId:
          description: Customer session ID/token
          example: e3f1c2d4b6a89f001122334455667788
          type: string
        status:
          description: Session status
          enum:
            - active
            - expired
            - used
          example: active
          type: string
        updatedAt:
          description: Session last update date
          example: '2025-01-01T11:45:00.000Z'
          type: string
      required:
        - sessionId
        - status
        - customerUrl
        - expiresAt
        - customer
        - createdAt
        - updatedAt
      type: object
    CustomerResponse:
      properties:
        email:
          description: Customer email address
          example: customer@example.com
          type: string
        externalRef:
          description: >-
            External reference ID from your auth system (if set during creation
            or update)
          example: auth_user_12345
          type: string
        name:
          description: Customer full name
          example: John Doe
          type: string
        purchases:
          description: Active purchases
          items:
            $ref: '#/components/schemas/PurchaseInfo'
          type: array
        reference:
          description: Customer reference identifier
          example: cus_3c4d5e6f7g8h
          type: string
      required:
        - reference
        - name
        - email
      type: object
    PurchaseInfo:
      properties:
        amount:
          description: Amount in USD cents (normalised for aggregation)
          example: 9900
          type: number
        cancellationReason:
          description: Reason for cancellation
          example: Customer request
          type: string
        cancelledAt:
          description: When purchase was cancelled
          example: '2025-10-28T10:00:00Z'
          type: string
        currency:
          description: ISO 4217 currency code of the customer-facing charge
          example: GBP
          type: string
        endDate:
          description: End date of purchase
          example: '2025-11-27T10:00:00Z'
          type: string
        exchangeRate:
          description: Exchange rate from original currency to USD
          example: 1.32
          type: number
        originalAmount:
          description: Original amount in the payment currency (minor units)
          example: 7500
          type: number
        planRef:
          description: Plan reference from the plan snapshot, for reliable plan matching
          example: pln_abc123
          type: string
        planSnapshot:
          description: Snapshot of the plan at time of purchase
          type: object
        productName:
          description: Product name
          example: API Gateway Manager
          type: string
        productRef:
          description: Product reference
          example: prd_abc123
          type: string
        reference:
          description: Purchase reference
          example: pur_1A2B3C4D
          type: string
        startDate:
          description: Start date
          example: '2025-10-27T10:00:00Z'
          type: string
        status:
          description: Purchase status
          example: active
          type: string
      required:
        - reference
        - productName
        - status
        - startDate
        - amount
        - currency
      type: object
  securitySchemes:
    SecretKey:
      bearerFormat: JWT
      description: >-
        Provider secret API key (sk_live_… / sk_test_…) supplied as a Bearer
        token.
      scheme: bearer
      type: http

````