curl --request POST \
--url https://{domain}/api/DeclineCallback \
--header 'Content-Type: application/json' \
--data '
{
"MachineId": 71234996,
"HwSerial": "0434334921100366",
"SparkTransactionId": "12c7cec2-c690-4425-9a1f-db0db60e2d8c",
"Status": {
"Verdict": "Declined",
"ErrorCode": 44,
"ErrorDescription": "Timeout on POS Device"
}
}
'import requests
url = "https://{domain}/api/DeclineCallback"
payload = {
"MachineId": 71234996,
"HwSerial": "0434334921100366",
"SparkTransactionId": "12c7cec2-c690-4425-9a1f-db0db60e2d8c",
"Status": {
"Verdict": "Declined",
"ErrorCode": 44,
"ErrorDescription": "Timeout on POS Device"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
MachineId: 71234996,
HwSerial: '0434334921100366',
SparkTransactionId: '12c7cec2-c690-4425-9a1f-db0db60e2d8c',
Status: {Verdict: 'Declined', ErrorCode: 44, ErrorDescription: 'Timeout on POS Device'}
})
};
fetch('https://{domain}/api/DeclineCallback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{domain}/api/DeclineCallback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'MachineId' => 71234996,
'HwSerial' => '0434334921100366',
'SparkTransactionId' => '12c7cec2-c690-4425-9a1f-db0db60e2d8c',
'Status' => [
'Verdict' => 'Declined',
'ErrorCode' => 44,
'ErrorDescription' => 'Timeout on POS Device'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{domain}/api/DeclineCallback"
payload := strings.NewReader("{\n \"MachineId\": 71234996,\n \"HwSerial\": \"0434334921100366\",\n \"SparkTransactionId\": \"12c7cec2-c690-4425-9a1f-db0db60e2d8c\",\n \"Status\": {\n \"Verdict\": \"Declined\",\n \"ErrorCode\": 44,\n \"ErrorDescription\": \"Timeout on POS Device\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{domain}/api/DeclineCallback")
.header("Content-Type", "application/json")
.body("{\n \"MachineId\": 71234996,\n \"HwSerial\": \"0434334921100366\",\n \"SparkTransactionId\": \"12c7cec2-c690-4425-9a1f-db0db60e2d8c\",\n \"Status\": {\n \"Verdict\": \"Declined\",\n \"ErrorCode\": 44,\n \"ErrorDescription\": \"Timeout on POS Device\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/api/DeclineCallback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"MachineId\": 71234996,\n \"HwSerial\": \"0434334921100366\",\n \"SparkTransactionId\": \"12c7cec2-c690-4425-9a1f-db0db60e2d8c\",\n \"Status\": {\n \"Verdict\": \"Declined\",\n \"ErrorCode\": 44,\n \"ErrorDescription\": \"Timeout on POS Device\"\n }\n}"
response = http.request(request)
puts response.read_body{
"SparkTransactionId": "12c7cec2-c690-4425-9a1f-db0db60e2d8c",
"Status": {
"Verdict": "Declined",
"ErrorCode": 44,
"ErrorDescription": "Timeout on POS Device"
}
}DeclineCallback
curl --request POST \
--url https://{domain}/api/DeclineCallback \
--header 'Content-Type: application/json' \
--data '
{
"MachineId": 71234996,
"HwSerial": "0434334921100366",
"SparkTransactionId": "12c7cec2-c690-4425-9a1f-db0db60e2d8c",
"Status": {
"Verdict": "Declined",
"ErrorCode": 44,
"ErrorDescription": "Timeout on POS Device"
}
}
'import requests
url = "https://{domain}/api/DeclineCallback"
payload = {
"MachineId": 71234996,
"HwSerial": "0434334921100366",
"SparkTransactionId": "12c7cec2-c690-4425-9a1f-db0db60e2d8c",
"Status": {
"Verdict": "Declined",
"ErrorCode": 44,
"ErrorDescription": "Timeout on POS Device"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
MachineId: 71234996,
HwSerial: '0434334921100366',
SparkTransactionId: '12c7cec2-c690-4425-9a1f-db0db60e2d8c',
Status: {Verdict: 'Declined', ErrorCode: 44, ErrorDescription: 'Timeout on POS Device'}
})
};
fetch('https://{domain}/api/DeclineCallback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{domain}/api/DeclineCallback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'MachineId' => 71234996,
'HwSerial' => '0434334921100366',
'SparkTransactionId' => '12c7cec2-c690-4425-9a1f-db0db60e2d8c',
'Status' => [
'Verdict' => 'Declined',
'ErrorCode' => 44,
'ErrorDescription' => 'Timeout on POS Device'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{domain}/api/DeclineCallback"
payload := strings.NewReader("{\n \"MachineId\": 71234996,\n \"HwSerial\": \"0434334921100366\",\n \"SparkTransactionId\": \"12c7cec2-c690-4425-9a1f-db0db60e2d8c\",\n \"Status\": {\n \"Verdict\": \"Declined\",\n \"ErrorCode\": 44,\n \"ErrorDescription\": \"Timeout on POS Device\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{domain}/api/DeclineCallback")
.header("Content-Type", "application/json")
.body("{\n \"MachineId\": 71234996,\n \"HwSerial\": \"0434334921100366\",\n \"SparkTransactionId\": \"12c7cec2-c690-4425-9a1f-db0db60e2d8c\",\n \"Status\": {\n \"Verdict\": \"Declined\",\n \"ErrorCode\": 44,\n \"ErrorDescription\": \"Timeout on POS Device\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/api/DeclineCallback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"MachineId\": 71234996,\n \"HwSerial\": \"0434334921100366\",\n \"SparkTransactionId\": \"12c7cec2-c690-4425-9a1f-db0db60e2d8c\",\n \"Status\": {\n \"Verdict\": \"Declined\",\n \"ErrorCode\": 44,\n \"ErrorDescription\": \"Timeout on POS Device\"\n }\n}"
response = http.request(request)
puts response.read_body{
"SparkTransactionId": "12c7cec2-c690-4425-9a1f-db0db60e2d8c",
"Status": {
"Verdict": "Declined",
"ErrorCode": 44,
"ErrorDescription": "Timeout on POS Device"
}
}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.Body
The request payload containing details of the failed transaction.
The request payload sent by Spark to the integrator's /spark/DeclineCallback endpoint to report a failed transaction.
The unique ID of the vending machine or terminal where the transaction occurred.
The serial number of the hardware terminal.
The unique identifier of the failed Spark transaction. This ID is typically generated during the StartAuthentication process.
Transaction Status Details
Show child attributes
Show child attributes
Response
Success. A simple 200 OK server acknowledgment is sufficient.
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.
Was this page helpful?