curl --request POST \
--url https://{domain}/api/TriggerTransaction \
--header 'Content-Type: application/json' \
--data '
{
"SparkTransactionId": "12c7cec2-c690-4425-9a1f-db0db60e2d8c",
"TerminalId": "0434334921100366",
"TerminalIdType": 1,
"Amount": 15,
"PosDisplay": ";Charging Station:3;Day:30.52p;Night:9p;Standing charge:52.18p/day; Off-peak:12:30-04:30;",
"TransactionTimeout": 60
}
'import requests
url = "https://{domain}/api/TriggerTransaction"
payload = {
"SparkTransactionId": "12c7cec2-c690-4425-9a1f-db0db60e2d8c",
"TerminalId": "0434334921100366",
"TerminalIdType": 1,
"Amount": 15,
"PosDisplay": ";Charging Station:3;Day:30.52p;Night:9p;Standing charge:52.18p/day; Off-peak:12:30-04:30;",
"TransactionTimeout": 60
}
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({
SparkTransactionId: '12c7cec2-c690-4425-9a1f-db0db60e2d8c',
TerminalId: '0434334921100366',
TerminalIdType: 1,
Amount: 15,
PosDisplay: ';Charging Station:3;Day:30.52p;Night:9p;Standing charge:52.18p/day; Off-peak:12:30-04:30;',
TransactionTimeout: 60
})
};
fetch('https://{domain}/api/TriggerTransaction', 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/TriggerTransaction",
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([
'SparkTransactionId' => '12c7cec2-c690-4425-9a1f-db0db60e2d8c',
'TerminalId' => '0434334921100366',
'TerminalIdType' => 1,
'Amount' => 15,
'PosDisplay' => ';Charging Station:3;Day:30.52p;Night:9p;Standing charge:52.18p/day; Off-peak:12:30-04:30;',
'TransactionTimeout' => 60
]),
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/TriggerTransaction"
payload := strings.NewReader("{\n \"SparkTransactionId\": \"12c7cec2-c690-4425-9a1f-db0db60e2d8c\",\n \"TerminalId\": \"0434334921100366\",\n \"TerminalIdType\": 1,\n \"Amount\": 15,\n \"PosDisplay\": \";Charging Station:3;Day:30.52p;Night:9p;Standing charge:52.18p/day; Off-peak:12:30-04:30;\",\n \"TransactionTimeout\": 60\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/TriggerTransaction")
.header("Content-Type", "application/json")
.body("{\n \"SparkTransactionId\": \"12c7cec2-c690-4425-9a1f-db0db60e2d8c\",\n \"TerminalId\": \"0434334921100366\",\n \"TerminalIdType\": 1,\n \"Amount\": 15,\n \"PosDisplay\": \";Charging Station:3;Day:30.52p;Night:9p;Standing charge:52.18p/day; Off-peak:12:30-04:30;\",\n \"TransactionTimeout\": 60\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/api/TriggerTransaction")
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 \"SparkTransactionId\": \"12c7cec2-c690-4425-9a1f-db0db60e2d8c\",\n \"TerminalId\": \"0434334921100366\",\n \"TerminalIdType\": 1,\n \"Amount\": 15,\n \"PosDisplay\": \";Charging Station:3;Day:30.52p;Night:9p;Standing charge:52.18p/day; Off-peak:12:30-04:30;\",\n \"TransactionTimeout\": 60\n}"
response = http.request(request)
puts response.read_body{
"SparkTransactionId": "12c7cec2-c690-4425-9a1f-db0db60e2d8c",
"Status": {
"Verdict": "Approved",
"ErrorDescription": " No Errors "
}
}TriggerTransaction
curl --request POST \
--url https://{domain}/api/TriggerTransaction \
--header 'Content-Type: application/json' \
--data '
{
"SparkTransactionId": "12c7cec2-c690-4425-9a1f-db0db60e2d8c",
"TerminalId": "0434334921100366",
"TerminalIdType": 1,
"Amount": 15,
"PosDisplay": ";Charging Station:3;Day:30.52p;Night:9p;Standing charge:52.18p/day; Off-peak:12:30-04:30;",
"TransactionTimeout": 60
}
'import requests
url = "https://{domain}/api/TriggerTransaction"
payload = {
"SparkTransactionId": "12c7cec2-c690-4425-9a1f-db0db60e2d8c",
"TerminalId": "0434334921100366",
"TerminalIdType": 1,
"Amount": 15,
"PosDisplay": ";Charging Station:3;Day:30.52p;Night:9p;Standing charge:52.18p/day; Off-peak:12:30-04:30;",
"TransactionTimeout": 60
}
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({
SparkTransactionId: '12c7cec2-c690-4425-9a1f-db0db60e2d8c',
TerminalId: '0434334921100366',
TerminalIdType: 1,
Amount: 15,
PosDisplay: ';Charging Station:3;Day:30.52p;Night:9p;Standing charge:52.18p/day; Off-peak:12:30-04:30;',
TransactionTimeout: 60
})
};
fetch('https://{domain}/api/TriggerTransaction', 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/TriggerTransaction",
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([
'SparkTransactionId' => '12c7cec2-c690-4425-9a1f-db0db60e2d8c',
'TerminalId' => '0434334921100366',
'TerminalIdType' => 1,
'Amount' => 15,
'PosDisplay' => ';Charging Station:3;Day:30.52p;Night:9p;Standing charge:52.18p/day; Off-peak:12:30-04:30;',
'TransactionTimeout' => 60
]),
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/TriggerTransaction"
payload := strings.NewReader("{\n \"SparkTransactionId\": \"12c7cec2-c690-4425-9a1f-db0db60e2d8c\",\n \"TerminalId\": \"0434334921100366\",\n \"TerminalIdType\": 1,\n \"Amount\": 15,\n \"PosDisplay\": \";Charging Station:3;Day:30.52p;Night:9p;Standing charge:52.18p/day; Off-peak:12:30-04:30;\",\n \"TransactionTimeout\": 60\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/TriggerTransaction")
.header("Content-Type", "application/json")
.body("{\n \"SparkTransactionId\": \"12c7cec2-c690-4425-9a1f-db0db60e2d8c\",\n \"TerminalId\": \"0434334921100366\",\n \"TerminalIdType\": 1,\n \"Amount\": 15,\n \"PosDisplay\": \";Charging Station:3;Day:30.52p;Night:9p;Standing charge:52.18p/day; Off-peak:12:30-04:30;\",\n \"TransactionTimeout\": 60\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/api/TriggerTransaction")
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 \"SparkTransactionId\": \"12c7cec2-c690-4425-9a1f-db0db60e2d8c\",\n \"TerminalId\": \"0434334921100366\",\n \"TerminalIdType\": 1,\n \"Amount\": 15,\n \"PosDisplay\": \";Charging Station:3;Day:30.52p;Night:9p;Standing charge:52.18p/day; Off-peak:12:30-04:30;\",\n \"TransactionTimeout\": 60\n}"
response = http.request(request)
puts response.read_body{
"SparkTransactionId": "12c7cec2-c690-4425-9a1f-db0db60e2d8c",
"Status": {
"Verdict": "Approved",
"ErrorDescription": " No Errors "
}
}TriggerTransaction endpoint initiates user interaction with the physical terminal by sending a wake-up signal to the specified device.Body
The request payload containing the details to trigger a transaction.
The request payload for the /spark/TriggerTransaction endpoint. This call initiates user interaction with a physical terminal and provides the necessary details for the transaction.
The unique session ID received from Spark during the StartAuthentication process.
The unique ID of the target terminal.
Defines the ID type used for the TerminalId. Use 1 for the HW Serial or 2 for the Nayax Machine ID.
The amount to be pre-authorized or charged for the transaction. This value is required for the Pre-Selection flow.
An optional custom message to show on the terminal's display.
Optional JSON-formatted string representing e-receipt details for machine operators who wish to provide digital receipts.
The timeout in seconds for the terminal to wait for a card to be presented. This value must be greater than 0.
Response
Success. The transaction was successfully triggered.
The response payload from the /spark/TriggerTransaction endpoint, which confirms the result of the request to initiate user interaction with a physical terminal.
Was this page helpful?