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

# Retrieve Transaction Status by Session ID

> Retrieves the transaction status and other relevant details, including the receipt URL, using a session ID.



## OpenAPI

````yaml openapi/ecom.yaml POST /get-transaction-by-session
openapi: 3.0.1
info:
  title: Nayax Ecom SDK API
  version: v1
  description: >-
    This OpenAPI specification describes the Nayax SDK API, designed to
    facilitate e-commerce transactions, including initialization, payment
    processing, and card token management. It supports various transaction types
    such as Customer-Initiated Transactions (CIT), Merchant-Initiated
    Transactions (MIT), and Card-on-File (COF) operations. The API focuses on
    secure authentication, efficient transaction flows, and real-time status
    updates, with robust error handling and logging capabilities.
servers:
  - url: https://api.nayax.com/sdk
    description: Production Nayax SDK API
security:
  - BearerAuth: []
tags:
  - name: Payments
    description: Operations related to the Nayax SDK API for e-commerce transactions.
  - name: Testing
    description: Endpoints for testing connectivity.
paths:
  /get-transaction-by-session:
    post:
      tags:
        - Management
      summary: Retrieve Transaction Status by Session ID
      description: >-
        Retrieves the transaction status and other relevant details, including
        the receipt URL, using a session ID.
      requestBody:
        description: Request to get transaction details by session ID.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionStatusRequest'
            examples:
              getTransactionStatusRequest:
                summary: Example Get Transaction Status Request
                value:
                  basicInfo:
                    merchantRequestId: REQ_GETTRANS_001
                  machineInfo:
                    machineId: '0434334921100366'
                  sessionInfo:
                    nayaxSessionId: ABCDEF123456
                  transactionIdentifyerType: 0
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionStatusResponse'
              examples:
                getTransactionStatusResponseApproved:
                  summary: Example Get Transaction Status Response (Approved)
                  value:
                    status:
                      verdict: Approved
                      code: 0
                      statusMessage: Transaction retrieved successfully.
                    externalTransactionStatus: 12
                getTransactionStatusResponseDeclined:
                  summary: Example Get Transaction Status Response (Declined)
                  value:
                    status:
                      verdict: Declined
                      code: 603
                      statusMessage: Transaction not found.
                    externalTransactionStatus: null
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Status'
              examples:
                badRequest:
                  summary: Bad Request Example
                  value:
                    verdict: Declined
                    code: 997
                    statusMessage: Did not receive mandatory parameters.
