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.
This callback is essential for integrators to detect and gracefully handle cases where a session cannot proceed, such as when:
- The consumer did not present a payment card, and the terminal timed out.
- The consumer canceled the transaction on the Nayax Device.
- A failure occurred on the device during the card presentation.
- Other terminal-side errors that disrupt the flow.
/TriggerTransaction method.
Request
Spark sends a POST request to the/spark/DeclineCallback endpoint:
Request Parameters
The table below describes the parameters of the request:| Field | Type | Required | Description |
|---|---|---|---|
MachineId | Integer | Yes | The ID of the vending machine or terminal |
HwSerial | String | Yes | Serial number of the hardware terminal |
SparkTransactionId | String | Yes | The unique identifier of the failed Spark transaction |
Status | Object | Yes | An object indicating decline details |
Status.Verdict | String | Yes | Always “Declined” |
Status.ErrorCode | Integer | Yes | Decline reason code
|
Status.ErrorDescription | String | Yes | Description of the decline reason |
Nayax CallbackThis is a callback from Nayax, no response body is required. A simple 200 OK server acknowledgment is sufficient.