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

# StartSession

This is the initial API call sent by Nayax. It initiates the transaction session by authenticating both parties and generating a `SparkTransactionId`, which will be echoed in all subsequent calls throughout the transaction's lifecycle.

<Card title="Try it: Spark Auth Tool" icon="bolt" href="/docs/integrate-pos-device/spark/security-authentication/spark-auth-tool#startsession" arrow>
  Build or inspect the `StartSession` cipher in your browser, no code required. Opens the tool on the StartSession tab.
</Card>


## OpenAPI

````yaml /openapi/spark.yaml post /StartSession
openapi: 3.0.1
info:
  title: Nayax Spark API
  description: RemoteStart V2
  version: v2
servers:
  - url: https://{domain}/api
    variables:
      domain:
        default: nayax-spark-dmz.nayax.com
        description: >-
          Your Nayax-assigned domain (e.g., nayax-spark-dmz.nayax.com). Nayax
          provides a QA domain during sandbox onboarding and a production domain
          after certification.
security: []
tags:
  - name: Transactions
paths:
  /StartSession:
    post:
      tags:
        - Transactions
      summary: StartSession
      requestBody:
        description: The payload to initiate a new session.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartSessionRequest'
      responses:
        '200':
          description: Success. A new session has been successfully initiated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StartSessionResponse'
components:
  schemas:
    StartSessionRequest:
      type: object
      nullable: true
      description: >
        The request payload sent by the Spark platform to the integrator's
        configured `StartSession` endpoint to initiate a transaction session.
      properties:
        HwSerial:
          type: string
          nullable: false
          description: |
            The serial number of the payment terminal hardware.
        MachineId:
          type: integer
          format: int64
          description: |
            The unique identifier for the Nayax machine.
        TokenId:
          type: integer
          format: int32
          description: |
            A unique token provided by Nayax for secure authentication.
        Random:
          type: string
          nullable: false
          description: |
            A random alphanumeric string used for session verification.
      example:
        HwSerial: '0434334921100366'
        MachineId: 71234996
        TokenId: 116383
        Random: 123456789qwertyui
    StartSessionResponse:
      type: object
      nullable: true
      description: >
        The response payload from the `StartSession` endpoint, containing
        encrypted data and the session status.
      properties:
        Cipher:
          type: string
          nullable: false
          description: |
            The encrypted data used to authenticate and initiate the session.
        SparkTransactionId:
          type: string
          nullable: true
          description: >
            The unique identifier for this transaction, which is echoed in all
            subsequent calls throughout the transaction's lifecycle.
        Status:
          $ref: '#/components/schemas/Status'
      example:
        Cipher: >-
          X305dITNTAw2vHsxE+taVcn6UvgBC3fdI6QbqeABgHbo8CKsoZhqISJfslehCiA+L7XYrqvKFci7C6BNj/trzBuNJwBEjgBzKhhgpJ5ggnw=
        Status:
          Verdict: Approved
    Status:
      type: object
      nullable: false
      description: Transaction Status Details
      properties:
        Verdict:
          type: string
          nullable: false
          description: Status of the request (Approved / Declined)
        ErrorCode:
          type: integer
          format: int16
          nullable: true
          description: |
            - Conditional
            - Reason for declined request
        ErrorDescription:
          type: string
          nullable: true
          description: |
            - Conditional
            - Length: 255
            - Error description
        StatusMessage:
          type: string
          nullable: true
          description: |
            - Optional
            - Length: 255
            - Transaction status message as free text field

````