components:
  schemas:
    TransactionStatusRequest:
      type: object
      description: Request body for retrieving transaction status.
      properties:
        basicInfo:
          $ref: '#/components/schemas/BasicInfo'
          description: Basic request information.
        machineInfo:
          $ref: '#/components/schemas/MachineInfo'
          description: Information about the machine/terminal.
        validationKey:
          type: string
          nullable: true
          description: Validation key from the authentication flow.
          example: AUTH_KEY_FROM_VALIDATE
        transactionIdentifyerType:
          $ref: '#/components/schemas/TransactionIdentifyerType'
          description: The type of identifier used for the transaction query.
          example: 0
        sessionInfo:
          $ref: '#/components/schemas/SessionInfo'
          description: Session information, including NayaxSessionId or ExternalSessionId.
      additionalProperties: false
    TransactionStatusResponse:
      type: object
      description: Response body for retrieving transaction status.
      properties:
        status:
          $ref: '#/components/schemas/Status'
          description: Transaction status.
        externalTransactionStatus:
          $ref: '#/components/schemas/ExternalTransactionStatus'
          description: External transaction status from the billing provider.
      additionalProperties: false
    Status:
      type: object
      description: General status object for API responses.
      properties:
        verdict:
          type: string
          nullable: true
          description: Const string values 'Approved' or 'Declined'.
          example: Approved
        code:
          type: integer
          format: int32
          description: Response code. 0 for Approved, relevant decline code for Declined.
          example: 0
        statusMessage:
          type: string
          nullable: true
          maxLength: 255
          description: >-
            Optional. Session status message free text field or additional
            varying data.
          example: Transaction processed successfully.
        customDeclineCode:
          type: string
          nullable: true
          description: >-
            Custom decline code, can also be used to return the
            HashedEcomTransactionId for validate-merchant success.
          example: 9515af0d6b5c328b6383ff241fa7b03e489d6285a8db6a4f0d8369e3f044e8d7
      additionalProperties: false
      required:
        - verdict
    BasicInfo:
      type: object
      description: Basic information for a transaction.
      properties:
        sessionExpiration:
          type: string
          format: date-time
          nullable: true
          description: Session expiration date and time.
          example: '2025-12-31T23:59:59Z'
        redirectURL:
          type: string
          nullable: true
          description: URL where the shopper should be redirected after a redirection flow.
          example: https://your-merchant.com/callback
        amount:
          type: number
          format: double
          nullable: true
          description: Transaction amount.
          example: 15
        currency:
          type: string
          nullable: true
          minLength: 3
          maxLength: 3
          description: The three-character ISO currency code according to ISO4217.
          example: USD
        countryCode:
          type: string
          nullable: true
          description: Country code according to ISO 3166.
          example: US
        requestType:
          $ref: '#/components/schemas/RequestType'
          description: Session transaction type.
          example: 0
        entryMode:
          $ref: '#/components/schemas/EntryMode'
          description: |-
            Indicates the point-of-sale entry mode.
            For Initialize requests, values may be ECOM, COF or MOTO.
            For Payment requests, values may be MIT or CIT.
          example: 0
        tokenModel:
          $ref: '#/components/schemas/TokenModel'
          description: >-
            Conditional (mandatory if EntryMode is COF). Indicates the desired
            token model. **Note on Token Behaviour**: A token's type
            (subscription/COF/top-up) is set during its initial creation and
            stored in our system. If a subsequent [Charge
            Token](ref:post_charge-token) request includes a different token
            type parameter, it is ignored. The system always uses the original
            token type from the initialization request, regardless of what is
            provided in later charge requests.
          example: 0
        platform:
          $ref: '#/components/schemas/Platform'
          description: >-
            The platform from which the request originated (e.g., iOS, Android,
            Web).
          example: 0
        isStoredCard:
          type: boolean
          nullable: true
          description: Optional. Cardholder approval for card saving.
          example: true
        cvc:
          type: integer
          format: int32
          nullable: true
          description: Optional (for CIT only). Secure code for transaction verification.
          example: 123
        token:
          type: string
          nullable: true
          description: >-
            Conditional (mandatory if EntryMode is MIT or CIT). Saved Card token
            (Nayax token ID).
          example: NAYAXTOK12345
        merchantRequestId:
          type: string
          nullable: true
          description: >-
            The actor's/integrator's transaction ID. Will be passed as
            "MerchantTranId" in the SDK.
          example: MERCHANT_REQ_12345
        transactionId:
          type: string
          nullable: true
          description: >-
            Conditional Nayax Transaction Identifier, required for second-step
            transactions (Refund etc.).
          example: NAYAXTRANS98765
        transactionTimeUtc:
          type: string
          format: date-time
          nullable: true
          description: >-
            Conditional. Nayax Transaction Identifier for second-step
            transactions (Refund etc.).
          example: '2025-08-28T10:30:00Z'
        isSaveTokenWithoutConsent:
          type: boolean
          nullable: true
          description: >-
            Indicates if the token should be saved without explicit cardholder
            consent.
          example: false
      additionalProperties: false
      required:
        - amount
        - countryCode
        - requestType
        - entryMode
        - sessionExpiration
        - redirectURL
    MachineInfo:
      type: object
      description: Information about the machine or terminal.
      properties:
        machineId:
          type: string
          nullable: true
          description: Machine entity unique ID allocated in the Nayax Backoffice.
          example: '0434334921100366'
      additionalProperties: false
      required:
        - machineId
    TransactionIdentifyerType:
      type: integer
      format: int32
      description: Type of identifier used for a transaction.
      enum:
        - 0
        - 1
      x-enum-varnames:
        - NayaxSessionId
        - ExternalSessionId
    SessionInfo:
      type: object
      description: Session-related information.
      properties:
        nayaxSessionId:
          type: string
          nullable: true
          description: Unique Nayax Session ID that identifies the payment request.
          example: ABCDEF123456
        externalSessionId:
          type: string
          nullable: true
          description: >-
            Unique External Session ID that identifies the payment request, from
            the VAS ECOM provider.
          example: EXTSESS7890
        expirationDate:
          type: string
          format: date-time
          nullable: true
          description: Optional. Session expired date and time.
          example: '2025-12-31T23:59:59Z'
        additionalSessionData:
          type: string
          nullable: true
          description: >-
            Optional. Additional data related to the session in JSON format.
            This data could be required for the VAS ECOM provider.
          example: '{"providerSpecific": "data", "callbackUrl": "https://callback.com"}'
      additionalProperties: false
      required:
        - nayaxSessionId
    ExternalTransactionStatus:
      type: integer
      format: int32
      description: External transaction status codes from the billing provider.
      enum:
        - 12
        - 19
        - 22
        - 53
        - 62
        - 64
        - 113
        - 250
        - 5000
        - 5001
        - 5002
      x-enum-varnames:
        - Approved
        - PartialApproval
        - Declined
        - Pending
        - Voided
        - Refunded
        - Cancelled
        - GeneralDecline
        - ProviderError
        - Timeout
        - UnknownStatus
    RequestType:
      type: integer
      format: int32
      description: Session Transaction Type.
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
      x-enum-varnames:
        - Sale
        - Auth
        - Settlement
        - Void
        - Refund
        - PartialRefund
        - IncrementalAuth
        - CancelAuth
        - PartialCapture
        - AutoCapture
        - DelayAuth
    EntryMode:
      type: integer
      format: int32
      description: Indicates the point-of-sale entry mode.
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
      x-enum-varnames:
        - ECOM
        - MIT
        - CIT
        - COF
        - MOTO
    TokenModel:
      type: integer
      format: int32
      description: >-
        Indicates the desired token model. **Note on Token Behaviour**: A
        token's type (subscription/COF/top-up) is set during its initial
        creation and stored in our system. If a subsequent [Charge
        Token](ref:post_charge-token) request includes a different token type
        parameter, it is ignored. The system always uses the original token type
        from the initialization request, regardless of what is provided in later
        charge requests.
      enum:
        - 0
        - 1
        - 2
      x-enum-varnames:
        - StoredCard
        - Subscription
        - TopUp
    Platform:
      type: integer
      format: int32
      description: Platform from which the request originated.
      enum:
        - 0
        - 1
        - 2
      x-enum-varnames:
        - iOS
        - Android
        - Web
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT RSA token required for authentication. The token should be included
        in the `Authorization` header as `Bearer <token>`.

        Nayax will issue tokens to the VAS, signed by a private key, and decrypt
        them using a public key.

````