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

# DeclineCallback

The `DeclineCallback` API call is used to notify you of a failure in the
Spark transaction process. It is typically triggered after a successful
`/TriggerTransaction` response with a verdict of `Approved`, but when
the flow subsequently fails for any reason before payment authorization.


## OpenAPI

````yaml /openapi/spark.yaml post /DeclineCallback
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:
  /DeclineCallback:
    post:
      tags:
        - Transactions
      summary: DeclineCallback
      requestBody:
        description: The request payload containing details of the failed transaction.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeclineCallbackRequest'
      responses:
        '200':
          description: Success. A simple 200 OK server acknowledgment is sufficient.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeclineCallbackOutcome'
components:
  schemas:
    DeclineCallbackRequest:
      type: object
      nullable: true
      description: >
        The request payload sent by Spark to the integrator's
        `/spark/DeclineCallback` endpoint to report a failed transaction.
      properties:
        MachineId:
          type: integer
          format: int64
          description: >
            The unique ID of the vending machine or terminal where the
            transaction occurred.
        HwSerial:
          type: string
          nullable: false
          description: |
            The serial number of the hardware terminal.
        SparkTransactionId:
          type: string
          nullable: true
          description: >
            The unique identifier of the failed Spark transaction. This ID is
            typically generated during the `StartAuthentication` process.
        Status:
          $ref: '#/components/schemas/Status'
      example:
        MachineId: 71234996
        HwSerial: '0434334921100366'
        SparkTransactionId: 12c7cec2-c690-4425-9a1f-db0db60e2d8c
        Status:
          Verdict: Declined
          ErrorCode: 44
          ErrorDescription: Timeout on POS Device
    DeclineCallbackOutcome:
      type: object
      nullable: true
      description: >
        The response payload from the `DeclineCallback` endpoint, providing
        details about a failed Spark transaction. This payload confirms the
        transaction's failure and provides contextual information.
      properties:
        SparkTransactionId:
          type: string
          nullable: true
          description: >
            The unique identifier for the failed Spark transaction session. This
            ID is initially generated during the `StartAuthentication` process
            and is used to track the session throughout its lifecycle.
        Status:
          $ref: '#/components/schemas/Status'
      example:
        SparkTransactionId: 12c7cec2-c690-4425-9a1f-db0db60e2d8c
        Status:
          Verdict: Declined
          ErrorCode: 44
          ErrorDescription: Timeout on POS Device
    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

````