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

# Settlement

The `Settlement` endpoint is used to finalize an approved transaction.
After the session ends and the total amount is known, the integrator
sends the final amount along with optional e-receipt information. This
method is only relevant for transactions with Pre-Authorization.


## OpenAPI

````yaml /openapi/spark.yaml post /Settlement
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:
  /Settlement:
    post:
      tags:
        - Transactions
      summary: Settlement
      requestBody:
        description: >-
          The request payload containing the final transaction amount and
          optional e-receipt data.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SettlementRequest'
      responses:
        '200':
          description: Success. The transaction has been successfully settled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SettlementResponse'
components:
  schemas:
    SettlementRequest:
      type: object
      nullable: true
      description: >
        The request payload to finalize a pre-authorized transaction after the
        session ends and the final amount is known. This method is only relevant
        for transactions using the Pre-Authorization flow.
      properties:
        NayaxTransactionId:
          type: integer
          format: int64
          description: >
            The unique transaction ID assigned by Nayax for the transaction
            being settled.
        SparkTransactionId:
          type: string
          nullable: true
          description: >
            The unique session ID from the initial `/StartAuthentication`
            request. This ID links the settlement to the original transaction.
        SiteId:
          type: integer
          format: int16
          nullable: true
          description: >
            The identifier of the site where the transaction occurred. This
            value is an echo from the initial authorization callback.
        TerminalId:
          type: string
          nullable: false
          description: |
            The serial or external ID of the terminal used for the transaction.
        TerminalIdType:
          type: integer
          format: int32
          nullable: true
          description: >
            Defines the ID type used for the `TerminalId`. Use `1` for the HW
            Serial and `2` for the Nayax Machine ID.
        Amount:
          type: number
          format: double
          description: >
            The final transaction amount to be settled, specified in major
            currency units (e.g., dollars or euros).
        EReceiptData:
          type: string
          nullable: true
          description: >
            An optional JSON-formatted string containing additional e-receipt
            details. This data can be used to provide digital receipts to
            consumers via the Nayax eReceipt platform.
      example:
        NayaxTransactionId: 2004545072
        SparkTransactionId: 12c7cec2-c690-4425-9a1f-db0db60e2d8c
        SiteId: 2
        TerminalId: '0434334921100366'
        TerminalIdType: 1
        Amount: 12.25
        EReceiptData: >-
          {"General":[{"Company":"Your Payments - Our Solutions","Station
          Name":"B12"}],"Service":[{"Product":"Something Yummy","Price Per
          Unit":"$2.45","Number of Units":2}]}
    SettlementResponse:
      type: object
      nullable: true
      description: >
        The response payload returned by Spark upon a successful `Settlement`
        request. This payload includes final transaction details such as the
        settled amount, card information, and timestamps.
      properties:
        SparkTransactionId:
          type: string
          nullable: true
          description: >
            The unique ID used for this transaction session, which is an echo of
            the value sent in the request.
        Status:
          $ref: '#/components/schemas/Status'
        CardBrand:
          type: string
          nullable: true
          description: >
            The brand of the card used for the transaction, such as `Visa` or
            `MasterCard`.
        CardLast4Digits:
          type: string
          nullable: true
          description: |
            The last four digits of the payment card used.
        AuthCode:
          type: string
          nullable: true
          description: >
            The authorization code returned by the payment provider for the
            transaction.
        MachineAuTime:
          type: string
          nullable: true
          description: >
            The device timestamp at the moment of authorization, formatted as
            `yyyyMMddHHmmssSSS`.
        AuTime:
          type: string
          nullable: true
          description: |
            The authorization server's timestamp.
        SeTime:
          type: string
          nullable: true
          description: >
            The timestamp from the settlement server, formatted as
            `yyyyMMddHHmmssSSS`.
        CurrencyCode:
          type: string
          nullable: true
          description: |
            The ISO currency code for the transaction, such as `EUR`.
        CurrencyNumeric:
          type: string
          nullable: true
          description: |
            The ISO 4217 numeric currency code, such as `978` for EUR.
        FiscalRrn:
          type: string
          nullable: true
          description: >
            The fiscal reference number for the transaction, used for receipt
            and audit purposes.
        NayaxRRN:
          type: string
          nullable: true
          description: |
            The internal Nayax settlement reference number.
        Amount:
          type: number
          format: double
          description: |
            The final settled amount, approved by the Payment Provider.
      example:
        SparkTransactionId: 12c7cec2-c690-4425-9a1f-db0db60e2d8c
        Status:
          Verdict: Approved
          ErrorDescription: No Errors
        CardBrand: Visa
        CardLast4Digits: '1234'
        AuthCode: '333333'
        MachineAuTime: '20240205194122328'
        AuTime: '20240205174122328'
        SeTime: '20240205192215572'
        CurrencyCode: EUR
        CurrencyNumeric: '978'
        FiscalRrn: 1A2b3C4d5E6f7g8H9i
        NayaxRRN: '111111'
        Amount: 12.25
    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

````