Adyen Terminal API
POST
Abort Request
{{baseUrl}}/abort
BODY json
{
"MessageReference": {
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
},
"AbortReason": "",
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/abort");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"AbortReason\": \"\",\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/abort" {:content-type :json
:form-params {:MessageReference {:MessageCategory ""
:ServiceID ""
:DeviceID ""
:SaleID ""
:POIID ""}
:AbortReason ""
:DisplayOutput {:ResponseRequiredFlag false
:MinimumDisplayTime 0
:Device ""
:InfoQualify ""
:OutputContent {:OutputFormat ""
:PredefinedContent {:ReferenceID ""
:Language ""}
:OutputText [{:Text ""
:CharacterSet 0
:Font ""
:StartRow 0
:StartColumn 0
:Color ""
:CharacterWidth ""
:CharacterHeight ""
:CharacterStyle ""
:Alignment ""
:EndOfLineFlag false}]
:OutputXHTML ""
:OutputBarcode {:BarcodeType ""
:BarcodeValue ""}}
:MenuEntry [{:MenuEntryTag ""
:DefaultSelectedFlag false
:OutputFormat ""
:PredefinedContent {}
:OutputText [{}]
:OutputXHTML ""}]
:OutputSignature ""}}})
require "http/client"
url = "{{baseUrl}}/abort"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"AbortReason\": \"\",\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/abort"),
Content = new StringContent("{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"AbortReason\": \"\",\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/abort");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"AbortReason\": \"\",\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/abort"
payload := strings.NewReader("{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"AbortReason\": \"\",\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/abort HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1167
{
"MessageReference": {
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
},
"AbortReason": "",
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/abort")
.setHeader("content-type", "application/json")
.setBody("{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"AbortReason\": \"\",\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/abort"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"AbortReason\": \"\",\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"AbortReason\": \"\",\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/abort")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/abort")
.header("content-type", "application/json")
.body("{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"AbortReason\": \"\",\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
MessageReference: {
MessageCategory: '',
ServiceID: '',
DeviceID: '',
SaleID: '',
POIID: ''
},
AbortReason: '',
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {
ReferenceID: '',
Language: ''
},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {
BarcodeType: '',
BarcodeValue: ''
}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [
{}
],
OutputXHTML: ''
}
],
OutputSignature: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/abort');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/abort',
headers: {'content-type': 'application/json'},
data: {
MessageReference: {MessageCategory: '', ServiceID: '', DeviceID: '', SaleID: '', POIID: ''},
AbortReason: '',
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [{}],
OutputXHTML: ''
}
],
OutputSignature: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/abort';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"MessageReference":{"MessageCategory":"","ServiceID":"","DeviceID":"","SaleID":"","POIID":""},"AbortReason":"","DisplayOutput":{"ResponseRequiredFlag":false,"MinimumDisplayTime":0,"Device":"","InfoQualify":"","OutputContent":{"OutputFormat":"","PredefinedContent":{"ReferenceID":"","Language":""},"OutputText":[{"Text":"","CharacterSet":0,"Font":"","StartRow":0,"StartColumn":0,"Color":"","CharacterWidth":"","CharacterHeight":"","CharacterStyle":"","Alignment":"","EndOfLineFlag":false}],"OutputXHTML":"","OutputBarcode":{"BarcodeType":"","BarcodeValue":""}},"MenuEntry":[{"MenuEntryTag":"","DefaultSelectedFlag":false,"OutputFormat":"","PredefinedContent":{},"OutputText":[{}],"OutputXHTML":""}],"OutputSignature":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/abort',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "MessageReference": {\n "MessageCategory": "",\n "ServiceID": "",\n "DeviceID": "",\n "SaleID": "",\n "POIID": ""\n },\n "AbortReason": "",\n "DisplayOutput": {\n "ResponseRequiredFlag": false,\n "MinimumDisplayTime": 0,\n "Device": "",\n "InfoQualify": "",\n "OutputContent": {\n "OutputFormat": "",\n "PredefinedContent": {\n "ReferenceID": "",\n "Language": ""\n },\n "OutputText": [\n {\n "Text": "",\n "CharacterSet": 0,\n "Font": "",\n "StartRow": 0,\n "StartColumn": 0,\n "Color": "",\n "CharacterWidth": "",\n "CharacterHeight": "",\n "CharacterStyle": "",\n "Alignment": "",\n "EndOfLineFlag": false\n }\n ],\n "OutputXHTML": "",\n "OutputBarcode": {\n "BarcodeType": "",\n "BarcodeValue": ""\n }\n },\n "MenuEntry": [\n {\n "MenuEntryTag": "",\n "DefaultSelectedFlag": false,\n "OutputFormat": "",\n "PredefinedContent": {},\n "OutputText": [\n {}\n ],\n "OutputXHTML": ""\n }\n ],\n "OutputSignature": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"AbortReason\": \"\",\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/abort")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/abort',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
MessageReference: {MessageCategory: '', ServiceID: '', DeviceID: '', SaleID: '', POIID: ''},
AbortReason: '',
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [{}],
OutputXHTML: ''
}
],
OutputSignature: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/abort',
headers: {'content-type': 'application/json'},
body: {
MessageReference: {MessageCategory: '', ServiceID: '', DeviceID: '', SaleID: '', POIID: ''},
AbortReason: '',
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [{}],
OutputXHTML: ''
}
],
OutputSignature: ''
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/abort');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
MessageReference: {
MessageCategory: '',
ServiceID: '',
DeviceID: '',
SaleID: '',
POIID: ''
},
AbortReason: '',
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {
ReferenceID: '',
Language: ''
},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {
BarcodeType: '',
BarcodeValue: ''
}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [
{}
],
OutputXHTML: ''
}
],
OutputSignature: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/abort',
headers: {'content-type': 'application/json'},
data: {
MessageReference: {MessageCategory: '', ServiceID: '', DeviceID: '', SaleID: '', POIID: ''},
AbortReason: '',
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [{}],
OutputXHTML: ''
}
],
OutputSignature: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/abort';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"MessageReference":{"MessageCategory":"","ServiceID":"","DeviceID":"","SaleID":"","POIID":""},"AbortReason":"","DisplayOutput":{"ResponseRequiredFlag":false,"MinimumDisplayTime":0,"Device":"","InfoQualify":"","OutputContent":{"OutputFormat":"","PredefinedContent":{"ReferenceID":"","Language":""},"OutputText":[{"Text":"","CharacterSet":0,"Font":"","StartRow":0,"StartColumn":0,"Color":"","CharacterWidth":"","CharacterHeight":"","CharacterStyle":"","Alignment":"","EndOfLineFlag":false}],"OutputXHTML":"","OutputBarcode":{"BarcodeType":"","BarcodeValue":""}},"MenuEntry":[{"MenuEntryTag":"","DefaultSelectedFlag":false,"OutputFormat":"","PredefinedContent":{},"OutputText":[{}],"OutputXHTML":""}],"OutputSignature":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"MessageReference": @{ @"MessageCategory": @"", @"ServiceID": @"", @"DeviceID": @"", @"SaleID": @"", @"POIID": @"" },
@"AbortReason": @"",
@"DisplayOutput": @{ @"ResponseRequiredFlag": @NO, @"MinimumDisplayTime": @0, @"Device": @"", @"InfoQualify": @"", @"OutputContent": @{ @"OutputFormat": @"", @"PredefinedContent": @{ @"ReferenceID": @"", @"Language": @"" }, @"OutputText": @[ @{ @"Text": @"", @"CharacterSet": @0, @"Font": @"", @"StartRow": @0, @"StartColumn": @0, @"Color": @"", @"CharacterWidth": @"", @"CharacterHeight": @"", @"CharacterStyle": @"", @"Alignment": @"", @"EndOfLineFlag": @NO } ], @"OutputXHTML": @"", @"OutputBarcode": @{ @"BarcodeType": @"", @"BarcodeValue": @"" } }, @"MenuEntry": @[ @{ @"MenuEntryTag": @"", @"DefaultSelectedFlag": @NO, @"OutputFormat": @"", @"PredefinedContent": @{ }, @"OutputText": @[ @{ } ], @"OutputXHTML": @"" } ], @"OutputSignature": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/abort"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/abort" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"AbortReason\": \"\",\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/abort",
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([
'MessageReference' => [
'MessageCategory' => '',
'ServiceID' => '',
'DeviceID' => '',
'SaleID' => '',
'POIID' => ''
],
'AbortReason' => '',
'DisplayOutput' => [
'ResponseRequiredFlag' => null,
'MinimumDisplayTime' => 0,
'Device' => '',
'InfoQualify' => '',
'OutputContent' => [
'OutputFormat' => '',
'PredefinedContent' => [
'ReferenceID' => '',
'Language' => ''
],
'OutputText' => [
[
'Text' => '',
'CharacterSet' => 0,
'Font' => '',
'StartRow' => 0,
'StartColumn' => 0,
'Color' => '',
'CharacterWidth' => '',
'CharacterHeight' => '',
'CharacterStyle' => '',
'Alignment' => '',
'EndOfLineFlag' => null
]
],
'OutputXHTML' => '',
'OutputBarcode' => [
'BarcodeType' => '',
'BarcodeValue' => ''
]
],
'MenuEntry' => [
[
'MenuEntryTag' => '',
'DefaultSelectedFlag' => null,
'OutputFormat' => '',
'PredefinedContent' => [
],
'OutputText' => [
[
]
],
'OutputXHTML' => ''
]
],
'OutputSignature' => ''
]
]),
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;
}
request('POST', '{{baseUrl}}/abort', [
'body' => '{
"MessageReference": {
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
},
"AbortReason": "",
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/abort');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'MessageReference' => [
'MessageCategory' => '',
'ServiceID' => '',
'DeviceID' => '',
'SaleID' => '',
'POIID' => ''
],
'AbortReason' => '',
'DisplayOutput' => [
'ResponseRequiredFlag' => null,
'MinimumDisplayTime' => 0,
'Device' => '',
'InfoQualify' => '',
'OutputContent' => [
'OutputFormat' => '',
'PredefinedContent' => [
'ReferenceID' => '',
'Language' => ''
],
'OutputText' => [
[
'Text' => '',
'CharacterSet' => 0,
'Font' => '',
'StartRow' => 0,
'StartColumn' => 0,
'Color' => '',
'CharacterWidth' => '',
'CharacterHeight' => '',
'CharacterStyle' => '',
'Alignment' => '',
'EndOfLineFlag' => null
]
],
'OutputXHTML' => '',
'OutputBarcode' => [
'BarcodeType' => '',
'BarcodeValue' => ''
]
],
'MenuEntry' => [
[
'MenuEntryTag' => '',
'DefaultSelectedFlag' => null,
'OutputFormat' => '',
'PredefinedContent' => [
],
'OutputText' => [
[
]
],
'OutputXHTML' => ''
]
],
'OutputSignature' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'MessageReference' => [
'MessageCategory' => '',
'ServiceID' => '',
'DeviceID' => '',
'SaleID' => '',
'POIID' => ''
],
'AbortReason' => '',
'DisplayOutput' => [
'ResponseRequiredFlag' => null,
'MinimumDisplayTime' => 0,
'Device' => '',
'InfoQualify' => '',
'OutputContent' => [
'OutputFormat' => '',
'PredefinedContent' => [
'ReferenceID' => '',
'Language' => ''
],
'OutputText' => [
[
'Text' => '',
'CharacterSet' => 0,
'Font' => '',
'StartRow' => 0,
'StartColumn' => 0,
'Color' => '',
'CharacterWidth' => '',
'CharacterHeight' => '',
'CharacterStyle' => '',
'Alignment' => '',
'EndOfLineFlag' => null
]
],
'OutputXHTML' => '',
'OutputBarcode' => [
'BarcodeType' => '',
'BarcodeValue' => ''
]
],
'MenuEntry' => [
[
'MenuEntryTag' => '',
'DefaultSelectedFlag' => null,
'OutputFormat' => '',
'PredefinedContent' => [
],
'OutputText' => [
[
]
],
'OutputXHTML' => ''
]
],
'OutputSignature' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/abort');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/abort' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MessageReference": {
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
},
"AbortReason": "",
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/abort' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MessageReference": {
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
},
"AbortReason": "",
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"AbortReason\": \"\",\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/abort", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/abort"
payload = {
"MessageReference": {
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
},
"AbortReason": "",
"DisplayOutput": {
"ResponseRequiredFlag": False,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": False
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": False,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [{}],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/abort"
payload <- "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"AbortReason\": \"\",\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/abort")
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 \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"AbortReason\": \"\",\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/abort') do |req|
req.body = "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"AbortReason\": \"\",\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/abort";
let payload = json!({
"MessageReference": json!({
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
}),
"AbortReason": "",
"DisplayOutput": json!({
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": json!({
"OutputFormat": "",
"PredefinedContent": json!({
"ReferenceID": "",
"Language": ""
}),
"OutputText": (
json!({
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
})
),
"OutputXHTML": "",
"OutputBarcode": json!({
"BarcodeType": "",
"BarcodeValue": ""
})
}),
"MenuEntry": (
json!({
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": json!({}),
"OutputText": (json!({})),
"OutputXHTML": ""
})
),
"OutputSignature": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/abort \
--header 'content-type: application/json' \
--data '{
"MessageReference": {
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
},
"AbortReason": "",
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
}'
echo '{
"MessageReference": {
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
},
"AbortReason": "",
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
}' | \
http POST {{baseUrl}}/abort \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "MessageReference": {\n "MessageCategory": "",\n "ServiceID": "",\n "DeviceID": "",\n "SaleID": "",\n "POIID": ""\n },\n "AbortReason": "",\n "DisplayOutput": {\n "ResponseRequiredFlag": false,\n "MinimumDisplayTime": 0,\n "Device": "",\n "InfoQualify": "",\n "OutputContent": {\n "OutputFormat": "",\n "PredefinedContent": {\n "ReferenceID": "",\n "Language": ""\n },\n "OutputText": [\n {\n "Text": "",\n "CharacterSet": 0,\n "Font": "",\n "StartRow": 0,\n "StartColumn": 0,\n "Color": "",\n "CharacterWidth": "",\n "CharacterHeight": "",\n "CharacterStyle": "",\n "Alignment": "",\n "EndOfLineFlag": false\n }\n ],\n "OutputXHTML": "",\n "OutputBarcode": {\n "BarcodeType": "",\n "BarcodeValue": ""\n }\n },\n "MenuEntry": [\n {\n "MenuEntryTag": "",\n "DefaultSelectedFlag": false,\n "OutputFormat": "",\n "PredefinedContent": {},\n "OutputText": [\n {}\n ],\n "OutputXHTML": ""\n }\n ],\n "OutputSignature": ""\n }\n}' \
--output-document \
- {{baseUrl}}/abort
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"MessageReference": [
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
],
"AbortReason": "",
"DisplayOutput": [
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": [
"OutputFormat": "",
"PredefinedContent": [
"ReferenceID": "",
"Language": ""
],
"OutputText": [
[
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
]
],
"OutputXHTML": "",
"OutputBarcode": [
"BarcodeType": "",
"BarcodeValue": ""
]
],
"MenuEntry": [
[
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": [],
"OutputText": [[]],
"OutputXHTML": ""
]
],
"OutputSignature": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/abort")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Admin Request
{{baseUrl}}/admin
BODY json
{
"ServiceIdentification": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/admin");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ServiceIdentification\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/admin" {:content-type :json
:form-params {:ServiceIdentification ""}})
require "http/client"
url = "{{baseUrl}}/admin"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ServiceIdentification\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/admin"),
Content = new StringContent("{\n \"ServiceIdentification\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/admin");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ServiceIdentification\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/admin"
payload := strings.NewReader("{\n \"ServiceIdentification\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/admin HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 33
{
"ServiceIdentification": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/admin")
.setHeader("content-type", "application/json")
.setBody("{\n \"ServiceIdentification\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/admin"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ServiceIdentification\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ServiceIdentification\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/admin")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/admin")
.header("content-type", "application/json")
.body("{\n \"ServiceIdentification\": \"\"\n}")
.asString();
const data = JSON.stringify({
ServiceIdentification: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/admin');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/admin',
headers: {'content-type': 'application/json'},
data: {ServiceIdentification: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/admin';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ServiceIdentification":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/admin',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ServiceIdentification": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ServiceIdentification\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/admin")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/admin',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ServiceIdentification: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/admin',
headers: {'content-type': 'application/json'},
body: {ServiceIdentification: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/admin');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ServiceIdentification: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/admin',
headers: {'content-type': 'application/json'},
data: {ServiceIdentification: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/admin';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ServiceIdentification":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ServiceIdentification": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/admin"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/admin" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ServiceIdentification\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/admin",
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([
'ServiceIdentification' => ''
]),
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;
}
request('POST', '{{baseUrl}}/admin', [
'body' => '{
"ServiceIdentification": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/admin');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ServiceIdentification' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ServiceIdentification' => ''
]));
$request->setRequestUrl('{{baseUrl}}/admin');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/admin' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ServiceIdentification": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/admin' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ServiceIdentification": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ServiceIdentification\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/admin", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/admin"
payload = { "ServiceIdentification": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/admin"
payload <- "{\n \"ServiceIdentification\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/admin")
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 \"ServiceIdentification\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/admin') do |req|
req.body = "{\n \"ServiceIdentification\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/admin";
let payload = json!({"ServiceIdentification": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/admin \
--header 'content-type: application/json' \
--data '{
"ServiceIdentification": ""
}'
echo '{
"ServiceIdentification": ""
}' | \
http POST {{baseUrl}}/admin \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "ServiceIdentification": ""\n}' \
--output-document \
- {{baseUrl}}/admin
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["ServiceIdentification": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/admin")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
BalanceInquiry Request
{{baseUrl}}/balanceinquiry
BODY json
{
"PaymentAccountReq": {
"AccountType": "",
"CardAcquisitionReference": {
"TransactionID": "",
"TimeStamp": ""
},
"PaymentInstrumentData": {
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": {
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": {
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
{
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
}
]
},
"AllowedProductCode": [],
"AllowedProduct": [
{
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
],
"PaymentToken": {
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
},
"CustomerOrder": [
{
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
}
]
},
"CheckData": {
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": {},
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
},
"MobileData": {
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": {
"GeographicCoordinates": {
"Latitude": "",
"Longitude": ""
},
"UTMCoordinates": {
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
}
},
"ProtectedMobileData": "",
"SensitiveMobileData": {
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
}
},
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
}
}
},
"LoyaltyAccountReq": {
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/balanceinquiry");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"PaymentAccountReq\": {\n \"AccountType\": \"\",\n \"CardAcquisitionReference\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyAccountReq\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/balanceinquiry" {:content-type :json
:form-params {:PaymentAccountReq {:AccountType ""
:CardAcquisitionReference {:TransactionID ""
:TimeStamp ""}
:PaymentInstrumentData {:PaymentInstrumentType ""
:ProtectedCardData ""
:CardData {:PaymentBrand ""
:MaskedPan ""
:PaymentAccountRef ""
:EntryMode []
:CardCountryCode 0
:ProtectedCardData ""
:SensitiveCardData {:PAN 0
:CardSeqNumb 0
:ExpiryDate 0
:TrackData [{:TrackNumb 0
:TrackFormat ""
:TrackValue ""}]}
:AllowedProductCode []
:AllowedProduct [{:ProductCode 0
:EanUpc 0
:ProductLabel ""
:AdditionalProductInfo ""}]
:PaymentToken {:TokenRequestedType ""
:TokenValue ""
:ExpiryDateTime ""}
:CustomerOrder [{:CustomerOrderID ""
:SaleReferenceID ""
:OpenOrderState false
:StartDate ""
:EndDate ""
:ForecastedAmount ""
:CurrentAmount ""
:Currency ""
:AccessedBy ""
:AdditionalInformation ""}]}
:CheckData {:BankID ""
:AccountNumber ""
:CheckNumber ""
:TrackData {}
:CheckCardNumber ""
:TypeCode ""
:Country ""}
:MobileData {:MobileCountryCode 0
:MobileNetworkCode 0
:MaskedMSISDN 0
:Geolocation {:GeographicCoordinates {:Latitude ""
:Longitude ""}
:UTMCoordinates {:UTMZone ""
:UTMEastward ""
:UTMNorthward ""}}
:ProtectedMobileData ""
:SensitiveMobileData {:MSISDN 0
:IMSI 0
:IMEI 0}}
:StoredValueAccountID {:StoredValueAccountType ""
:StoredValueProvider ""
:OwnerName ""
:ExpiryDate 0
:EntryMode []
:IdentificationType ""
:StoredValueID ""}}}
:LoyaltyAccountReq {:CardAcquisitionReference {}
:LoyaltyAccountID {:EntryMode []
:IdentificationType ""
:IdentificationSupport ""
:LoyaltyID ""}}}})
require "http/client"
url = "{{baseUrl}}/balanceinquiry"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"PaymentAccountReq\": {\n \"AccountType\": \"\",\n \"CardAcquisitionReference\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyAccountReq\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n }\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/balanceinquiry"),
Content = new StringContent("{\n \"PaymentAccountReq\": {\n \"AccountType\": \"\",\n \"CardAcquisitionReference\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyAccountReq\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/balanceinquiry");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"PaymentAccountReq\": {\n \"AccountType\": \"\",\n \"CardAcquisitionReference\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyAccountReq\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/balanceinquiry"
payload := strings.NewReader("{\n \"PaymentAccountReq\": {\n \"AccountType\": \"\",\n \"CardAcquisitionReference\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyAccountReq\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n }\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(res)
fmt.Println(string(body))
}
POST /baseUrl/balanceinquiry HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2681
{
"PaymentAccountReq": {
"AccountType": "",
"CardAcquisitionReference": {
"TransactionID": "",
"TimeStamp": ""
},
"PaymentInstrumentData": {
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": {
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": {
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
{
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
}
]
},
"AllowedProductCode": [],
"AllowedProduct": [
{
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
],
"PaymentToken": {
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
},
"CustomerOrder": [
{
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
}
]
},
"CheckData": {
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": {},
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
},
"MobileData": {
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": {
"GeographicCoordinates": {
"Latitude": "",
"Longitude": ""
},
"UTMCoordinates": {
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
}
},
"ProtectedMobileData": "",
"SensitiveMobileData": {
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
}
},
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
}
}
},
"LoyaltyAccountReq": {
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/balanceinquiry")
.setHeader("content-type", "application/json")
.setBody("{\n \"PaymentAccountReq\": {\n \"AccountType\": \"\",\n \"CardAcquisitionReference\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyAccountReq\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/balanceinquiry"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"PaymentAccountReq\": {\n \"AccountType\": \"\",\n \"CardAcquisitionReference\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyAccountReq\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"PaymentAccountReq\": {\n \"AccountType\": \"\",\n \"CardAcquisitionReference\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyAccountReq\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/balanceinquiry")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/balanceinquiry")
.header("content-type", "application/json")
.body("{\n \"PaymentAccountReq\": {\n \"AccountType\": \"\",\n \"CardAcquisitionReference\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyAccountReq\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n }\n }\n}")
.asString();
const data = JSON.stringify({
PaymentAccountReq: {
AccountType: '',
CardAcquisitionReference: {
TransactionID: '',
TimeStamp: ''
},
PaymentInstrumentData: {
PaymentInstrumentType: '',
ProtectedCardData: '',
CardData: {
PaymentBrand: '',
MaskedPan: '',
PaymentAccountRef: '',
EntryMode: [],
CardCountryCode: 0,
ProtectedCardData: '',
SensitiveCardData: {
PAN: 0,
CardSeqNumb: 0,
ExpiryDate: 0,
TrackData: [
{
TrackNumb: 0,
TrackFormat: '',
TrackValue: ''
}
]
},
AllowedProductCode: [],
AllowedProduct: [
{
ProductCode: 0,
EanUpc: 0,
ProductLabel: '',
AdditionalProductInfo: ''
}
],
PaymentToken: {
TokenRequestedType: '',
TokenValue: '',
ExpiryDateTime: ''
},
CustomerOrder: [
{
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
}
]
},
CheckData: {
BankID: '',
AccountNumber: '',
CheckNumber: '',
TrackData: {},
CheckCardNumber: '',
TypeCode: '',
Country: ''
},
MobileData: {
MobileCountryCode: 0,
MobileNetworkCode: 0,
MaskedMSISDN: 0,
Geolocation: {
GeographicCoordinates: {
Latitude: '',
Longitude: ''
},
UTMCoordinates: {
UTMZone: '',
UTMEastward: '',
UTMNorthward: ''
}
},
ProtectedMobileData: '',
SensitiveMobileData: {
MSISDN: 0,
IMSI: 0,
IMEI: 0
}
},
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
}
}
},
LoyaltyAccountReq: {
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/balanceinquiry');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/balanceinquiry',
headers: {'content-type': 'application/json'},
data: {
PaymentAccountReq: {
AccountType: '',
CardAcquisitionReference: {TransactionID: '', TimeStamp: ''},
PaymentInstrumentData: {
PaymentInstrumentType: '',
ProtectedCardData: '',
CardData: {
PaymentBrand: '',
MaskedPan: '',
PaymentAccountRef: '',
EntryMode: [],
CardCountryCode: 0,
ProtectedCardData: '',
SensitiveCardData: {
PAN: 0,
CardSeqNumb: 0,
ExpiryDate: 0,
TrackData: [{TrackNumb: 0, TrackFormat: '', TrackValue: ''}]
},
AllowedProductCode: [],
AllowedProduct: [{ProductCode: 0, EanUpc: 0, ProductLabel: '', AdditionalProductInfo: ''}],
PaymentToken: {TokenRequestedType: '', TokenValue: '', ExpiryDateTime: ''},
CustomerOrder: [
{
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
}
]
},
CheckData: {
BankID: '',
AccountNumber: '',
CheckNumber: '',
TrackData: {},
CheckCardNumber: '',
TypeCode: '',
Country: ''
},
MobileData: {
MobileCountryCode: 0,
MobileNetworkCode: 0,
MaskedMSISDN: 0,
Geolocation: {
GeographicCoordinates: {Latitude: '', Longitude: ''},
UTMCoordinates: {UTMZone: '', UTMEastward: '', UTMNorthward: ''}
},
ProtectedMobileData: '',
SensitiveMobileData: {MSISDN: 0, IMSI: 0, IMEI: 0}
},
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
}
}
},
LoyaltyAccountReq: {
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/balanceinquiry';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"PaymentAccountReq":{"AccountType":"","CardAcquisitionReference":{"TransactionID":"","TimeStamp":""},"PaymentInstrumentData":{"PaymentInstrumentType":"","ProtectedCardData":"","CardData":{"PaymentBrand":"","MaskedPan":"","PaymentAccountRef":"","EntryMode":[],"CardCountryCode":0,"ProtectedCardData":"","SensitiveCardData":{"PAN":0,"CardSeqNumb":0,"ExpiryDate":0,"TrackData":[{"TrackNumb":0,"TrackFormat":"","TrackValue":""}]},"AllowedProductCode":[],"AllowedProduct":[{"ProductCode":0,"EanUpc":0,"ProductLabel":"","AdditionalProductInfo":""}],"PaymentToken":{"TokenRequestedType":"","TokenValue":"","ExpiryDateTime":""},"CustomerOrder":[{"CustomerOrderID":"","SaleReferenceID":"","OpenOrderState":false,"StartDate":"","EndDate":"","ForecastedAmount":"","CurrentAmount":"","Currency":"","AccessedBy":"","AdditionalInformation":""}]},"CheckData":{"BankID":"","AccountNumber":"","CheckNumber":"","TrackData":{},"CheckCardNumber":"","TypeCode":"","Country":""},"MobileData":{"MobileCountryCode":0,"MobileNetworkCode":0,"MaskedMSISDN":0,"Geolocation":{"GeographicCoordinates":{"Latitude":"","Longitude":""},"UTMCoordinates":{"UTMZone":"","UTMEastward":"","UTMNorthward":""}},"ProtectedMobileData":"","SensitiveMobileData":{"MSISDN":0,"IMSI":0,"IMEI":0}},"StoredValueAccountID":{"StoredValueAccountType":"","StoredValueProvider":"","OwnerName":"","ExpiryDate":0,"EntryMode":[],"IdentificationType":"","StoredValueID":""}}},"LoyaltyAccountReq":{"CardAcquisitionReference":{},"LoyaltyAccountID":{"EntryMode":[],"IdentificationType":"","IdentificationSupport":"","LoyaltyID":""}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/balanceinquiry',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "PaymentAccountReq": {\n "AccountType": "",\n "CardAcquisitionReference": {\n "TransactionID": "",\n "TimeStamp": ""\n },\n "PaymentInstrumentData": {\n "PaymentInstrumentType": "",\n "ProtectedCardData": "",\n "CardData": {\n "PaymentBrand": "",\n "MaskedPan": "",\n "PaymentAccountRef": "",\n "EntryMode": [],\n "CardCountryCode": 0,\n "ProtectedCardData": "",\n "SensitiveCardData": {\n "PAN": 0,\n "CardSeqNumb": 0,\n "ExpiryDate": 0,\n "TrackData": [\n {\n "TrackNumb": 0,\n "TrackFormat": "",\n "TrackValue": ""\n }\n ]\n },\n "AllowedProductCode": [],\n "AllowedProduct": [\n {\n "ProductCode": 0,\n "EanUpc": 0,\n "ProductLabel": "",\n "AdditionalProductInfo": ""\n }\n ],\n "PaymentToken": {\n "TokenRequestedType": "",\n "TokenValue": "",\n "ExpiryDateTime": ""\n },\n "CustomerOrder": [\n {\n "CustomerOrderID": "",\n "SaleReferenceID": "",\n "OpenOrderState": false,\n "StartDate": "",\n "EndDate": "",\n "ForecastedAmount": "",\n "CurrentAmount": "",\n "Currency": "",\n "AccessedBy": "",\n "AdditionalInformation": ""\n }\n ]\n },\n "CheckData": {\n "BankID": "",\n "AccountNumber": "",\n "CheckNumber": "",\n "TrackData": {},\n "CheckCardNumber": "",\n "TypeCode": "",\n "Country": ""\n },\n "MobileData": {\n "MobileCountryCode": 0,\n "MobileNetworkCode": 0,\n "MaskedMSISDN": 0,\n "Geolocation": {\n "GeographicCoordinates": {\n "Latitude": "",\n "Longitude": ""\n },\n "UTMCoordinates": {\n "UTMZone": "",\n "UTMEastward": "",\n "UTMNorthward": ""\n }\n },\n "ProtectedMobileData": "",\n "SensitiveMobileData": {\n "MSISDN": 0,\n "IMSI": 0,\n "IMEI": 0\n }\n },\n "StoredValueAccountID": {\n "StoredValueAccountType": "",\n "StoredValueProvider": "",\n "OwnerName": "",\n "ExpiryDate": 0,\n "EntryMode": [],\n "IdentificationType": "",\n "StoredValueID": ""\n }\n }\n },\n "LoyaltyAccountReq": {\n "CardAcquisitionReference": {},\n "LoyaltyAccountID": {\n "EntryMode": [],\n "IdentificationType": "",\n "IdentificationSupport": "",\n "LoyaltyID": ""\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"PaymentAccountReq\": {\n \"AccountType\": \"\",\n \"CardAcquisitionReference\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyAccountReq\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/balanceinquiry")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/balanceinquiry',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
PaymentAccountReq: {
AccountType: '',
CardAcquisitionReference: {TransactionID: '', TimeStamp: ''},
PaymentInstrumentData: {
PaymentInstrumentType: '',
ProtectedCardData: '',
CardData: {
PaymentBrand: '',
MaskedPan: '',
PaymentAccountRef: '',
EntryMode: [],
CardCountryCode: 0,
ProtectedCardData: '',
SensitiveCardData: {
PAN: 0,
CardSeqNumb: 0,
ExpiryDate: 0,
TrackData: [{TrackNumb: 0, TrackFormat: '', TrackValue: ''}]
},
AllowedProductCode: [],
AllowedProduct: [{ProductCode: 0, EanUpc: 0, ProductLabel: '', AdditionalProductInfo: ''}],
PaymentToken: {TokenRequestedType: '', TokenValue: '', ExpiryDateTime: ''},
CustomerOrder: [
{
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
}
]
},
CheckData: {
BankID: '',
AccountNumber: '',
CheckNumber: '',
TrackData: {},
CheckCardNumber: '',
TypeCode: '',
Country: ''
},
MobileData: {
MobileCountryCode: 0,
MobileNetworkCode: 0,
MaskedMSISDN: 0,
Geolocation: {
GeographicCoordinates: {Latitude: '', Longitude: ''},
UTMCoordinates: {UTMZone: '', UTMEastward: '', UTMNorthward: ''}
},
ProtectedMobileData: '',
SensitiveMobileData: {MSISDN: 0, IMSI: 0, IMEI: 0}
},
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
}
}
},
LoyaltyAccountReq: {
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
}
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/balanceinquiry',
headers: {'content-type': 'application/json'},
body: {
PaymentAccountReq: {
AccountType: '',
CardAcquisitionReference: {TransactionID: '', TimeStamp: ''},
PaymentInstrumentData: {
PaymentInstrumentType: '',
ProtectedCardData: '',
CardData: {
PaymentBrand: '',
MaskedPan: '',
PaymentAccountRef: '',
EntryMode: [],
CardCountryCode: 0,
ProtectedCardData: '',
SensitiveCardData: {
PAN: 0,
CardSeqNumb: 0,
ExpiryDate: 0,
TrackData: [{TrackNumb: 0, TrackFormat: '', TrackValue: ''}]
},
AllowedProductCode: [],
AllowedProduct: [{ProductCode: 0, EanUpc: 0, ProductLabel: '', AdditionalProductInfo: ''}],
PaymentToken: {TokenRequestedType: '', TokenValue: '', ExpiryDateTime: ''},
CustomerOrder: [
{
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
}
]
},
CheckData: {
BankID: '',
AccountNumber: '',
CheckNumber: '',
TrackData: {},
CheckCardNumber: '',
TypeCode: '',
Country: ''
},
MobileData: {
MobileCountryCode: 0,
MobileNetworkCode: 0,
MaskedMSISDN: 0,
Geolocation: {
GeographicCoordinates: {Latitude: '', Longitude: ''},
UTMCoordinates: {UTMZone: '', UTMEastward: '', UTMNorthward: ''}
},
ProtectedMobileData: '',
SensitiveMobileData: {MSISDN: 0, IMSI: 0, IMEI: 0}
},
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
}
}
},
LoyaltyAccountReq: {
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
}
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/balanceinquiry');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
PaymentAccountReq: {
AccountType: '',
CardAcquisitionReference: {
TransactionID: '',
TimeStamp: ''
},
PaymentInstrumentData: {
PaymentInstrumentType: '',
ProtectedCardData: '',
CardData: {
PaymentBrand: '',
MaskedPan: '',
PaymentAccountRef: '',
EntryMode: [],
CardCountryCode: 0,
ProtectedCardData: '',
SensitiveCardData: {
PAN: 0,
CardSeqNumb: 0,
ExpiryDate: 0,
TrackData: [
{
TrackNumb: 0,
TrackFormat: '',
TrackValue: ''
}
]
},
AllowedProductCode: [],
AllowedProduct: [
{
ProductCode: 0,
EanUpc: 0,
ProductLabel: '',
AdditionalProductInfo: ''
}
],
PaymentToken: {
TokenRequestedType: '',
TokenValue: '',
ExpiryDateTime: ''
},
CustomerOrder: [
{
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
}
]
},
CheckData: {
BankID: '',
AccountNumber: '',
CheckNumber: '',
TrackData: {},
CheckCardNumber: '',
TypeCode: '',
Country: ''
},
MobileData: {
MobileCountryCode: 0,
MobileNetworkCode: 0,
MaskedMSISDN: 0,
Geolocation: {
GeographicCoordinates: {
Latitude: '',
Longitude: ''
},
UTMCoordinates: {
UTMZone: '',
UTMEastward: '',
UTMNorthward: ''
}
},
ProtectedMobileData: '',
SensitiveMobileData: {
MSISDN: 0,
IMSI: 0,
IMEI: 0
}
},
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
}
}
},
LoyaltyAccountReq: {
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
}
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/balanceinquiry',
headers: {'content-type': 'application/json'},
data: {
PaymentAccountReq: {
AccountType: '',
CardAcquisitionReference: {TransactionID: '', TimeStamp: ''},
PaymentInstrumentData: {
PaymentInstrumentType: '',
ProtectedCardData: '',
CardData: {
PaymentBrand: '',
MaskedPan: '',
PaymentAccountRef: '',
EntryMode: [],
CardCountryCode: 0,
ProtectedCardData: '',
SensitiveCardData: {
PAN: 0,
CardSeqNumb: 0,
ExpiryDate: 0,
TrackData: [{TrackNumb: 0, TrackFormat: '', TrackValue: ''}]
},
AllowedProductCode: [],
AllowedProduct: [{ProductCode: 0, EanUpc: 0, ProductLabel: '', AdditionalProductInfo: ''}],
PaymentToken: {TokenRequestedType: '', TokenValue: '', ExpiryDateTime: ''},
CustomerOrder: [
{
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
}
]
},
CheckData: {
BankID: '',
AccountNumber: '',
CheckNumber: '',
TrackData: {},
CheckCardNumber: '',
TypeCode: '',
Country: ''
},
MobileData: {
MobileCountryCode: 0,
MobileNetworkCode: 0,
MaskedMSISDN: 0,
Geolocation: {
GeographicCoordinates: {Latitude: '', Longitude: ''},
UTMCoordinates: {UTMZone: '', UTMEastward: '', UTMNorthward: ''}
},
ProtectedMobileData: '',
SensitiveMobileData: {MSISDN: 0, IMSI: 0, IMEI: 0}
},
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
}
}
},
LoyaltyAccountReq: {
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/balanceinquiry';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"PaymentAccountReq":{"AccountType":"","CardAcquisitionReference":{"TransactionID":"","TimeStamp":""},"PaymentInstrumentData":{"PaymentInstrumentType":"","ProtectedCardData":"","CardData":{"PaymentBrand":"","MaskedPan":"","PaymentAccountRef":"","EntryMode":[],"CardCountryCode":0,"ProtectedCardData":"","SensitiveCardData":{"PAN":0,"CardSeqNumb":0,"ExpiryDate":0,"TrackData":[{"TrackNumb":0,"TrackFormat":"","TrackValue":""}]},"AllowedProductCode":[],"AllowedProduct":[{"ProductCode":0,"EanUpc":0,"ProductLabel":"","AdditionalProductInfo":""}],"PaymentToken":{"TokenRequestedType":"","TokenValue":"","ExpiryDateTime":""},"CustomerOrder":[{"CustomerOrderID":"","SaleReferenceID":"","OpenOrderState":false,"StartDate":"","EndDate":"","ForecastedAmount":"","CurrentAmount":"","Currency":"","AccessedBy":"","AdditionalInformation":""}]},"CheckData":{"BankID":"","AccountNumber":"","CheckNumber":"","TrackData":{},"CheckCardNumber":"","TypeCode":"","Country":""},"MobileData":{"MobileCountryCode":0,"MobileNetworkCode":0,"MaskedMSISDN":0,"Geolocation":{"GeographicCoordinates":{"Latitude":"","Longitude":""},"UTMCoordinates":{"UTMZone":"","UTMEastward":"","UTMNorthward":""}},"ProtectedMobileData":"","SensitiveMobileData":{"MSISDN":0,"IMSI":0,"IMEI":0}},"StoredValueAccountID":{"StoredValueAccountType":"","StoredValueProvider":"","OwnerName":"","ExpiryDate":0,"EntryMode":[],"IdentificationType":"","StoredValueID":""}}},"LoyaltyAccountReq":{"CardAcquisitionReference":{},"LoyaltyAccountID":{"EntryMode":[],"IdentificationType":"","IdentificationSupport":"","LoyaltyID":""}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"PaymentAccountReq": @{ @"AccountType": @"", @"CardAcquisitionReference": @{ @"TransactionID": @"", @"TimeStamp": @"" }, @"PaymentInstrumentData": @{ @"PaymentInstrumentType": @"", @"ProtectedCardData": @"", @"CardData": @{ @"PaymentBrand": @"", @"MaskedPan": @"", @"PaymentAccountRef": @"", @"EntryMode": @[ ], @"CardCountryCode": @0, @"ProtectedCardData": @"", @"SensitiveCardData": @{ @"PAN": @0, @"CardSeqNumb": @0, @"ExpiryDate": @0, @"TrackData": @[ @{ @"TrackNumb": @0, @"TrackFormat": @"", @"TrackValue": @"" } ] }, @"AllowedProductCode": @[ ], @"AllowedProduct": @[ @{ @"ProductCode": @0, @"EanUpc": @0, @"ProductLabel": @"", @"AdditionalProductInfo": @"" } ], @"PaymentToken": @{ @"TokenRequestedType": @"", @"TokenValue": @"", @"ExpiryDateTime": @"" }, @"CustomerOrder": @[ @{ @"CustomerOrderID": @"", @"SaleReferenceID": @"", @"OpenOrderState": @NO, @"StartDate": @"", @"EndDate": @"", @"ForecastedAmount": @"", @"CurrentAmount": @"", @"Currency": @"", @"AccessedBy": @"", @"AdditionalInformation": @"" } ] }, @"CheckData": @{ @"BankID": @"", @"AccountNumber": @"", @"CheckNumber": @"", @"TrackData": @{ }, @"CheckCardNumber": @"", @"TypeCode": @"", @"Country": @"" }, @"MobileData": @{ @"MobileCountryCode": @0, @"MobileNetworkCode": @0, @"MaskedMSISDN": @0, @"Geolocation": @{ @"GeographicCoordinates": @{ @"Latitude": @"", @"Longitude": @"" }, @"UTMCoordinates": @{ @"UTMZone": @"", @"UTMEastward": @"", @"UTMNorthward": @"" } }, @"ProtectedMobileData": @"", @"SensitiveMobileData": @{ @"MSISDN": @0, @"IMSI": @0, @"IMEI": @0 } }, @"StoredValueAccountID": @{ @"StoredValueAccountType": @"", @"StoredValueProvider": @"", @"OwnerName": @"", @"ExpiryDate": @0, @"EntryMode": @[ ], @"IdentificationType": @"", @"StoredValueID": @"" } } },
@"LoyaltyAccountReq": @{ @"CardAcquisitionReference": @{ }, @"LoyaltyAccountID": @{ @"EntryMode": @[ ], @"IdentificationType": @"", @"IdentificationSupport": @"", @"LoyaltyID": @"" } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/balanceinquiry"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/balanceinquiry" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"PaymentAccountReq\": {\n \"AccountType\": \"\",\n \"CardAcquisitionReference\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyAccountReq\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n }\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/balanceinquiry",
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([
'PaymentAccountReq' => [
'AccountType' => '',
'CardAcquisitionReference' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'PaymentInstrumentData' => [
'PaymentInstrumentType' => '',
'ProtectedCardData' => '',
'CardData' => [
'PaymentBrand' => '',
'MaskedPan' => '',
'PaymentAccountRef' => '',
'EntryMode' => [
],
'CardCountryCode' => 0,
'ProtectedCardData' => '',
'SensitiveCardData' => [
'PAN' => 0,
'CardSeqNumb' => 0,
'ExpiryDate' => 0,
'TrackData' => [
[
'TrackNumb' => 0,
'TrackFormat' => '',
'TrackValue' => ''
]
]
],
'AllowedProductCode' => [
],
'AllowedProduct' => [
[
'ProductCode' => 0,
'EanUpc' => 0,
'ProductLabel' => '',
'AdditionalProductInfo' => ''
]
],
'PaymentToken' => [
'TokenRequestedType' => '',
'TokenValue' => '',
'ExpiryDateTime' => ''
],
'CustomerOrder' => [
[
'CustomerOrderID' => '',
'SaleReferenceID' => '',
'OpenOrderState' => null,
'StartDate' => '',
'EndDate' => '',
'ForecastedAmount' => '',
'CurrentAmount' => '',
'Currency' => '',
'AccessedBy' => '',
'AdditionalInformation' => ''
]
]
],
'CheckData' => [
'BankID' => '',
'AccountNumber' => '',
'CheckNumber' => '',
'TrackData' => [
],
'CheckCardNumber' => '',
'TypeCode' => '',
'Country' => ''
],
'MobileData' => [
'MobileCountryCode' => 0,
'MobileNetworkCode' => 0,
'MaskedMSISDN' => 0,
'Geolocation' => [
'GeographicCoordinates' => [
'Latitude' => '',
'Longitude' => ''
],
'UTMCoordinates' => [
'UTMZone' => '',
'UTMEastward' => '',
'UTMNorthward' => ''
]
],
'ProtectedMobileData' => '',
'SensitiveMobileData' => [
'MSISDN' => 0,
'IMSI' => 0,
'IMEI' => 0
]
],
'StoredValueAccountID' => [
'StoredValueAccountType' => '',
'StoredValueProvider' => '',
'OwnerName' => '',
'ExpiryDate' => 0,
'EntryMode' => [
],
'IdentificationType' => '',
'StoredValueID' => ''
]
]
],
'LoyaltyAccountReq' => [
'CardAcquisitionReference' => [
],
'LoyaltyAccountID' => [
'EntryMode' => [
],
'IdentificationType' => '',
'IdentificationSupport' => '',
'LoyaltyID' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/balanceinquiry', [
'body' => '{
"PaymentAccountReq": {
"AccountType": "",
"CardAcquisitionReference": {
"TransactionID": "",
"TimeStamp": ""
},
"PaymentInstrumentData": {
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": {
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": {
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
{
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
}
]
},
"AllowedProductCode": [],
"AllowedProduct": [
{
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
],
"PaymentToken": {
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
},
"CustomerOrder": [
{
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
}
]
},
"CheckData": {
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": {},
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
},
"MobileData": {
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": {
"GeographicCoordinates": {
"Latitude": "",
"Longitude": ""
},
"UTMCoordinates": {
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
}
},
"ProtectedMobileData": "",
"SensitiveMobileData": {
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
}
},
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
}
}
},
"LoyaltyAccountReq": {
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/balanceinquiry');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'PaymentAccountReq' => [
'AccountType' => '',
'CardAcquisitionReference' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'PaymentInstrumentData' => [
'PaymentInstrumentType' => '',
'ProtectedCardData' => '',
'CardData' => [
'PaymentBrand' => '',
'MaskedPan' => '',
'PaymentAccountRef' => '',
'EntryMode' => [
],
'CardCountryCode' => 0,
'ProtectedCardData' => '',
'SensitiveCardData' => [
'PAN' => 0,
'CardSeqNumb' => 0,
'ExpiryDate' => 0,
'TrackData' => [
[
'TrackNumb' => 0,
'TrackFormat' => '',
'TrackValue' => ''
]
]
],
'AllowedProductCode' => [
],
'AllowedProduct' => [
[
'ProductCode' => 0,
'EanUpc' => 0,
'ProductLabel' => '',
'AdditionalProductInfo' => ''
]
],
'PaymentToken' => [
'TokenRequestedType' => '',
'TokenValue' => '',
'ExpiryDateTime' => ''
],
'CustomerOrder' => [
[
'CustomerOrderID' => '',
'SaleReferenceID' => '',
'OpenOrderState' => null,
'StartDate' => '',
'EndDate' => '',
'ForecastedAmount' => '',
'CurrentAmount' => '',
'Currency' => '',
'AccessedBy' => '',
'AdditionalInformation' => ''
]
]
],
'CheckData' => [
'BankID' => '',
'AccountNumber' => '',
'CheckNumber' => '',
'TrackData' => [
],
'CheckCardNumber' => '',
'TypeCode' => '',
'Country' => ''
],
'MobileData' => [
'MobileCountryCode' => 0,
'MobileNetworkCode' => 0,
'MaskedMSISDN' => 0,
'Geolocation' => [
'GeographicCoordinates' => [
'Latitude' => '',
'Longitude' => ''
],
'UTMCoordinates' => [
'UTMZone' => '',
'UTMEastward' => '',
'UTMNorthward' => ''
]
],
'ProtectedMobileData' => '',
'SensitiveMobileData' => [
'MSISDN' => 0,
'IMSI' => 0,
'IMEI' => 0
]
],
'StoredValueAccountID' => [
'StoredValueAccountType' => '',
'StoredValueProvider' => '',
'OwnerName' => '',
'ExpiryDate' => 0,
'EntryMode' => [
],
'IdentificationType' => '',
'StoredValueID' => ''
]
]
],
'LoyaltyAccountReq' => [
'CardAcquisitionReference' => [
],
'LoyaltyAccountID' => [
'EntryMode' => [
],
'IdentificationType' => '',
'IdentificationSupport' => '',
'LoyaltyID' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'PaymentAccountReq' => [
'AccountType' => '',
'CardAcquisitionReference' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'PaymentInstrumentData' => [
'PaymentInstrumentType' => '',
'ProtectedCardData' => '',
'CardData' => [
'PaymentBrand' => '',
'MaskedPan' => '',
'PaymentAccountRef' => '',
'EntryMode' => [
],
'CardCountryCode' => 0,
'ProtectedCardData' => '',
'SensitiveCardData' => [
'PAN' => 0,
'CardSeqNumb' => 0,
'ExpiryDate' => 0,
'TrackData' => [
[
'TrackNumb' => 0,
'TrackFormat' => '',
'TrackValue' => ''
]
]
],
'AllowedProductCode' => [
],
'AllowedProduct' => [
[
'ProductCode' => 0,
'EanUpc' => 0,
'ProductLabel' => '',
'AdditionalProductInfo' => ''
]
],
'PaymentToken' => [
'TokenRequestedType' => '',
'TokenValue' => '',
'ExpiryDateTime' => ''
],
'CustomerOrder' => [
[
'CustomerOrderID' => '',
'SaleReferenceID' => '',
'OpenOrderState' => null,
'StartDate' => '',
'EndDate' => '',
'ForecastedAmount' => '',
'CurrentAmount' => '',
'Currency' => '',
'AccessedBy' => '',
'AdditionalInformation' => ''
]
]
],
'CheckData' => [
'BankID' => '',
'AccountNumber' => '',
'CheckNumber' => '',
'TrackData' => [
],
'CheckCardNumber' => '',
'TypeCode' => '',
'Country' => ''
],
'MobileData' => [
'MobileCountryCode' => 0,
'MobileNetworkCode' => 0,
'MaskedMSISDN' => 0,
'Geolocation' => [
'GeographicCoordinates' => [
'Latitude' => '',
'Longitude' => ''
],
'UTMCoordinates' => [
'UTMZone' => '',
'UTMEastward' => '',
'UTMNorthward' => ''
]
],
'ProtectedMobileData' => '',
'SensitiveMobileData' => [
'MSISDN' => 0,
'IMSI' => 0,
'IMEI' => 0
]
],
'StoredValueAccountID' => [
'StoredValueAccountType' => '',
'StoredValueProvider' => '',
'OwnerName' => '',
'ExpiryDate' => 0,
'EntryMode' => [
],
'IdentificationType' => '',
'StoredValueID' => ''
]
]
],
'LoyaltyAccountReq' => [
'CardAcquisitionReference' => [
],
'LoyaltyAccountID' => [
'EntryMode' => [
],
'IdentificationType' => '',
'IdentificationSupport' => '',
'LoyaltyID' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/balanceinquiry');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/balanceinquiry' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"PaymentAccountReq": {
"AccountType": "",
"CardAcquisitionReference": {
"TransactionID": "",
"TimeStamp": ""
},
"PaymentInstrumentData": {
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": {
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": {
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
{
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
}
]
},
"AllowedProductCode": [],
"AllowedProduct": [
{
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
],
"PaymentToken": {
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
},
"CustomerOrder": [
{
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
}
]
},
"CheckData": {
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": {},
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
},
"MobileData": {
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": {
"GeographicCoordinates": {
"Latitude": "",
"Longitude": ""
},
"UTMCoordinates": {
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
}
},
"ProtectedMobileData": "",
"SensitiveMobileData": {
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
}
},
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
}
}
},
"LoyaltyAccountReq": {
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/balanceinquiry' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"PaymentAccountReq": {
"AccountType": "",
"CardAcquisitionReference": {
"TransactionID": "",
"TimeStamp": ""
},
"PaymentInstrumentData": {
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": {
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": {
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
{
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
}
]
},
"AllowedProductCode": [],
"AllowedProduct": [
{
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
],
"PaymentToken": {
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
},
"CustomerOrder": [
{
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
}
]
},
"CheckData": {
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": {},
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
},
"MobileData": {
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": {
"GeographicCoordinates": {
"Latitude": "",
"Longitude": ""
},
"UTMCoordinates": {
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
}
},
"ProtectedMobileData": "",
"SensitiveMobileData": {
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
}
},
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
}
}
},
"LoyaltyAccountReq": {
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"PaymentAccountReq\": {\n \"AccountType\": \"\",\n \"CardAcquisitionReference\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyAccountReq\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/balanceinquiry", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/balanceinquiry"
payload = {
"PaymentAccountReq": {
"AccountType": "",
"CardAcquisitionReference": {
"TransactionID": "",
"TimeStamp": ""
},
"PaymentInstrumentData": {
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": {
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": {
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
{
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
}
]
},
"AllowedProductCode": [],
"AllowedProduct": [
{
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
],
"PaymentToken": {
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
},
"CustomerOrder": [
{
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": False,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
}
]
},
"CheckData": {
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": {},
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
},
"MobileData": {
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": {
"GeographicCoordinates": {
"Latitude": "",
"Longitude": ""
},
"UTMCoordinates": {
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
}
},
"ProtectedMobileData": "",
"SensitiveMobileData": {
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
}
},
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
}
}
},
"LoyaltyAccountReq": {
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
}
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/balanceinquiry"
payload <- "{\n \"PaymentAccountReq\": {\n \"AccountType\": \"\",\n \"CardAcquisitionReference\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyAccountReq\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n }\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/balanceinquiry")
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 \"PaymentAccountReq\": {\n \"AccountType\": \"\",\n \"CardAcquisitionReference\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyAccountReq\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/balanceinquiry') do |req|
req.body = "{\n \"PaymentAccountReq\": {\n \"AccountType\": \"\",\n \"CardAcquisitionReference\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyAccountReq\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n }\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/balanceinquiry";
let payload = json!({
"PaymentAccountReq": json!({
"AccountType": "",
"CardAcquisitionReference": json!({
"TransactionID": "",
"TimeStamp": ""
}),
"PaymentInstrumentData": json!({
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": json!({
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": (),
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": json!({
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": (
json!({
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
})
)
}),
"AllowedProductCode": (),
"AllowedProduct": (
json!({
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
})
),
"PaymentToken": json!({
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
}),
"CustomerOrder": (
json!({
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
})
)
}),
"CheckData": json!({
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": json!({}),
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
}),
"MobileData": json!({
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": json!({
"GeographicCoordinates": json!({
"Latitude": "",
"Longitude": ""
}),
"UTMCoordinates": json!({
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
})
}),
"ProtectedMobileData": "",
"SensitiveMobileData": json!({
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
})
}),
"StoredValueAccountID": json!({
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": (),
"IdentificationType": "",
"StoredValueID": ""
})
})
}),
"LoyaltyAccountReq": json!({
"CardAcquisitionReference": json!({}),
"LoyaltyAccountID": json!({
"EntryMode": (),
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
})
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/balanceinquiry \
--header 'content-type: application/json' \
--data '{
"PaymentAccountReq": {
"AccountType": "",
"CardAcquisitionReference": {
"TransactionID": "",
"TimeStamp": ""
},
"PaymentInstrumentData": {
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": {
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": {
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
{
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
}
]
},
"AllowedProductCode": [],
"AllowedProduct": [
{
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
],
"PaymentToken": {
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
},
"CustomerOrder": [
{
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
}
]
},
"CheckData": {
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": {},
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
},
"MobileData": {
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": {
"GeographicCoordinates": {
"Latitude": "",
"Longitude": ""
},
"UTMCoordinates": {
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
}
},
"ProtectedMobileData": "",
"SensitiveMobileData": {
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
}
},
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
}
}
},
"LoyaltyAccountReq": {
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
}
}
}'
echo '{
"PaymentAccountReq": {
"AccountType": "",
"CardAcquisitionReference": {
"TransactionID": "",
"TimeStamp": ""
},
"PaymentInstrumentData": {
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": {
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": {
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
{
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
}
]
},
"AllowedProductCode": [],
"AllowedProduct": [
{
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
],
"PaymentToken": {
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
},
"CustomerOrder": [
{
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
}
]
},
"CheckData": {
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": {},
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
},
"MobileData": {
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": {
"GeographicCoordinates": {
"Latitude": "",
"Longitude": ""
},
"UTMCoordinates": {
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
}
},
"ProtectedMobileData": "",
"SensitiveMobileData": {
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
}
},
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
}
}
},
"LoyaltyAccountReq": {
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
}
}
}' | \
http POST {{baseUrl}}/balanceinquiry \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "PaymentAccountReq": {\n "AccountType": "",\n "CardAcquisitionReference": {\n "TransactionID": "",\n "TimeStamp": ""\n },\n "PaymentInstrumentData": {\n "PaymentInstrumentType": "",\n "ProtectedCardData": "",\n "CardData": {\n "PaymentBrand": "",\n "MaskedPan": "",\n "PaymentAccountRef": "",\n "EntryMode": [],\n "CardCountryCode": 0,\n "ProtectedCardData": "",\n "SensitiveCardData": {\n "PAN": 0,\n "CardSeqNumb": 0,\n "ExpiryDate": 0,\n "TrackData": [\n {\n "TrackNumb": 0,\n "TrackFormat": "",\n "TrackValue": ""\n }\n ]\n },\n "AllowedProductCode": [],\n "AllowedProduct": [\n {\n "ProductCode": 0,\n "EanUpc": 0,\n "ProductLabel": "",\n "AdditionalProductInfo": ""\n }\n ],\n "PaymentToken": {\n "TokenRequestedType": "",\n "TokenValue": "",\n "ExpiryDateTime": ""\n },\n "CustomerOrder": [\n {\n "CustomerOrderID": "",\n "SaleReferenceID": "",\n "OpenOrderState": false,\n "StartDate": "",\n "EndDate": "",\n "ForecastedAmount": "",\n "CurrentAmount": "",\n "Currency": "",\n "AccessedBy": "",\n "AdditionalInformation": ""\n }\n ]\n },\n "CheckData": {\n "BankID": "",\n "AccountNumber": "",\n "CheckNumber": "",\n "TrackData": {},\n "CheckCardNumber": "",\n "TypeCode": "",\n "Country": ""\n },\n "MobileData": {\n "MobileCountryCode": 0,\n "MobileNetworkCode": 0,\n "MaskedMSISDN": 0,\n "Geolocation": {\n "GeographicCoordinates": {\n "Latitude": "",\n "Longitude": ""\n },\n "UTMCoordinates": {\n "UTMZone": "",\n "UTMEastward": "",\n "UTMNorthward": ""\n }\n },\n "ProtectedMobileData": "",\n "SensitiveMobileData": {\n "MSISDN": 0,\n "IMSI": 0,\n "IMEI": 0\n }\n },\n "StoredValueAccountID": {\n "StoredValueAccountType": "",\n "StoredValueProvider": "",\n "OwnerName": "",\n "ExpiryDate": 0,\n "EntryMode": [],\n "IdentificationType": "",\n "StoredValueID": ""\n }\n }\n },\n "LoyaltyAccountReq": {\n "CardAcquisitionReference": {},\n "LoyaltyAccountID": {\n "EntryMode": [],\n "IdentificationType": "",\n "IdentificationSupport": "",\n "LoyaltyID": ""\n }\n }\n}' \
--output-document \
- {{baseUrl}}/balanceinquiry
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"PaymentAccountReq": [
"AccountType": "",
"CardAcquisitionReference": [
"TransactionID": "",
"TimeStamp": ""
],
"PaymentInstrumentData": [
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": [
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": [
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
[
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
]
]
],
"AllowedProductCode": [],
"AllowedProduct": [
[
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
]
],
"PaymentToken": [
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
],
"CustomerOrder": [
[
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
]
]
],
"CheckData": [
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": [],
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
],
"MobileData": [
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": [
"GeographicCoordinates": [
"Latitude": "",
"Longitude": ""
],
"UTMCoordinates": [
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
]
],
"ProtectedMobileData": "",
"SensitiveMobileData": [
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
]
],
"StoredValueAccountID": [
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
]
]
],
"LoyaltyAccountReq": [
"CardAcquisitionReference": [],
"LoyaltyAccountID": [
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/balanceinquiry")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CardAcquisition Request
{{baseUrl}}/cardacquisition
BODY json
{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"CardAcquisitionTransaction": {
"AllowedPaymentBrand": [],
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceEntryMode": [],
"ForceCustomerSelectionFlag": false,
"TotalAmount": "",
"PaymentType": "",
"CashBackFlag": false
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cardacquisition");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"CardAcquisitionTransaction\": {\n \"AllowedPaymentBrand\": [],\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceEntryMode\": [],\n \"ForceCustomerSelectionFlag\": false,\n \"TotalAmount\": \"\",\n \"PaymentType\": \"\",\n \"CashBackFlag\": false\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cardacquisition" {:content-type :json
:form-params {:SaleData {:OperatorID ""
:OperatorLanguage ""
:ShiftNumber ""
:SaleTransactionID {:TransactionID ""
:TimeStamp ""}
:SaleReferenceID ""
:SaleTerminalData {:TotalsGroupID ""}
:TokenRequestedType ""
:CustomerOrderID ""
:CustomerOrderReq []
:SaleToPOIData ""
:SaleToAcquirerData ""
:SaleToIssuerData {:StatementReference ""}}
:CardAcquisitionTransaction {:AllowedPaymentBrand []
:AllowedLoyaltyBrand []
:LoyaltyHandling ""
:ForceEntryMode []
:ForceCustomerSelectionFlag false
:TotalAmount ""
:PaymentType ""
:CashBackFlag false}}})
require "http/client"
url = "{{baseUrl}}/cardacquisition"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"CardAcquisitionTransaction\": {\n \"AllowedPaymentBrand\": [],\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceEntryMode\": [],\n \"ForceCustomerSelectionFlag\": false,\n \"TotalAmount\": \"\",\n \"PaymentType\": \"\",\n \"CashBackFlag\": false\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cardacquisition"),
Content = new StringContent("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"CardAcquisitionTransaction\": {\n \"AllowedPaymentBrand\": [],\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceEntryMode\": [],\n \"ForceCustomerSelectionFlag\": false,\n \"TotalAmount\": \"\",\n \"PaymentType\": \"\",\n \"CashBackFlag\": false\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cardacquisition");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"CardAcquisitionTransaction\": {\n \"AllowedPaymentBrand\": [],\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceEntryMode\": [],\n \"ForceCustomerSelectionFlag\": false,\n \"TotalAmount\": \"\",\n \"PaymentType\": \"\",\n \"CashBackFlag\": false\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cardacquisition"
payload := strings.NewReader("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"CardAcquisitionTransaction\": {\n \"AllowedPaymentBrand\": [],\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceEntryMode\": [],\n \"ForceCustomerSelectionFlag\": false,\n \"TotalAmount\": \"\",\n \"PaymentType\": \"\",\n \"CashBackFlag\": false\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(res)
fmt.Println(string(body))
}
POST /baseUrl/cardacquisition HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 735
{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"CardAcquisitionTransaction": {
"AllowedPaymentBrand": [],
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceEntryMode": [],
"ForceCustomerSelectionFlag": false,
"TotalAmount": "",
"PaymentType": "",
"CashBackFlag": false
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cardacquisition")
.setHeader("content-type", "application/json")
.setBody("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"CardAcquisitionTransaction\": {\n \"AllowedPaymentBrand\": [],\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceEntryMode\": [],\n \"ForceCustomerSelectionFlag\": false,\n \"TotalAmount\": \"\",\n \"PaymentType\": \"\",\n \"CashBackFlag\": false\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cardacquisition"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"CardAcquisitionTransaction\": {\n \"AllowedPaymentBrand\": [],\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceEntryMode\": [],\n \"ForceCustomerSelectionFlag\": false,\n \"TotalAmount\": \"\",\n \"PaymentType\": \"\",\n \"CashBackFlag\": false\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"CardAcquisitionTransaction\": {\n \"AllowedPaymentBrand\": [],\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceEntryMode\": [],\n \"ForceCustomerSelectionFlag\": false,\n \"TotalAmount\": \"\",\n \"PaymentType\": \"\",\n \"CashBackFlag\": false\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cardacquisition")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cardacquisition")
.header("content-type", "application/json")
.body("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"CardAcquisitionTransaction\": {\n \"AllowedPaymentBrand\": [],\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceEntryMode\": [],\n \"ForceCustomerSelectionFlag\": false,\n \"TotalAmount\": \"\",\n \"PaymentType\": \"\",\n \"CashBackFlag\": false\n }\n}")
.asString();
const data = JSON.stringify({
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {
TransactionID: '',
TimeStamp: ''
},
SaleReferenceID: '',
SaleTerminalData: {
TotalsGroupID: ''
},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {
StatementReference: ''
}
},
CardAcquisitionTransaction: {
AllowedPaymentBrand: [],
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceEntryMode: [],
ForceCustomerSelectionFlag: false,
TotalAmount: '',
PaymentType: '',
CashBackFlag: false
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cardacquisition');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cardacquisition',
headers: {'content-type': 'application/json'},
data: {
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
CardAcquisitionTransaction: {
AllowedPaymentBrand: [],
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceEntryMode: [],
ForceCustomerSelectionFlag: false,
TotalAmount: '',
PaymentType: '',
CashBackFlag: false
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cardacquisition';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"SaleData":{"OperatorID":"","OperatorLanguage":"","ShiftNumber":"","SaleTransactionID":{"TransactionID":"","TimeStamp":""},"SaleReferenceID":"","SaleTerminalData":{"TotalsGroupID":""},"TokenRequestedType":"","CustomerOrderID":"","CustomerOrderReq":[],"SaleToPOIData":"","SaleToAcquirerData":"","SaleToIssuerData":{"StatementReference":""}},"CardAcquisitionTransaction":{"AllowedPaymentBrand":[],"AllowedLoyaltyBrand":[],"LoyaltyHandling":"","ForceEntryMode":[],"ForceCustomerSelectionFlag":false,"TotalAmount":"","PaymentType":"","CashBackFlag":false}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cardacquisition',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "SaleData": {\n "OperatorID": "",\n "OperatorLanguage": "",\n "ShiftNumber": "",\n "SaleTransactionID": {\n "TransactionID": "",\n "TimeStamp": ""\n },\n "SaleReferenceID": "",\n "SaleTerminalData": {\n "TotalsGroupID": ""\n },\n "TokenRequestedType": "",\n "CustomerOrderID": "",\n "CustomerOrderReq": [],\n "SaleToPOIData": "",\n "SaleToAcquirerData": "",\n "SaleToIssuerData": {\n "StatementReference": ""\n }\n },\n "CardAcquisitionTransaction": {\n "AllowedPaymentBrand": [],\n "AllowedLoyaltyBrand": [],\n "LoyaltyHandling": "",\n "ForceEntryMode": [],\n "ForceCustomerSelectionFlag": false,\n "TotalAmount": "",\n "PaymentType": "",\n "CashBackFlag": false\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"CardAcquisitionTransaction\": {\n \"AllowedPaymentBrand\": [],\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceEntryMode\": [],\n \"ForceCustomerSelectionFlag\": false,\n \"TotalAmount\": \"\",\n \"PaymentType\": \"\",\n \"CashBackFlag\": false\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cardacquisition")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cardacquisition',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
CardAcquisitionTransaction: {
AllowedPaymentBrand: [],
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceEntryMode: [],
ForceCustomerSelectionFlag: false,
TotalAmount: '',
PaymentType: '',
CashBackFlag: false
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cardacquisition',
headers: {'content-type': 'application/json'},
body: {
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
CardAcquisitionTransaction: {
AllowedPaymentBrand: [],
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceEntryMode: [],
ForceCustomerSelectionFlag: false,
TotalAmount: '',
PaymentType: '',
CashBackFlag: false
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cardacquisition');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {
TransactionID: '',
TimeStamp: ''
},
SaleReferenceID: '',
SaleTerminalData: {
TotalsGroupID: ''
},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {
StatementReference: ''
}
},
CardAcquisitionTransaction: {
AllowedPaymentBrand: [],
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceEntryMode: [],
ForceCustomerSelectionFlag: false,
TotalAmount: '',
PaymentType: '',
CashBackFlag: false
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cardacquisition',
headers: {'content-type': 'application/json'},
data: {
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
CardAcquisitionTransaction: {
AllowedPaymentBrand: [],
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceEntryMode: [],
ForceCustomerSelectionFlag: false,
TotalAmount: '',
PaymentType: '',
CashBackFlag: false
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cardacquisition';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"SaleData":{"OperatorID":"","OperatorLanguage":"","ShiftNumber":"","SaleTransactionID":{"TransactionID":"","TimeStamp":""},"SaleReferenceID":"","SaleTerminalData":{"TotalsGroupID":""},"TokenRequestedType":"","CustomerOrderID":"","CustomerOrderReq":[],"SaleToPOIData":"","SaleToAcquirerData":"","SaleToIssuerData":{"StatementReference":""}},"CardAcquisitionTransaction":{"AllowedPaymentBrand":[],"AllowedLoyaltyBrand":[],"LoyaltyHandling":"","ForceEntryMode":[],"ForceCustomerSelectionFlag":false,"TotalAmount":"","PaymentType":"","CashBackFlag":false}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"SaleData": @{ @"OperatorID": @"", @"OperatorLanguage": @"", @"ShiftNumber": @"", @"SaleTransactionID": @{ @"TransactionID": @"", @"TimeStamp": @"" }, @"SaleReferenceID": @"", @"SaleTerminalData": @{ @"TotalsGroupID": @"" }, @"TokenRequestedType": @"", @"CustomerOrderID": @"", @"CustomerOrderReq": @[ ], @"SaleToPOIData": @"", @"SaleToAcquirerData": @"", @"SaleToIssuerData": @{ @"StatementReference": @"" } },
@"CardAcquisitionTransaction": @{ @"AllowedPaymentBrand": @[ ], @"AllowedLoyaltyBrand": @[ ], @"LoyaltyHandling": @"", @"ForceEntryMode": @[ ], @"ForceCustomerSelectionFlag": @NO, @"TotalAmount": @"", @"PaymentType": @"", @"CashBackFlag": @NO } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cardacquisition"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cardacquisition" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"CardAcquisitionTransaction\": {\n \"AllowedPaymentBrand\": [],\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceEntryMode\": [],\n \"ForceCustomerSelectionFlag\": false,\n \"TotalAmount\": \"\",\n \"PaymentType\": \"\",\n \"CashBackFlag\": false\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cardacquisition",
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([
'SaleData' => [
'OperatorID' => '',
'OperatorLanguage' => '',
'ShiftNumber' => '',
'SaleTransactionID' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'SaleReferenceID' => '',
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TokenRequestedType' => '',
'CustomerOrderID' => '',
'CustomerOrderReq' => [
],
'SaleToPOIData' => '',
'SaleToAcquirerData' => '',
'SaleToIssuerData' => [
'StatementReference' => ''
]
],
'CardAcquisitionTransaction' => [
'AllowedPaymentBrand' => [
],
'AllowedLoyaltyBrand' => [
],
'LoyaltyHandling' => '',
'ForceEntryMode' => [
],
'ForceCustomerSelectionFlag' => null,
'TotalAmount' => '',
'PaymentType' => '',
'CashBackFlag' => null
]
]),
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;
}
request('POST', '{{baseUrl}}/cardacquisition', [
'body' => '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"CardAcquisitionTransaction": {
"AllowedPaymentBrand": [],
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceEntryMode": [],
"ForceCustomerSelectionFlag": false,
"TotalAmount": "",
"PaymentType": "",
"CashBackFlag": false
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cardacquisition');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SaleData' => [
'OperatorID' => '',
'OperatorLanguage' => '',
'ShiftNumber' => '',
'SaleTransactionID' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'SaleReferenceID' => '',
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TokenRequestedType' => '',
'CustomerOrderID' => '',
'CustomerOrderReq' => [
],
'SaleToPOIData' => '',
'SaleToAcquirerData' => '',
'SaleToIssuerData' => [
'StatementReference' => ''
]
],
'CardAcquisitionTransaction' => [
'AllowedPaymentBrand' => [
],
'AllowedLoyaltyBrand' => [
],
'LoyaltyHandling' => '',
'ForceEntryMode' => [
],
'ForceCustomerSelectionFlag' => null,
'TotalAmount' => '',
'PaymentType' => '',
'CashBackFlag' => null
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SaleData' => [
'OperatorID' => '',
'OperatorLanguage' => '',
'ShiftNumber' => '',
'SaleTransactionID' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'SaleReferenceID' => '',
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TokenRequestedType' => '',
'CustomerOrderID' => '',
'CustomerOrderReq' => [
],
'SaleToPOIData' => '',
'SaleToAcquirerData' => '',
'SaleToIssuerData' => [
'StatementReference' => ''
]
],
'CardAcquisitionTransaction' => [
'AllowedPaymentBrand' => [
],
'AllowedLoyaltyBrand' => [
],
'LoyaltyHandling' => '',
'ForceEntryMode' => [
],
'ForceCustomerSelectionFlag' => null,
'TotalAmount' => '',
'PaymentType' => '',
'CashBackFlag' => null
]
]));
$request->setRequestUrl('{{baseUrl}}/cardacquisition');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cardacquisition' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"CardAcquisitionTransaction": {
"AllowedPaymentBrand": [],
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceEntryMode": [],
"ForceCustomerSelectionFlag": false,
"TotalAmount": "",
"PaymentType": "",
"CashBackFlag": false
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cardacquisition' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"CardAcquisitionTransaction": {
"AllowedPaymentBrand": [],
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceEntryMode": [],
"ForceCustomerSelectionFlag": false,
"TotalAmount": "",
"PaymentType": "",
"CashBackFlag": false
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"CardAcquisitionTransaction\": {\n \"AllowedPaymentBrand\": [],\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceEntryMode\": [],\n \"ForceCustomerSelectionFlag\": false,\n \"TotalAmount\": \"\",\n \"PaymentType\": \"\",\n \"CashBackFlag\": false\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/cardacquisition", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cardacquisition"
payload = {
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": { "TotalsGroupID": "" },
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": { "StatementReference": "" }
},
"CardAcquisitionTransaction": {
"AllowedPaymentBrand": [],
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceEntryMode": [],
"ForceCustomerSelectionFlag": False,
"TotalAmount": "",
"PaymentType": "",
"CashBackFlag": False
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cardacquisition"
payload <- "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"CardAcquisitionTransaction\": {\n \"AllowedPaymentBrand\": [],\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceEntryMode\": [],\n \"ForceCustomerSelectionFlag\": false,\n \"TotalAmount\": \"\",\n \"PaymentType\": \"\",\n \"CashBackFlag\": false\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cardacquisition")
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 \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"CardAcquisitionTransaction\": {\n \"AllowedPaymentBrand\": [],\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceEntryMode\": [],\n \"ForceCustomerSelectionFlag\": false,\n \"TotalAmount\": \"\",\n \"PaymentType\": \"\",\n \"CashBackFlag\": false\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cardacquisition') do |req|
req.body = "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"CardAcquisitionTransaction\": {\n \"AllowedPaymentBrand\": [],\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceEntryMode\": [],\n \"ForceCustomerSelectionFlag\": false,\n \"TotalAmount\": \"\",\n \"PaymentType\": \"\",\n \"CashBackFlag\": false\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cardacquisition";
let payload = json!({
"SaleData": json!({
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": json!({
"TransactionID": "",
"TimeStamp": ""
}),
"SaleReferenceID": "",
"SaleTerminalData": json!({"TotalsGroupID": ""}),
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": (),
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": json!({"StatementReference": ""})
}),
"CardAcquisitionTransaction": json!({
"AllowedPaymentBrand": (),
"AllowedLoyaltyBrand": (),
"LoyaltyHandling": "",
"ForceEntryMode": (),
"ForceCustomerSelectionFlag": false,
"TotalAmount": "",
"PaymentType": "",
"CashBackFlag": false
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cardacquisition \
--header 'content-type: application/json' \
--data '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"CardAcquisitionTransaction": {
"AllowedPaymentBrand": [],
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceEntryMode": [],
"ForceCustomerSelectionFlag": false,
"TotalAmount": "",
"PaymentType": "",
"CashBackFlag": false
}
}'
echo '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"CardAcquisitionTransaction": {
"AllowedPaymentBrand": [],
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceEntryMode": [],
"ForceCustomerSelectionFlag": false,
"TotalAmount": "",
"PaymentType": "",
"CashBackFlag": false
}
}' | \
http POST {{baseUrl}}/cardacquisition \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "SaleData": {\n "OperatorID": "",\n "OperatorLanguage": "",\n "ShiftNumber": "",\n "SaleTransactionID": {\n "TransactionID": "",\n "TimeStamp": ""\n },\n "SaleReferenceID": "",\n "SaleTerminalData": {\n "TotalsGroupID": ""\n },\n "TokenRequestedType": "",\n "CustomerOrderID": "",\n "CustomerOrderReq": [],\n "SaleToPOIData": "",\n "SaleToAcquirerData": "",\n "SaleToIssuerData": {\n "StatementReference": ""\n }\n },\n "CardAcquisitionTransaction": {\n "AllowedPaymentBrand": [],\n "AllowedLoyaltyBrand": [],\n "LoyaltyHandling": "",\n "ForceEntryMode": [],\n "ForceCustomerSelectionFlag": false,\n "TotalAmount": "",\n "PaymentType": "",\n "CashBackFlag": false\n }\n}' \
--output-document \
- {{baseUrl}}/cardacquisition
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"SaleData": [
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": [
"TransactionID": "",
"TimeStamp": ""
],
"SaleReferenceID": "",
"SaleTerminalData": ["TotalsGroupID": ""],
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": ["StatementReference": ""]
],
"CardAcquisitionTransaction": [
"AllowedPaymentBrand": [],
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceEntryMode": [],
"ForceCustomerSelectionFlag": false,
"TotalAmount": "",
"PaymentType": "",
"CashBackFlag": false
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cardacquisition")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CardReaderAPDU Request
{{baseUrl}}/cardreaderapdu
BODY json
{
"APDUClass": "",
"APDUInstruction": "",
"APDUPar1": "",
"APDUPar2": "",
"APDUData": "",
"APDUExpectedLength": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cardreaderapdu");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"APDUClass\": \"\",\n \"APDUInstruction\": \"\",\n \"APDUPar1\": \"\",\n \"APDUPar2\": \"\",\n \"APDUData\": \"\",\n \"APDUExpectedLength\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cardreaderapdu" {:content-type :json
:form-params {:APDUClass ""
:APDUInstruction ""
:APDUPar1 ""
:APDUPar2 ""
:APDUData ""
:APDUExpectedLength ""}})
require "http/client"
url = "{{baseUrl}}/cardreaderapdu"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"APDUClass\": \"\",\n \"APDUInstruction\": \"\",\n \"APDUPar1\": \"\",\n \"APDUPar2\": \"\",\n \"APDUData\": \"\",\n \"APDUExpectedLength\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cardreaderapdu"),
Content = new StringContent("{\n \"APDUClass\": \"\",\n \"APDUInstruction\": \"\",\n \"APDUPar1\": \"\",\n \"APDUPar2\": \"\",\n \"APDUData\": \"\",\n \"APDUExpectedLength\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cardreaderapdu");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"APDUClass\": \"\",\n \"APDUInstruction\": \"\",\n \"APDUPar1\": \"\",\n \"APDUPar2\": \"\",\n \"APDUData\": \"\",\n \"APDUExpectedLength\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cardreaderapdu"
payload := strings.NewReader("{\n \"APDUClass\": \"\",\n \"APDUInstruction\": \"\",\n \"APDUPar1\": \"\",\n \"APDUPar2\": \"\",\n \"APDUData\": \"\",\n \"APDUExpectedLength\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/cardreaderapdu HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 128
{
"APDUClass": "",
"APDUInstruction": "",
"APDUPar1": "",
"APDUPar2": "",
"APDUData": "",
"APDUExpectedLength": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cardreaderapdu")
.setHeader("content-type", "application/json")
.setBody("{\n \"APDUClass\": \"\",\n \"APDUInstruction\": \"\",\n \"APDUPar1\": \"\",\n \"APDUPar2\": \"\",\n \"APDUData\": \"\",\n \"APDUExpectedLength\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cardreaderapdu"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"APDUClass\": \"\",\n \"APDUInstruction\": \"\",\n \"APDUPar1\": \"\",\n \"APDUPar2\": \"\",\n \"APDUData\": \"\",\n \"APDUExpectedLength\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"APDUClass\": \"\",\n \"APDUInstruction\": \"\",\n \"APDUPar1\": \"\",\n \"APDUPar2\": \"\",\n \"APDUData\": \"\",\n \"APDUExpectedLength\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cardreaderapdu")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cardreaderapdu")
.header("content-type", "application/json")
.body("{\n \"APDUClass\": \"\",\n \"APDUInstruction\": \"\",\n \"APDUPar1\": \"\",\n \"APDUPar2\": \"\",\n \"APDUData\": \"\",\n \"APDUExpectedLength\": \"\"\n}")
.asString();
const data = JSON.stringify({
APDUClass: '',
APDUInstruction: '',
APDUPar1: '',
APDUPar2: '',
APDUData: '',
APDUExpectedLength: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cardreaderapdu');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cardreaderapdu',
headers: {'content-type': 'application/json'},
data: {
APDUClass: '',
APDUInstruction: '',
APDUPar1: '',
APDUPar2: '',
APDUData: '',
APDUExpectedLength: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cardreaderapdu';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"APDUClass":"","APDUInstruction":"","APDUPar1":"","APDUPar2":"","APDUData":"","APDUExpectedLength":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cardreaderapdu',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "APDUClass": "",\n "APDUInstruction": "",\n "APDUPar1": "",\n "APDUPar2": "",\n "APDUData": "",\n "APDUExpectedLength": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"APDUClass\": \"\",\n \"APDUInstruction\": \"\",\n \"APDUPar1\": \"\",\n \"APDUPar2\": \"\",\n \"APDUData\": \"\",\n \"APDUExpectedLength\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cardreaderapdu")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cardreaderapdu',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
APDUClass: '',
APDUInstruction: '',
APDUPar1: '',
APDUPar2: '',
APDUData: '',
APDUExpectedLength: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cardreaderapdu',
headers: {'content-type': 'application/json'},
body: {
APDUClass: '',
APDUInstruction: '',
APDUPar1: '',
APDUPar2: '',
APDUData: '',
APDUExpectedLength: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cardreaderapdu');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
APDUClass: '',
APDUInstruction: '',
APDUPar1: '',
APDUPar2: '',
APDUData: '',
APDUExpectedLength: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cardreaderapdu',
headers: {'content-type': 'application/json'},
data: {
APDUClass: '',
APDUInstruction: '',
APDUPar1: '',
APDUPar2: '',
APDUData: '',
APDUExpectedLength: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cardreaderapdu';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"APDUClass":"","APDUInstruction":"","APDUPar1":"","APDUPar2":"","APDUData":"","APDUExpectedLength":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"APDUClass": @"",
@"APDUInstruction": @"",
@"APDUPar1": @"",
@"APDUPar2": @"",
@"APDUData": @"",
@"APDUExpectedLength": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cardreaderapdu"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cardreaderapdu" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"APDUClass\": \"\",\n \"APDUInstruction\": \"\",\n \"APDUPar1\": \"\",\n \"APDUPar2\": \"\",\n \"APDUData\": \"\",\n \"APDUExpectedLength\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cardreaderapdu",
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([
'APDUClass' => '',
'APDUInstruction' => '',
'APDUPar1' => '',
'APDUPar2' => '',
'APDUData' => '',
'APDUExpectedLength' => ''
]),
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;
}
request('POST', '{{baseUrl}}/cardreaderapdu', [
'body' => '{
"APDUClass": "",
"APDUInstruction": "",
"APDUPar1": "",
"APDUPar2": "",
"APDUData": "",
"APDUExpectedLength": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cardreaderapdu');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'APDUClass' => '',
'APDUInstruction' => '',
'APDUPar1' => '',
'APDUPar2' => '',
'APDUData' => '',
'APDUExpectedLength' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'APDUClass' => '',
'APDUInstruction' => '',
'APDUPar1' => '',
'APDUPar2' => '',
'APDUData' => '',
'APDUExpectedLength' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cardreaderapdu');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cardreaderapdu' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"APDUClass": "",
"APDUInstruction": "",
"APDUPar1": "",
"APDUPar2": "",
"APDUData": "",
"APDUExpectedLength": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cardreaderapdu' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"APDUClass": "",
"APDUInstruction": "",
"APDUPar1": "",
"APDUPar2": "",
"APDUData": "",
"APDUExpectedLength": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"APDUClass\": \"\",\n \"APDUInstruction\": \"\",\n \"APDUPar1\": \"\",\n \"APDUPar2\": \"\",\n \"APDUData\": \"\",\n \"APDUExpectedLength\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/cardreaderapdu", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cardreaderapdu"
payload = {
"APDUClass": "",
"APDUInstruction": "",
"APDUPar1": "",
"APDUPar2": "",
"APDUData": "",
"APDUExpectedLength": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cardreaderapdu"
payload <- "{\n \"APDUClass\": \"\",\n \"APDUInstruction\": \"\",\n \"APDUPar1\": \"\",\n \"APDUPar2\": \"\",\n \"APDUData\": \"\",\n \"APDUExpectedLength\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cardreaderapdu")
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 \"APDUClass\": \"\",\n \"APDUInstruction\": \"\",\n \"APDUPar1\": \"\",\n \"APDUPar2\": \"\",\n \"APDUData\": \"\",\n \"APDUExpectedLength\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cardreaderapdu') do |req|
req.body = "{\n \"APDUClass\": \"\",\n \"APDUInstruction\": \"\",\n \"APDUPar1\": \"\",\n \"APDUPar2\": \"\",\n \"APDUData\": \"\",\n \"APDUExpectedLength\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cardreaderapdu";
let payload = json!({
"APDUClass": "",
"APDUInstruction": "",
"APDUPar1": "",
"APDUPar2": "",
"APDUData": "",
"APDUExpectedLength": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cardreaderapdu \
--header 'content-type: application/json' \
--data '{
"APDUClass": "",
"APDUInstruction": "",
"APDUPar1": "",
"APDUPar2": "",
"APDUData": "",
"APDUExpectedLength": ""
}'
echo '{
"APDUClass": "",
"APDUInstruction": "",
"APDUPar1": "",
"APDUPar2": "",
"APDUData": "",
"APDUExpectedLength": ""
}' | \
http POST {{baseUrl}}/cardreaderapdu \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "APDUClass": "",\n "APDUInstruction": "",\n "APDUPar1": "",\n "APDUPar2": "",\n "APDUData": "",\n "APDUExpectedLength": ""\n}' \
--output-document \
- {{baseUrl}}/cardreaderapdu
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"APDUClass": "",
"APDUInstruction": "",
"APDUPar1": "",
"APDUPar2": "",
"APDUData": "",
"APDUExpectedLength": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cardreaderapdu")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Diagnosis Request
{{baseUrl}}/diagnosis
BODY json
{
"POIID": "",
"HostDiagnosisFlag": false,
"AcquirerID": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/diagnosis");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"POIID\": \"\",\n \"HostDiagnosisFlag\": false,\n \"AcquirerID\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/diagnosis" {:content-type :json
:form-params {:POIID ""
:HostDiagnosisFlag false
:AcquirerID []}})
require "http/client"
url = "{{baseUrl}}/diagnosis"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"POIID\": \"\",\n \"HostDiagnosisFlag\": false,\n \"AcquirerID\": []\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/diagnosis"),
Content = new StringContent("{\n \"POIID\": \"\",\n \"HostDiagnosisFlag\": false,\n \"AcquirerID\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/diagnosis");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"POIID\": \"\",\n \"HostDiagnosisFlag\": false,\n \"AcquirerID\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/diagnosis"
payload := strings.NewReader("{\n \"POIID\": \"\",\n \"HostDiagnosisFlag\": false,\n \"AcquirerID\": []\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(res)
fmt.Println(string(body))
}
POST /baseUrl/diagnosis HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 67
{
"POIID": "",
"HostDiagnosisFlag": false,
"AcquirerID": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/diagnosis")
.setHeader("content-type", "application/json")
.setBody("{\n \"POIID\": \"\",\n \"HostDiagnosisFlag\": false,\n \"AcquirerID\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/diagnosis"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"POIID\": \"\",\n \"HostDiagnosisFlag\": false,\n \"AcquirerID\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"POIID\": \"\",\n \"HostDiagnosisFlag\": false,\n \"AcquirerID\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/diagnosis")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/diagnosis")
.header("content-type", "application/json")
.body("{\n \"POIID\": \"\",\n \"HostDiagnosisFlag\": false,\n \"AcquirerID\": []\n}")
.asString();
const data = JSON.stringify({
POIID: '',
HostDiagnosisFlag: false,
AcquirerID: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/diagnosis');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/diagnosis',
headers: {'content-type': 'application/json'},
data: {POIID: '', HostDiagnosisFlag: false, AcquirerID: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/diagnosis';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"POIID":"","HostDiagnosisFlag":false,"AcquirerID":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/diagnosis',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "POIID": "",\n "HostDiagnosisFlag": false,\n "AcquirerID": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"POIID\": \"\",\n \"HostDiagnosisFlag\": false,\n \"AcquirerID\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/diagnosis")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/diagnosis',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({POIID: '', HostDiagnosisFlag: false, AcquirerID: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/diagnosis',
headers: {'content-type': 'application/json'},
body: {POIID: '', HostDiagnosisFlag: false, AcquirerID: []},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/diagnosis');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
POIID: '',
HostDiagnosisFlag: false,
AcquirerID: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/diagnosis',
headers: {'content-type': 'application/json'},
data: {POIID: '', HostDiagnosisFlag: false, AcquirerID: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/diagnosis';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"POIID":"","HostDiagnosisFlag":false,"AcquirerID":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"POIID": @"",
@"HostDiagnosisFlag": @NO,
@"AcquirerID": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/diagnosis"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/diagnosis" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"POIID\": \"\",\n \"HostDiagnosisFlag\": false,\n \"AcquirerID\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/diagnosis",
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([
'POIID' => '',
'HostDiagnosisFlag' => null,
'AcquirerID' => [
]
]),
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;
}
request('POST', '{{baseUrl}}/diagnosis', [
'body' => '{
"POIID": "",
"HostDiagnosisFlag": false,
"AcquirerID": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/diagnosis');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'POIID' => '',
'HostDiagnosisFlag' => null,
'AcquirerID' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'POIID' => '',
'HostDiagnosisFlag' => null,
'AcquirerID' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/diagnosis');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/diagnosis' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"POIID": "",
"HostDiagnosisFlag": false,
"AcquirerID": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/diagnosis' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"POIID": "",
"HostDiagnosisFlag": false,
"AcquirerID": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"POIID\": \"\",\n \"HostDiagnosisFlag\": false,\n \"AcquirerID\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/diagnosis", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/diagnosis"
payload = {
"POIID": "",
"HostDiagnosisFlag": False,
"AcquirerID": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/diagnosis"
payload <- "{\n \"POIID\": \"\",\n \"HostDiagnosisFlag\": false,\n \"AcquirerID\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/diagnosis")
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 \"POIID\": \"\",\n \"HostDiagnosisFlag\": false,\n \"AcquirerID\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/diagnosis') do |req|
req.body = "{\n \"POIID\": \"\",\n \"HostDiagnosisFlag\": false,\n \"AcquirerID\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/diagnosis";
let payload = json!({
"POIID": "",
"HostDiagnosisFlag": false,
"AcquirerID": ()
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/diagnosis \
--header 'content-type: application/json' \
--data '{
"POIID": "",
"HostDiagnosisFlag": false,
"AcquirerID": []
}'
echo '{
"POIID": "",
"HostDiagnosisFlag": false,
"AcquirerID": []
}' | \
http POST {{baseUrl}}/diagnosis \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "POIID": "",\n "HostDiagnosisFlag": false,\n "AcquirerID": []\n}' \
--output-document \
- {{baseUrl}}/diagnosis
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"POIID": "",
"HostDiagnosisFlag": false,
"AcquirerID": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/diagnosis")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Display Request
{{baseUrl}}/display
BODY json
{
"DisplayOutput": [
{
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/display");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DisplayOutput\": [\n {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/display" {:content-type :json
:form-params {:DisplayOutput [{:ResponseRequiredFlag false
:MinimumDisplayTime 0
:Device ""
:InfoQualify ""
:OutputContent {:OutputFormat ""
:PredefinedContent {:ReferenceID ""
:Language ""}
:OutputText [{:Text ""
:CharacterSet 0
:Font ""
:StartRow 0
:StartColumn 0
:Color ""
:CharacterWidth ""
:CharacterHeight ""
:CharacterStyle ""
:Alignment ""
:EndOfLineFlag false}]
:OutputXHTML ""
:OutputBarcode {:BarcodeType ""
:BarcodeValue ""}}
:MenuEntry [{:MenuEntryTag ""
:DefaultSelectedFlag false
:OutputFormat ""
:PredefinedContent {}
:OutputText [{}]
:OutputXHTML ""}]
:OutputSignature ""}]}})
require "http/client"
url = "{{baseUrl}}/display"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"DisplayOutput\": [\n {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/display"),
Content = new StringContent("{\n \"DisplayOutput\": [\n {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/display");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DisplayOutput\": [\n {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/display"
payload := strings.NewReader("{\n \"DisplayOutput\": [\n {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\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(res)
fmt.Println(string(body))
}
POST /baseUrl/display HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1115
{
"DisplayOutput": [
{
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/display")
.setHeader("content-type", "application/json")
.setBody("{\n \"DisplayOutput\": [\n {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/display"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DisplayOutput\": [\n {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DisplayOutput\": [\n {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/display")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/display")
.header("content-type", "application/json")
.body("{\n \"DisplayOutput\": [\n {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
DisplayOutput: [
{
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {
ReferenceID: '',
Language: ''
},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {
BarcodeType: '',
BarcodeValue: ''
}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [
{}
],
OutputXHTML: ''
}
],
OutputSignature: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/display');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/display',
headers: {'content-type': 'application/json'},
data: {
DisplayOutput: [
{
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [{}],
OutputXHTML: ''
}
],
OutputSignature: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/display';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"DisplayOutput":[{"ResponseRequiredFlag":false,"MinimumDisplayTime":0,"Device":"","InfoQualify":"","OutputContent":{"OutputFormat":"","PredefinedContent":{"ReferenceID":"","Language":""},"OutputText":[{"Text":"","CharacterSet":0,"Font":"","StartRow":0,"StartColumn":0,"Color":"","CharacterWidth":"","CharacterHeight":"","CharacterStyle":"","Alignment":"","EndOfLineFlag":false}],"OutputXHTML":"","OutputBarcode":{"BarcodeType":"","BarcodeValue":""}},"MenuEntry":[{"MenuEntryTag":"","DefaultSelectedFlag":false,"OutputFormat":"","PredefinedContent":{},"OutputText":[{}],"OutputXHTML":""}],"OutputSignature":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/display',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "DisplayOutput": [\n {\n "ResponseRequiredFlag": false,\n "MinimumDisplayTime": 0,\n "Device": "",\n "InfoQualify": "",\n "OutputContent": {\n "OutputFormat": "",\n "PredefinedContent": {\n "ReferenceID": "",\n "Language": ""\n },\n "OutputText": [\n {\n "Text": "",\n "CharacterSet": 0,\n "Font": "",\n "StartRow": 0,\n "StartColumn": 0,\n "Color": "",\n "CharacterWidth": "",\n "CharacterHeight": "",\n "CharacterStyle": "",\n "Alignment": "",\n "EndOfLineFlag": false\n }\n ],\n "OutputXHTML": "",\n "OutputBarcode": {\n "BarcodeType": "",\n "BarcodeValue": ""\n }\n },\n "MenuEntry": [\n {\n "MenuEntryTag": "",\n "DefaultSelectedFlag": false,\n "OutputFormat": "",\n "PredefinedContent": {},\n "OutputText": [\n {}\n ],\n "OutputXHTML": ""\n }\n ],\n "OutputSignature": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DisplayOutput\": [\n {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/display")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/display',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
DisplayOutput: [
{
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [{}],
OutputXHTML: ''
}
],
OutputSignature: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/display',
headers: {'content-type': 'application/json'},
body: {
DisplayOutput: [
{
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [{}],
OutputXHTML: ''
}
],
OutputSignature: ''
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/display');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
DisplayOutput: [
{
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {
ReferenceID: '',
Language: ''
},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {
BarcodeType: '',
BarcodeValue: ''
}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [
{}
],
OutputXHTML: ''
}
],
OutputSignature: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/display',
headers: {'content-type': 'application/json'},
data: {
DisplayOutput: [
{
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [{}],
OutputXHTML: ''
}
],
OutputSignature: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/display';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"DisplayOutput":[{"ResponseRequiredFlag":false,"MinimumDisplayTime":0,"Device":"","InfoQualify":"","OutputContent":{"OutputFormat":"","PredefinedContent":{"ReferenceID":"","Language":""},"OutputText":[{"Text":"","CharacterSet":0,"Font":"","StartRow":0,"StartColumn":0,"Color":"","CharacterWidth":"","CharacterHeight":"","CharacterStyle":"","Alignment":"","EndOfLineFlag":false}],"OutputXHTML":"","OutputBarcode":{"BarcodeType":"","BarcodeValue":""}},"MenuEntry":[{"MenuEntryTag":"","DefaultSelectedFlag":false,"OutputFormat":"","PredefinedContent":{},"OutputText":[{}],"OutputXHTML":""}],"OutputSignature":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DisplayOutput": @[ @{ @"ResponseRequiredFlag": @NO, @"MinimumDisplayTime": @0, @"Device": @"", @"InfoQualify": @"", @"OutputContent": @{ @"OutputFormat": @"", @"PredefinedContent": @{ @"ReferenceID": @"", @"Language": @"" }, @"OutputText": @[ @{ @"Text": @"", @"CharacterSet": @0, @"Font": @"", @"StartRow": @0, @"StartColumn": @0, @"Color": @"", @"CharacterWidth": @"", @"CharacterHeight": @"", @"CharacterStyle": @"", @"Alignment": @"", @"EndOfLineFlag": @NO } ], @"OutputXHTML": @"", @"OutputBarcode": @{ @"BarcodeType": @"", @"BarcodeValue": @"" } }, @"MenuEntry": @[ @{ @"MenuEntryTag": @"", @"DefaultSelectedFlag": @NO, @"OutputFormat": @"", @"PredefinedContent": @{ }, @"OutputText": @[ @{ } ], @"OutputXHTML": @"" } ], @"OutputSignature": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/display"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/display" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"DisplayOutput\": [\n {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/display",
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([
'DisplayOutput' => [
[
'ResponseRequiredFlag' => null,
'MinimumDisplayTime' => 0,
'Device' => '',
'InfoQualify' => '',
'OutputContent' => [
'OutputFormat' => '',
'PredefinedContent' => [
'ReferenceID' => '',
'Language' => ''
],
'OutputText' => [
[
'Text' => '',
'CharacterSet' => 0,
'Font' => '',
'StartRow' => 0,
'StartColumn' => 0,
'Color' => '',
'CharacterWidth' => '',
'CharacterHeight' => '',
'CharacterStyle' => '',
'Alignment' => '',
'EndOfLineFlag' => null
]
],
'OutputXHTML' => '',
'OutputBarcode' => [
'BarcodeType' => '',
'BarcodeValue' => ''
]
],
'MenuEntry' => [
[
'MenuEntryTag' => '',
'DefaultSelectedFlag' => null,
'OutputFormat' => '',
'PredefinedContent' => [
],
'OutputText' => [
[
]
],
'OutputXHTML' => ''
]
],
'OutputSignature' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/display', [
'body' => '{
"DisplayOutput": [
{
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/display');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DisplayOutput' => [
[
'ResponseRequiredFlag' => null,
'MinimumDisplayTime' => 0,
'Device' => '',
'InfoQualify' => '',
'OutputContent' => [
'OutputFormat' => '',
'PredefinedContent' => [
'ReferenceID' => '',
'Language' => ''
],
'OutputText' => [
[
'Text' => '',
'CharacterSet' => 0,
'Font' => '',
'StartRow' => 0,
'StartColumn' => 0,
'Color' => '',
'CharacterWidth' => '',
'CharacterHeight' => '',
'CharacterStyle' => '',
'Alignment' => '',
'EndOfLineFlag' => null
]
],
'OutputXHTML' => '',
'OutputBarcode' => [
'BarcodeType' => '',
'BarcodeValue' => ''
]
],
'MenuEntry' => [
[
'MenuEntryTag' => '',
'DefaultSelectedFlag' => null,
'OutputFormat' => '',
'PredefinedContent' => [
],
'OutputText' => [
[
]
],
'OutputXHTML' => ''
]
],
'OutputSignature' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DisplayOutput' => [
[
'ResponseRequiredFlag' => null,
'MinimumDisplayTime' => 0,
'Device' => '',
'InfoQualify' => '',
'OutputContent' => [
'OutputFormat' => '',
'PredefinedContent' => [
'ReferenceID' => '',
'Language' => ''
],
'OutputText' => [
[
'Text' => '',
'CharacterSet' => 0,
'Font' => '',
'StartRow' => 0,
'StartColumn' => 0,
'Color' => '',
'CharacterWidth' => '',
'CharacterHeight' => '',
'CharacterStyle' => '',
'Alignment' => '',
'EndOfLineFlag' => null
]
],
'OutputXHTML' => '',
'OutputBarcode' => [
'BarcodeType' => '',
'BarcodeValue' => ''
]
],
'MenuEntry' => [
[
'MenuEntryTag' => '',
'DefaultSelectedFlag' => null,
'OutputFormat' => '',
'PredefinedContent' => [
],
'OutputText' => [
[
]
],
'OutputXHTML' => ''
]
],
'OutputSignature' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/display');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/display' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DisplayOutput": [
{
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/display' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DisplayOutput": [
{
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DisplayOutput\": [\n {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/display", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/display"
payload = { "DisplayOutput": [
{
"ResponseRequiredFlag": False,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": False
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": False,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [{}],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/display"
payload <- "{\n \"DisplayOutput\": [\n {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/display")
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 \"DisplayOutput\": [\n {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/display') do |req|
req.body = "{\n \"DisplayOutput\": [\n {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/display";
let payload = json!({"DisplayOutput": (
json!({
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": json!({
"OutputFormat": "",
"PredefinedContent": json!({
"ReferenceID": "",
"Language": ""
}),
"OutputText": (
json!({
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
})
),
"OutputXHTML": "",
"OutputBarcode": json!({
"BarcodeType": "",
"BarcodeValue": ""
})
}),
"MenuEntry": (
json!({
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": json!({}),
"OutputText": (json!({})),
"OutputXHTML": ""
})
),
"OutputSignature": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/display \
--header 'content-type: application/json' \
--data '{
"DisplayOutput": [
{
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
]
}'
echo '{
"DisplayOutput": [
{
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
]
}' | \
http POST {{baseUrl}}/display \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "DisplayOutput": [\n {\n "ResponseRequiredFlag": false,\n "MinimumDisplayTime": 0,\n "Device": "",\n "InfoQualify": "",\n "OutputContent": {\n "OutputFormat": "",\n "PredefinedContent": {\n "ReferenceID": "",\n "Language": ""\n },\n "OutputText": [\n {\n "Text": "",\n "CharacterSet": 0,\n "Font": "",\n "StartRow": 0,\n "StartColumn": 0,\n "Color": "",\n "CharacterWidth": "",\n "CharacterHeight": "",\n "CharacterStyle": "",\n "Alignment": "",\n "EndOfLineFlag": false\n }\n ],\n "OutputXHTML": "",\n "OutputBarcode": {\n "BarcodeType": "",\n "BarcodeValue": ""\n }\n },\n "MenuEntry": [\n {\n "MenuEntryTag": "",\n "DefaultSelectedFlag": false,\n "OutputFormat": "",\n "PredefinedContent": {},\n "OutputText": [\n {}\n ],\n "OutputXHTML": ""\n }\n ],\n "OutputSignature": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/display
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["DisplayOutput": [
[
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": [
"OutputFormat": "",
"PredefinedContent": [
"ReferenceID": "",
"Language": ""
],
"OutputText": [
[
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
]
],
"OutputXHTML": "",
"OutputBarcode": [
"BarcodeType": "",
"BarcodeValue": ""
]
],
"MenuEntry": [
[
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": [],
"OutputText": [[]],
"OutputXHTML": ""
]
],
"OutputSignature": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/display")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
EnableService Request
{{baseUrl}}/enableservice
BODY json
{
"TransactionAction": "",
"ServicesEnabled": [],
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/enableservice");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"TransactionAction\": \"\",\n \"ServicesEnabled\": [],\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/enableservice" {:content-type :json
:form-params {:TransactionAction ""
:ServicesEnabled []
:DisplayOutput {:ResponseRequiredFlag false
:MinimumDisplayTime 0
:Device ""
:InfoQualify ""
:OutputContent {:OutputFormat ""
:PredefinedContent {:ReferenceID ""
:Language ""}
:OutputText [{:Text ""
:CharacterSet 0
:Font ""
:StartRow 0
:StartColumn 0
:Color ""
:CharacterWidth ""
:CharacterHeight ""
:CharacterStyle ""
:Alignment ""
:EndOfLineFlag false}]
:OutputXHTML ""
:OutputBarcode {:BarcodeType ""
:BarcodeValue ""}}
:MenuEntry [{:MenuEntryTag ""
:DefaultSelectedFlag false
:OutputFormat ""
:PredefinedContent {}
:OutputText [{}]
:OutputXHTML ""}]
:OutputSignature ""}}})
require "http/client"
url = "{{baseUrl}}/enableservice"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"TransactionAction\": \"\",\n \"ServicesEnabled\": [],\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/enableservice"),
Content = new StringContent("{\n \"TransactionAction\": \"\",\n \"ServicesEnabled\": [],\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/enableservice");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"TransactionAction\": \"\",\n \"ServicesEnabled\": [],\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/enableservice"
payload := strings.NewReader("{\n \"TransactionAction\": \"\",\n \"ServicesEnabled\": [],\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/enableservice HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1067
{
"TransactionAction": "",
"ServicesEnabled": [],
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/enableservice")
.setHeader("content-type", "application/json")
.setBody("{\n \"TransactionAction\": \"\",\n \"ServicesEnabled\": [],\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/enableservice"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"TransactionAction\": \"\",\n \"ServicesEnabled\": [],\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"TransactionAction\": \"\",\n \"ServicesEnabled\": [],\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/enableservice")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/enableservice")
.header("content-type", "application/json")
.body("{\n \"TransactionAction\": \"\",\n \"ServicesEnabled\": [],\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
TransactionAction: '',
ServicesEnabled: [],
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {
ReferenceID: '',
Language: ''
},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {
BarcodeType: '',
BarcodeValue: ''
}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [
{}
],
OutputXHTML: ''
}
],
OutputSignature: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/enableservice');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/enableservice',
headers: {'content-type': 'application/json'},
data: {
TransactionAction: '',
ServicesEnabled: [],
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [{}],
OutputXHTML: ''
}
],
OutputSignature: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/enableservice';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"TransactionAction":"","ServicesEnabled":[],"DisplayOutput":{"ResponseRequiredFlag":false,"MinimumDisplayTime":0,"Device":"","InfoQualify":"","OutputContent":{"OutputFormat":"","PredefinedContent":{"ReferenceID":"","Language":""},"OutputText":[{"Text":"","CharacterSet":0,"Font":"","StartRow":0,"StartColumn":0,"Color":"","CharacterWidth":"","CharacterHeight":"","CharacterStyle":"","Alignment":"","EndOfLineFlag":false}],"OutputXHTML":"","OutputBarcode":{"BarcodeType":"","BarcodeValue":""}},"MenuEntry":[{"MenuEntryTag":"","DefaultSelectedFlag":false,"OutputFormat":"","PredefinedContent":{},"OutputText":[{}],"OutputXHTML":""}],"OutputSignature":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/enableservice',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "TransactionAction": "",\n "ServicesEnabled": [],\n "DisplayOutput": {\n "ResponseRequiredFlag": false,\n "MinimumDisplayTime": 0,\n "Device": "",\n "InfoQualify": "",\n "OutputContent": {\n "OutputFormat": "",\n "PredefinedContent": {\n "ReferenceID": "",\n "Language": ""\n },\n "OutputText": [\n {\n "Text": "",\n "CharacterSet": 0,\n "Font": "",\n "StartRow": 0,\n "StartColumn": 0,\n "Color": "",\n "CharacterWidth": "",\n "CharacterHeight": "",\n "CharacterStyle": "",\n "Alignment": "",\n "EndOfLineFlag": false\n }\n ],\n "OutputXHTML": "",\n "OutputBarcode": {\n "BarcodeType": "",\n "BarcodeValue": ""\n }\n },\n "MenuEntry": [\n {\n "MenuEntryTag": "",\n "DefaultSelectedFlag": false,\n "OutputFormat": "",\n "PredefinedContent": {},\n "OutputText": [\n {}\n ],\n "OutputXHTML": ""\n }\n ],\n "OutputSignature": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"TransactionAction\": \"\",\n \"ServicesEnabled\": [],\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/enableservice")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/enableservice',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
TransactionAction: '',
ServicesEnabled: [],
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [{}],
OutputXHTML: ''
}
],
OutputSignature: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/enableservice',
headers: {'content-type': 'application/json'},
body: {
TransactionAction: '',
ServicesEnabled: [],
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [{}],
OutputXHTML: ''
}
],
OutputSignature: ''
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/enableservice');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
TransactionAction: '',
ServicesEnabled: [],
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {
ReferenceID: '',
Language: ''
},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {
BarcodeType: '',
BarcodeValue: ''
}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [
{}
],
OutputXHTML: ''
}
],
OutputSignature: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/enableservice',
headers: {'content-type': 'application/json'},
data: {
TransactionAction: '',
ServicesEnabled: [],
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [{}],
OutputXHTML: ''
}
],
OutputSignature: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/enableservice';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"TransactionAction":"","ServicesEnabled":[],"DisplayOutput":{"ResponseRequiredFlag":false,"MinimumDisplayTime":0,"Device":"","InfoQualify":"","OutputContent":{"OutputFormat":"","PredefinedContent":{"ReferenceID":"","Language":""},"OutputText":[{"Text":"","CharacterSet":0,"Font":"","StartRow":0,"StartColumn":0,"Color":"","CharacterWidth":"","CharacterHeight":"","CharacterStyle":"","Alignment":"","EndOfLineFlag":false}],"OutputXHTML":"","OutputBarcode":{"BarcodeType":"","BarcodeValue":""}},"MenuEntry":[{"MenuEntryTag":"","DefaultSelectedFlag":false,"OutputFormat":"","PredefinedContent":{},"OutputText":[{}],"OutputXHTML":""}],"OutputSignature":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"TransactionAction": @"",
@"ServicesEnabled": @[ ],
@"DisplayOutput": @{ @"ResponseRequiredFlag": @NO, @"MinimumDisplayTime": @0, @"Device": @"", @"InfoQualify": @"", @"OutputContent": @{ @"OutputFormat": @"", @"PredefinedContent": @{ @"ReferenceID": @"", @"Language": @"" }, @"OutputText": @[ @{ @"Text": @"", @"CharacterSet": @0, @"Font": @"", @"StartRow": @0, @"StartColumn": @0, @"Color": @"", @"CharacterWidth": @"", @"CharacterHeight": @"", @"CharacterStyle": @"", @"Alignment": @"", @"EndOfLineFlag": @NO } ], @"OutputXHTML": @"", @"OutputBarcode": @{ @"BarcodeType": @"", @"BarcodeValue": @"" } }, @"MenuEntry": @[ @{ @"MenuEntryTag": @"", @"DefaultSelectedFlag": @NO, @"OutputFormat": @"", @"PredefinedContent": @{ }, @"OutputText": @[ @{ } ], @"OutputXHTML": @"" } ], @"OutputSignature": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/enableservice"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/enableservice" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"TransactionAction\": \"\",\n \"ServicesEnabled\": [],\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/enableservice",
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([
'TransactionAction' => '',
'ServicesEnabled' => [
],
'DisplayOutput' => [
'ResponseRequiredFlag' => null,
'MinimumDisplayTime' => 0,
'Device' => '',
'InfoQualify' => '',
'OutputContent' => [
'OutputFormat' => '',
'PredefinedContent' => [
'ReferenceID' => '',
'Language' => ''
],
'OutputText' => [
[
'Text' => '',
'CharacterSet' => 0,
'Font' => '',
'StartRow' => 0,
'StartColumn' => 0,
'Color' => '',
'CharacterWidth' => '',
'CharacterHeight' => '',
'CharacterStyle' => '',
'Alignment' => '',
'EndOfLineFlag' => null
]
],
'OutputXHTML' => '',
'OutputBarcode' => [
'BarcodeType' => '',
'BarcodeValue' => ''
]
],
'MenuEntry' => [
[
'MenuEntryTag' => '',
'DefaultSelectedFlag' => null,
'OutputFormat' => '',
'PredefinedContent' => [
],
'OutputText' => [
[
]
],
'OutputXHTML' => ''
]
],
'OutputSignature' => ''
]
]),
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;
}
request('POST', '{{baseUrl}}/enableservice', [
'body' => '{
"TransactionAction": "",
"ServicesEnabled": [],
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/enableservice');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'TransactionAction' => '',
'ServicesEnabled' => [
],
'DisplayOutput' => [
'ResponseRequiredFlag' => null,
'MinimumDisplayTime' => 0,
'Device' => '',
'InfoQualify' => '',
'OutputContent' => [
'OutputFormat' => '',
'PredefinedContent' => [
'ReferenceID' => '',
'Language' => ''
],
'OutputText' => [
[
'Text' => '',
'CharacterSet' => 0,
'Font' => '',
'StartRow' => 0,
'StartColumn' => 0,
'Color' => '',
'CharacterWidth' => '',
'CharacterHeight' => '',
'CharacterStyle' => '',
'Alignment' => '',
'EndOfLineFlag' => null
]
],
'OutputXHTML' => '',
'OutputBarcode' => [
'BarcodeType' => '',
'BarcodeValue' => ''
]
],
'MenuEntry' => [
[
'MenuEntryTag' => '',
'DefaultSelectedFlag' => null,
'OutputFormat' => '',
'PredefinedContent' => [
],
'OutputText' => [
[
]
],
'OutputXHTML' => ''
]
],
'OutputSignature' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'TransactionAction' => '',
'ServicesEnabled' => [
],
'DisplayOutput' => [
'ResponseRequiredFlag' => null,
'MinimumDisplayTime' => 0,
'Device' => '',
'InfoQualify' => '',
'OutputContent' => [
'OutputFormat' => '',
'PredefinedContent' => [
'ReferenceID' => '',
'Language' => ''
],
'OutputText' => [
[
'Text' => '',
'CharacterSet' => 0,
'Font' => '',
'StartRow' => 0,
'StartColumn' => 0,
'Color' => '',
'CharacterWidth' => '',
'CharacterHeight' => '',
'CharacterStyle' => '',
'Alignment' => '',
'EndOfLineFlag' => null
]
],
'OutputXHTML' => '',
'OutputBarcode' => [
'BarcodeType' => '',
'BarcodeValue' => ''
]
],
'MenuEntry' => [
[
'MenuEntryTag' => '',
'DefaultSelectedFlag' => null,
'OutputFormat' => '',
'PredefinedContent' => [
],
'OutputText' => [
[
]
],
'OutputXHTML' => ''
]
],
'OutputSignature' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/enableservice');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/enableservice' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TransactionAction": "",
"ServicesEnabled": [],
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/enableservice' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TransactionAction": "",
"ServicesEnabled": [],
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"TransactionAction\": \"\",\n \"ServicesEnabled\": [],\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/enableservice", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/enableservice"
payload = {
"TransactionAction": "",
"ServicesEnabled": [],
"DisplayOutput": {
"ResponseRequiredFlag": False,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": False
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": False,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [{}],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/enableservice"
payload <- "{\n \"TransactionAction\": \"\",\n \"ServicesEnabled\": [],\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/enableservice")
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 \"TransactionAction\": \"\",\n \"ServicesEnabled\": [],\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/enableservice') do |req|
req.body = "{\n \"TransactionAction\": \"\",\n \"ServicesEnabled\": [],\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/enableservice";
let payload = json!({
"TransactionAction": "",
"ServicesEnabled": (),
"DisplayOutput": json!({
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": json!({
"OutputFormat": "",
"PredefinedContent": json!({
"ReferenceID": "",
"Language": ""
}),
"OutputText": (
json!({
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
})
),
"OutputXHTML": "",
"OutputBarcode": json!({
"BarcodeType": "",
"BarcodeValue": ""
})
}),
"MenuEntry": (
json!({
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": json!({}),
"OutputText": (json!({})),
"OutputXHTML": ""
})
),
"OutputSignature": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/enableservice \
--header 'content-type: application/json' \
--data '{
"TransactionAction": "",
"ServicesEnabled": [],
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
}'
echo '{
"TransactionAction": "",
"ServicesEnabled": [],
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
}
}' | \
http POST {{baseUrl}}/enableservice \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "TransactionAction": "",\n "ServicesEnabled": [],\n "DisplayOutput": {\n "ResponseRequiredFlag": false,\n "MinimumDisplayTime": 0,\n "Device": "",\n "InfoQualify": "",\n "OutputContent": {\n "OutputFormat": "",\n "PredefinedContent": {\n "ReferenceID": "",\n "Language": ""\n },\n "OutputText": [\n {\n "Text": "",\n "CharacterSet": 0,\n "Font": "",\n "StartRow": 0,\n "StartColumn": 0,\n "Color": "",\n "CharacterWidth": "",\n "CharacterHeight": "",\n "CharacterStyle": "",\n "Alignment": "",\n "EndOfLineFlag": false\n }\n ],\n "OutputXHTML": "",\n "OutputBarcode": {\n "BarcodeType": "",\n "BarcodeValue": ""\n }\n },\n "MenuEntry": [\n {\n "MenuEntryTag": "",\n "DefaultSelectedFlag": false,\n "OutputFormat": "",\n "PredefinedContent": {},\n "OutputText": [\n {}\n ],\n "OutputXHTML": ""\n }\n ],\n "OutputSignature": ""\n }\n}' \
--output-document \
- {{baseUrl}}/enableservice
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"TransactionAction": "",
"ServicesEnabled": [],
"DisplayOutput": [
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": [
"OutputFormat": "",
"PredefinedContent": [
"ReferenceID": "",
"Language": ""
],
"OutputText": [
[
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
]
],
"OutputXHTML": "",
"OutputBarcode": [
"BarcodeType": "",
"BarcodeValue": ""
]
],
"MenuEntry": [
[
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": [],
"OutputText": [[]],
"OutputXHTML": ""
]
],
"OutputSignature": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/enableservice")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
GetTotals Request
{{baseUrl}}/gettotals
BODY json
{
"TotalDetails": [],
"TotalFilter": {
"POIID": "",
"SaleID": "",
"OperatorID": "",
"ShiftNumber": "",
"TotalsGroupID": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/gettotals");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"TotalDetails\": [],\n \"TotalFilter\": {\n \"POIID\": \"\",\n \"SaleID\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TotalsGroupID\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/gettotals" {:content-type :json
:form-params {:TotalDetails []
:TotalFilter {:POIID ""
:SaleID ""
:OperatorID ""
:ShiftNumber ""
:TotalsGroupID ""}}})
require "http/client"
url = "{{baseUrl}}/gettotals"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"TotalDetails\": [],\n \"TotalFilter\": {\n \"POIID\": \"\",\n \"SaleID\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TotalsGroupID\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/gettotals"),
Content = new StringContent("{\n \"TotalDetails\": [],\n \"TotalFilter\": {\n \"POIID\": \"\",\n \"SaleID\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TotalsGroupID\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/gettotals");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"TotalDetails\": [],\n \"TotalFilter\": {\n \"POIID\": \"\",\n \"SaleID\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TotalsGroupID\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/gettotals"
payload := strings.NewReader("{\n \"TotalDetails\": [],\n \"TotalFilter\": {\n \"POIID\": \"\",\n \"SaleID\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TotalsGroupID\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/gettotals HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 152
{
"TotalDetails": [],
"TotalFilter": {
"POIID": "",
"SaleID": "",
"OperatorID": "",
"ShiftNumber": "",
"TotalsGroupID": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/gettotals")
.setHeader("content-type", "application/json")
.setBody("{\n \"TotalDetails\": [],\n \"TotalFilter\": {\n \"POIID\": \"\",\n \"SaleID\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TotalsGroupID\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/gettotals"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"TotalDetails\": [],\n \"TotalFilter\": {\n \"POIID\": \"\",\n \"SaleID\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TotalsGroupID\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"TotalDetails\": [],\n \"TotalFilter\": {\n \"POIID\": \"\",\n \"SaleID\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TotalsGroupID\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/gettotals")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/gettotals")
.header("content-type", "application/json")
.body("{\n \"TotalDetails\": [],\n \"TotalFilter\": {\n \"POIID\": \"\",\n \"SaleID\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TotalsGroupID\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
TotalDetails: [],
TotalFilter: {
POIID: '',
SaleID: '',
OperatorID: '',
ShiftNumber: '',
TotalsGroupID: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/gettotals');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/gettotals',
headers: {'content-type': 'application/json'},
data: {
TotalDetails: [],
TotalFilter: {POIID: '', SaleID: '', OperatorID: '', ShiftNumber: '', TotalsGroupID: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/gettotals';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"TotalDetails":[],"TotalFilter":{"POIID":"","SaleID":"","OperatorID":"","ShiftNumber":"","TotalsGroupID":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/gettotals',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "TotalDetails": [],\n "TotalFilter": {\n "POIID": "",\n "SaleID": "",\n "OperatorID": "",\n "ShiftNumber": "",\n "TotalsGroupID": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"TotalDetails\": [],\n \"TotalFilter\": {\n \"POIID\": \"\",\n \"SaleID\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TotalsGroupID\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/gettotals")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/gettotals',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
TotalDetails: [],
TotalFilter: {POIID: '', SaleID: '', OperatorID: '', ShiftNumber: '', TotalsGroupID: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/gettotals',
headers: {'content-type': 'application/json'},
body: {
TotalDetails: [],
TotalFilter: {POIID: '', SaleID: '', OperatorID: '', ShiftNumber: '', TotalsGroupID: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/gettotals');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
TotalDetails: [],
TotalFilter: {
POIID: '',
SaleID: '',
OperatorID: '',
ShiftNumber: '',
TotalsGroupID: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/gettotals',
headers: {'content-type': 'application/json'},
data: {
TotalDetails: [],
TotalFilter: {POIID: '', SaleID: '', OperatorID: '', ShiftNumber: '', TotalsGroupID: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/gettotals';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"TotalDetails":[],"TotalFilter":{"POIID":"","SaleID":"","OperatorID":"","ShiftNumber":"","TotalsGroupID":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"TotalDetails": @[ ],
@"TotalFilter": @{ @"POIID": @"", @"SaleID": @"", @"OperatorID": @"", @"ShiftNumber": @"", @"TotalsGroupID": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/gettotals"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/gettotals" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"TotalDetails\": [],\n \"TotalFilter\": {\n \"POIID\": \"\",\n \"SaleID\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TotalsGroupID\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/gettotals",
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([
'TotalDetails' => [
],
'TotalFilter' => [
'POIID' => '',
'SaleID' => '',
'OperatorID' => '',
'ShiftNumber' => '',
'TotalsGroupID' => ''
]
]),
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;
}
request('POST', '{{baseUrl}}/gettotals', [
'body' => '{
"TotalDetails": [],
"TotalFilter": {
"POIID": "",
"SaleID": "",
"OperatorID": "",
"ShiftNumber": "",
"TotalsGroupID": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/gettotals');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'TotalDetails' => [
],
'TotalFilter' => [
'POIID' => '',
'SaleID' => '',
'OperatorID' => '',
'ShiftNumber' => '',
'TotalsGroupID' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'TotalDetails' => [
],
'TotalFilter' => [
'POIID' => '',
'SaleID' => '',
'OperatorID' => '',
'ShiftNumber' => '',
'TotalsGroupID' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/gettotals');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/gettotals' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TotalDetails": [],
"TotalFilter": {
"POIID": "",
"SaleID": "",
"OperatorID": "",
"ShiftNumber": "",
"TotalsGroupID": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/gettotals' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TotalDetails": [],
"TotalFilter": {
"POIID": "",
"SaleID": "",
"OperatorID": "",
"ShiftNumber": "",
"TotalsGroupID": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"TotalDetails\": [],\n \"TotalFilter\": {\n \"POIID\": \"\",\n \"SaleID\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TotalsGroupID\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/gettotals", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/gettotals"
payload = {
"TotalDetails": [],
"TotalFilter": {
"POIID": "",
"SaleID": "",
"OperatorID": "",
"ShiftNumber": "",
"TotalsGroupID": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/gettotals"
payload <- "{\n \"TotalDetails\": [],\n \"TotalFilter\": {\n \"POIID\": \"\",\n \"SaleID\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TotalsGroupID\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/gettotals")
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 \"TotalDetails\": [],\n \"TotalFilter\": {\n \"POIID\": \"\",\n \"SaleID\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TotalsGroupID\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/gettotals') do |req|
req.body = "{\n \"TotalDetails\": [],\n \"TotalFilter\": {\n \"POIID\": \"\",\n \"SaleID\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TotalsGroupID\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/gettotals";
let payload = json!({
"TotalDetails": (),
"TotalFilter": json!({
"POIID": "",
"SaleID": "",
"OperatorID": "",
"ShiftNumber": "",
"TotalsGroupID": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/gettotals \
--header 'content-type: application/json' \
--data '{
"TotalDetails": [],
"TotalFilter": {
"POIID": "",
"SaleID": "",
"OperatorID": "",
"ShiftNumber": "",
"TotalsGroupID": ""
}
}'
echo '{
"TotalDetails": [],
"TotalFilter": {
"POIID": "",
"SaleID": "",
"OperatorID": "",
"ShiftNumber": "",
"TotalsGroupID": ""
}
}' | \
http POST {{baseUrl}}/gettotals \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "TotalDetails": [],\n "TotalFilter": {\n "POIID": "",\n "SaleID": "",\n "OperatorID": "",\n "ShiftNumber": "",\n "TotalsGroupID": ""\n }\n}' \
--output-document \
- {{baseUrl}}/gettotals
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"TotalDetails": [],
"TotalFilter": [
"POIID": "",
"SaleID": "",
"OperatorID": "",
"ShiftNumber": "",
"TotalsGroupID": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/gettotals")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Input Request
{{baseUrl}}/input
BODY json
{
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
},
"InputData": {
"Device": "",
"InfoQualify": "",
"InputCommand": "",
"NotifyCardInputFlag": false,
"MaxInputTime": 0,
"ImmediateResponseFlag": false,
"MinLength": 0,
"MaxLength": 0,
"MaxDecimalLength": 0,
"WaitUserValidationFlag": false,
"DefaultInputString": "",
"DefaultLayoutString": "",
"StringMask": "",
"FromRightToLeftFlag": false,
"MaskCharactersFlag": false,
"BeepKeyFlag": false,
"GlobalCorrectionFlag": false,
"DisableCancelFlag": false,
"DisableCorrectFlag": false,
"DisableValidFlag": false,
"MenuBackFlag": false
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/input");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n },\n \"InputData\": {\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"InputCommand\": \"\",\n \"NotifyCardInputFlag\": false,\n \"MaxInputTime\": 0,\n \"ImmediateResponseFlag\": false,\n \"MinLength\": 0,\n \"MaxLength\": 0,\n \"MaxDecimalLength\": 0,\n \"WaitUserValidationFlag\": false,\n \"DefaultInputString\": \"\",\n \"DefaultLayoutString\": \"\",\n \"StringMask\": \"\",\n \"FromRightToLeftFlag\": false,\n \"MaskCharactersFlag\": false,\n \"BeepKeyFlag\": false,\n \"GlobalCorrectionFlag\": false,\n \"DisableCancelFlag\": false,\n \"DisableCorrectFlag\": false,\n \"DisableValidFlag\": false,\n \"MenuBackFlag\": false\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/input" {:content-type :json
:form-params {:DisplayOutput {:ResponseRequiredFlag false
:MinimumDisplayTime 0
:Device ""
:InfoQualify ""
:OutputContent {:OutputFormat ""
:PredefinedContent {:ReferenceID ""
:Language ""}
:OutputText [{:Text ""
:CharacterSet 0
:Font ""
:StartRow 0
:StartColumn 0
:Color ""
:CharacterWidth ""
:CharacterHeight ""
:CharacterStyle ""
:Alignment ""
:EndOfLineFlag false}]
:OutputXHTML ""
:OutputBarcode {:BarcodeType ""
:BarcodeValue ""}}
:MenuEntry [{:MenuEntryTag ""
:DefaultSelectedFlag false
:OutputFormat ""
:PredefinedContent {}
:OutputText [{}]
:OutputXHTML ""}]
:OutputSignature ""}
:InputData {:Device ""
:InfoQualify ""
:InputCommand ""
:NotifyCardInputFlag false
:MaxInputTime 0
:ImmediateResponseFlag false
:MinLength 0
:MaxLength 0
:MaxDecimalLength 0
:WaitUserValidationFlag false
:DefaultInputString ""
:DefaultLayoutString ""
:StringMask ""
:FromRightToLeftFlag false
:MaskCharactersFlag false
:BeepKeyFlag false
:GlobalCorrectionFlag false
:DisableCancelFlag false
:DisableCorrectFlag false
:DisableValidFlag false
:MenuBackFlag false}}})
require "http/client"
url = "{{baseUrl}}/input"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n },\n \"InputData\": {\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"InputCommand\": \"\",\n \"NotifyCardInputFlag\": false,\n \"MaxInputTime\": 0,\n \"ImmediateResponseFlag\": false,\n \"MinLength\": 0,\n \"MaxLength\": 0,\n \"MaxDecimalLength\": 0,\n \"WaitUserValidationFlag\": false,\n \"DefaultInputString\": \"\",\n \"DefaultLayoutString\": \"\",\n \"StringMask\": \"\",\n \"FromRightToLeftFlag\": false,\n \"MaskCharactersFlag\": false,\n \"BeepKeyFlag\": false,\n \"GlobalCorrectionFlag\": false,\n \"DisableCancelFlag\": false,\n \"DisableCorrectFlag\": false,\n \"DisableValidFlag\": false,\n \"MenuBackFlag\": false\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/input"),
Content = new StringContent("{\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n },\n \"InputData\": {\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"InputCommand\": \"\",\n \"NotifyCardInputFlag\": false,\n \"MaxInputTime\": 0,\n \"ImmediateResponseFlag\": false,\n \"MinLength\": 0,\n \"MaxLength\": 0,\n \"MaxDecimalLength\": 0,\n \"WaitUserValidationFlag\": false,\n \"DefaultInputString\": \"\",\n \"DefaultLayoutString\": \"\",\n \"StringMask\": \"\",\n \"FromRightToLeftFlag\": false,\n \"MaskCharactersFlag\": false,\n \"BeepKeyFlag\": false,\n \"GlobalCorrectionFlag\": false,\n \"DisableCancelFlag\": false,\n \"DisableCorrectFlag\": false,\n \"DisableValidFlag\": false,\n \"MenuBackFlag\": false\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/input");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n },\n \"InputData\": {\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"InputCommand\": \"\",\n \"NotifyCardInputFlag\": false,\n \"MaxInputTime\": 0,\n \"ImmediateResponseFlag\": false,\n \"MinLength\": 0,\n \"MaxLength\": 0,\n \"MaxDecimalLength\": 0,\n \"WaitUserValidationFlag\": false,\n \"DefaultInputString\": \"\",\n \"DefaultLayoutString\": \"\",\n \"StringMask\": \"\",\n \"FromRightToLeftFlag\": false,\n \"MaskCharactersFlag\": false,\n \"BeepKeyFlag\": false,\n \"GlobalCorrectionFlag\": false,\n \"DisableCancelFlag\": false,\n \"DisableCorrectFlag\": false,\n \"DisableValidFlag\": false,\n \"MenuBackFlag\": false\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/input"
payload := strings.NewReader("{\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n },\n \"InputData\": {\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"InputCommand\": \"\",\n \"NotifyCardInputFlag\": false,\n \"MaxInputTime\": 0,\n \"ImmediateResponseFlag\": false,\n \"MinLength\": 0,\n \"MaxLength\": 0,\n \"MaxDecimalLength\": 0,\n \"WaitUserValidationFlag\": false,\n \"DefaultInputString\": \"\",\n \"DefaultLayoutString\": \"\",\n \"StringMask\": \"\",\n \"FromRightToLeftFlag\": false,\n \"MaskCharactersFlag\": false,\n \"BeepKeyFlag\": false,\n \"GlobalCorrectionFlag\": false,\n \"DisableCancelFlag\": false,\n \"DisableCorrectFlag\": false,\n \"DisableValidFlag\": false,\n \"MenuBackFlag\": false\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(res)
fmt.Println(string(body))
}
POST /baseUrl/input HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1632
{
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
},
"InputData": {
"Device": "",
"InfoQualify": "",
"InputCommand": "",
"NotifyCardInputFlag": false,
"MaxInputTime": 0,
"ImmediateResponseFlag": false,
"MinLength": 0,
"MaxLength": 0,
"MaxDecimalLength": 0,
"WaitUserValidationFlag": false,
"DefaultInputString": "",
"DefaultLayoutString": "",
"StringMask": "",
"FromRightToLeftFlag": false,
"MaskCharactersFlag": false,
"BeepKeyFlag": false,
"GlobalCorrectionFlag": false,
"DisableCancelFlag": false,
"DisableCorrectFlag": false,
"DisableValidFlag": false,
"MenuBackFlag": false
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/input")
.setHeader("content-type", "application/json")
.setBody("{\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n },\n \"InputData\": {\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"InputCommand\": \"\",\n \"NotifyCardInputFlag\": false,\n \"MaxInputTime\": 0,\n \"ImmediateResponseFlag\": false,\n \"MinLength\": 0,\n \"MaxLength\": 0,\n \"MaxDecimalLength\": 0,\n \"WaitUserValidationFlag\": false,\n \"DefaultInputString\": \"\",\n \"DefaultLayoutString\": \"\",\n \"StringMask\": \"\",\n \"FromRightToLeftFlag\": false,\n \"MaskCharactersFlag\": false,\n \"BeepKeyFlag\": false,\n \"GlobalCorrectionFlag\": false,\n \"DisableCancelFlag\": false,\n \"DisableCorrectFlag\": false,\n \"DisableValidFlag\": false,\n \"MenuBackFlag\": false\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/input"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n },\n \"InputData\": {\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"InputCommand\": \"\",\n \"NotifyCardInputFlag\": false,\n \"MaxInputTime\": 0,\n \"ImmediateResponseFlag\": false,\n \"MinLength\": 0,\n \"MaxLength\": 0,\n \"MaxDecimalLength\": 0,\n \"WaitUserValidationFlag\": false,\n \"DefaultInputString\": \"\",\n \"DefaultLayoutString\": \"\",\n \"StringMask\": \"\",\n \"FromRightToLeftFlag\": false,\n \"MaskCharactersFlag\": false,\n \"BeepKeyFlag\": false,\n \"GlobalCorrectionFlag\": false,\n \"DisableCancelFlag\": false,\n \"DisableCorrectFlag\": false,\n \"DisableValidFlag\": false,\n \"MenuBackFlag\": false\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n },\n \"InputData\": {\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"InputCommand\": \"\",\n \"NotifyCardInputFlag\": false,\n \"MaxInputTime\": 0,\n \"ImmediateResponseFlag\": false,\n \"MinLength\": 0,\n \"MaxLength\": 0,\n \"MaxDecimalLength\": 0,\n \"WaitUserValidationFlag\": false,\n \"DefaultInputString\": \"\",\n \"DefaultLayoutString\": \"\",\n \"StringMask\": \"\",\n \"FromRightToLeftFlag\": false,\n \"MaskCharactersFlag\": false,\n \"BeepKeyFlag\": false,\n \"GlobalCorrectionFlag\": false,\n \"DisableCancelFlag\": false,\n \"DisableCorrectFlag\": false,\n \"DisableValidFlag\": false,\n \"MenuBackFlag\": false\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/input")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/input")
.header("content-type", "application/json")
.body("{\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n },\n \"InputData\": {\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"InputCommand\": \"\",\n \"NotifyCardInputFlag\": false,\n \"MaxInputTime\": 0,\n \"ImmediateResponseFlag\": false,\n \"MinLength\": 0,\n \"MaxLength\": 0,\n \"MaxDecimalLength\": 0,\n \"WaitUserValidationFlag\": false,\n \"DefaultInputString\": \"\",\n \"DefaultLayoutString\": \"\",\n \"StringMask\": \"\",\n \"FromRightToLeftFlag\": false,\n \"MaskCharactersFlag\": false,\n \"BeepKeyFlag\": false,\n \"GlobalCorrectionFlag\": false,\n \"DisableCancelFlag\": false,\n \"DisableCorrectFlag\": false,\n \"DisableValidFlag\": false,\n \"MenuBackFlag\": false\n }\n}")
.asString();
const data = JSON.stringify({
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {
ReferenceID: '',
Language: ''
},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {
BarcodeType: '',
BarcodeValue: ''
}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [
{}
],
OutputXHTML: ''
}
],
OutputSignature: ''
},
InputData: {
Device: '',
InfoQualify: '',
InputCommand: '',
NotifyCardInputFlag: false,
MaxInputTime: 0,
ImmediateResponseFlag: false,
MinLength: 0,
MaxLength: 0,
MaxDecimalLength: 0,
WaitUserValidationFlag: false,
DefaultInputString: '',
DefaultLayoutString: '',
StringMask: '',
FromRightToLeftFlag: false,
MaskCharactersFlag: false,
BeepKeyFlag: false,
GlobalCorrectionFlag: false,
DisableCancelFlag: false,
DisableCorrectFlag: false,
DisableValidFlag: false,
MenuBackFlag: false
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/input');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/input',
headers: {'content-type': 'application/json'},
data: {
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [{}],
OutputXHTML: ''
}
],
OutputSignature: ''
},
InputData: {
Device: '',
InfoQualify: '',
InputCommand: '',
NotifyCardInputFlag: false,
MaxInputTime: 0,
ImmediateResponseFlag: false,
MinLength: 0,
MaxLength: 0,
MaxDecimalLength: 0,
WaitUserValidationFlag: false,
DefaultInputString: '',
DefaultLayoutString: '',
StringMask: '',
FromRightToLeftFlag: false,
MaskCharactersFlag: false,
BeepKeyFlag: false,
GlobalCorrectionFlag: false,
DisableCancelFlag: false,
DisableCorrectFlag: false,
DisableValidFlag: false,
MenuBackFlag: false
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/input';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"DisplayOutput":{"ResponseRequiredFlag":false,"MinimumDisplayTime":0,"Device":"","InfoQualify":"","OutputContent":{"OutputFormat":"","PredefinedContent":{"ReferenceID":"","Language":""},"OutputText":[{"Text":"","CharacterSet":0,"Font":"","StartRow":0,"StartColumn":0,"Color":"","CharacterWidth":"","CharacterHeight":"","CharacterStyle":"","Alignment":"","EndOfLineFlag":false}],"OutputXHTML":"","OutputBarcode":{"BarcodeType":"","BarcodeValue":""}},"MenuEntry":[{"MenuEntryTag":"","DefaultSelectedFlag":false,"OutputFormat":"","PredefinedContent":{},"OutputText":[{}],"OutputXHTML":""}],"OutputSignature":""},"InputData":{"Device":"","InfoQualify":"","InputCommand":"","NotifyCardInputFlag":false,"MaxInputTime":0,"ImmediateResponseFlag":false,"MinLength":0,"MaxLength":0,"MaxDecimalLength":0,"WaitUserValidationFlag":false,"DefaultInputString":"","DefaultLayoutString":"","StringMask":"","FromRightToLeftFlag":false,"MaskCharactersFlag":false,"BeepKeyFlag":false,"GlobalCorrectionFlag":false,"DisableCancelFlag":false,"DisableCorrectFlag":false,"DisableValidFlag":false,"MenuBackFlag":false}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/input',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "DisplayOutput": {\n "ResponseRequiredFlag": false,\n "MinimumDisplayTime": 0,\n "Device": "",\n "InfoQualify": "",\n "OutputContent": {\n "OutputFormat": "",\n "PredefinedContent": {\n "ReferenceID": "",\n "Language": ""\n },\n "OutputText": [\n {\n "Text": "",\n "CharacterSet": 0,\n "Font": "",\n "StartRow": 0,\n "StartColumn": 0,\n "Color": "",\n "CharacterWidth": "",\n "CharacterHeight": "",\n "CharacterStyle": "",\n "Alignment": "",\n "EndOfLineFlag": false\n }\n ],\n "OutputXHTML": "",\n "OutputBarcode": {\n "BarcodeType": "",\n "BarcodeValue": ""\n }\n },\n "MenuEntry": [\n {\n "MenuEntryTag": "",\n "DefaultSelectedFlag": false,\n "OutputFormat": "",\n "PredefinedContent": {},\n "OutputText": [\n {}\n ],\n "OutputXHTML": ""\n }\n ],\n "OutputSignature": ""\n },\n "InputData": {\n "Device": "",\n "InfoQualify": "",\n "InputCommand": "",\n "NotifyCardInputFlag": false,\n "MaxInputTime": 0,\n "ImmediateResponseFlag": false,\n "MinLength": 0,\n "MaxLength": 0,\n "MaxDecimalLength": 0,\n "WaitUserValidationFlag": false,\n "DefaultInputString": "",\n "DefaultLayoutString": "",\n "StringMask": "",\n "FromRightToLeftFlag": false,\n "MaskCharactersFlag": false,\n "BeepKeyFlag": false,\n "GlobalCorrectionFlag": false,\n "DisableCancelFlag": false,\n "DisableCorrectFlag": false,\n "DisableValidFlag": false,\n "MenuBackFlag": false\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n },\n \"InputData\": {\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"InputCommand\": \"\",\n \"NotifyCardInputFlag\": false,\n \"MaxInputTime\": 0,\n \"ImmediateResponseFlag\": false,\n \"MinLength\": 0,\n \"MaxLength\": 0,\n \"MaxDecimalLength\": 0,\n \"WaitUserValidationFlag\": false,\n \"DefaultInputString\": \"\",\n \"DefaultLayoutString\": \"\",\n \"StringMask\": \"\",\n \"FromRightToLeftFlag\": false,\n \"MaskCharactersFlag\": false,\n \"BeepKeyFlag\": false,\n \"GlobalCorrectionFlag\": false,\n \"DisableCancelFlag\": false,\n \"DisableCorrectFlag\": false,\n \"DisableValidFlag\": false,\n \"MenuBackFlag\": false\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/input")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/input',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [{}],
OutputXHTML: ''
}
],
OutputSignature: ''
},
InputData: {
Device: '',
InfoQualify: '',
InputCommand: '',
NotifyCardInputFlag: false,
MaxInputTime: 0,
ImmediateResponseFlag: false,
MinLength: 0,
MaxLength: 0,
MaxDecimalLength: 0,
WaitUserValidationFlag: false,
DefaultInputString: '',
DefaultLayoutString: '',
StringMask: '',
FromRightToLeftFlag: false,
MaskCharactersFlag: false,
BeepKeyFlag: false,
GlobalCorrectionFlag: false,
DisableCancelFlag: false,
DisableCorrectFlag: false,
DisableValidFlag: false,
MenuBackFlag: false
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/input',
headers: {'content-type': 'application/json'},
body: {
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [{}],
OutputXHTML: ''
}
],
OutputSignature: ''
},
InputData: {
Device: '',
InfoQualify: '',
InputCommand: '',
NotifyCardInputFlag: false,
MaxInputTime: 0,
ImmediateResponseFlag: false,
MinLength: 0,
MaxLength: 0,
MaxDecimalLength: 0,
WaitUserValidationFlag: false,
DefaultInputString: '',
DefaultLayoutString: '',
StringMask: '',
FromRightToLeftFlag: false,
MaskCharactersFlag: false,
BeepKeyFlag: false,
GlobalCorrectionFlag: false,
DisableCancelFlag: false,
DisableCorrectFlag: false,
DisableValidFlag: false,
MenuBackFlag: false
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/input');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {
ReferenceID: '',
Language: ''
},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {
BarcodeType: '',
BarcodeValue: ''
}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [
{}
],
OutputXHTML: ''
}
],
OutputSignature: ''
},
InputData: {
Device: '',
InfoQualify: '',
InputCommand: '',
NotifyCardInputFlag: false,
MaxInputTime: 0,
ImmediateResponseFlag: false,
MinLength: 0,
MaxLength: 0,
MaxDecimalLength: 0,
WaitUserValidationFlag: false,
DefaultInputString: '',
DefaultLayoutString: '',
StringMask: '',
FromRightToLeftFlag: false,
MaskCharactersFlag: false,
BeepKeyFlag: false,
GlobalCorrectionFlag: false,
DisableCancelFlag: false,
DisableCorrectFlag: false,
DisableValidFlag: false,
MenuBackFlag: false
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/input',
headers: {'content-type': 'application/json'},
data: {
DisplayOutput: {
ResponseRequiredFlag: false,
MinimumDisplayTime: 0,
Device: '',
InfoQualify: '',
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
},
MenuEntry: [
{
MenuEntryTag: '',
DefaultSelectedFlag: false,
OutputFormat: '',
PredefinedContent: {},
OutputText: [{}],
OutputXHTML: ''
}
],
OutputSignature: ''
},
InputData: {
Device: '',
InfoQualify: '',
InputCommand: '',
NotifyCardInputFlag: false,
MaxInputTime: 0,
ImmediateResponseFlag: false,
MinLength: 0,
MaxLength: 0,
MaxDecimalLength: 0,
WaitUserValidationFlag: false,
DefaultInputString: '',
DefaultLayoutString: '',
StringMask: '',
FromRightToLeftFlag: false,
MaskCharactersFlag: false,
BeepKeyFlag: false,
GlobalCorrectionFlag: false,
DisableCancelFlag: false,
DisableCorrectFlag: false,
DisableValidFlag: false,
MenuBackFlag: false
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/input';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"DisplayOutput":{"ResponseRequiredFlag":false,"MinimumDisplayTime":0,"Device":"","InfoQualify":"","OutputContent":{"OutputFormat":"","PredefinedContent":{"ReferenceID":"","Language":""},"OutputText":[{"Text":"","CharacterSet":0,"Font":"","StartRow":0,"StartColumn":0,"Color":"","CharacterWidth":"","CharacterHeight":"","CharacterStyle":"","Alignment":"","EndOfLineFlag":false}],"OutputXHTML":"","OutputBarcode":{"BarcodeType":"","BarcodeValue":""}},"MenuEntry":[{"MenuEntryTag":"","DefaultSelectedFlag":false,"OutputFormat":"","PredefinedContent":{},"OutputText":[{}],"OutputXHTML":""}],"OutputSignature":""},"InputData":{"Device":"","InfoQualify":"","InputCommand":"","NotifyCardInputFlag":false,"MaxInputTime":0,"ImmediateResponseFlag":false,"MinLength":0,"MaxLength":0,"MaxDecimalLength":0,"WaitUserValidationFlag":false,"DefaultInputString":"","DefaultLayoutString":"","StringMask":"","FromRightToLeftFlag":false,"MaskCharactersFlag":false,"BeepKeyFlag":false,"GlobalCorrectionFlag":false,"DisableCancelFlag":false,"DisableCorrectFlag":false,"DisableValidFlag":false,"MenuBackFlag":false}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DisplayOutput": @{ @"ResponseRequiredFlag": @NO, @"MinimumDisplayTime": @0, @"Device": @"", @"InfoQualify": @"", @"OutputContent": @{ @"OutputFormat": @"", @"PredefinedContent": @{ @"ReferenceID": @"", @"Language": @"" }, @"OutputText": @[ @{ @"Text": @"", @"CharacterSet": @0, @"Font": @"", @"StartRow": @0, @"StartColumn": @0, @"Color": @"", @"CharacterWidth": @"", @"CharacterHeight": @"", @"CharacterStyle": @"", @"Alignment": @"", @"EndOfLineFlag": @NO } ], @"OutputXHTML": @"", @"OutputBarcode": @{ @"BarcodeType": @"", @"BarcodeValue": @"" } }, @"MenuEntry": @[ @{ @"MenuEntryTag": @"", @"DefaultSelectedFlag": @NO, @"OutputFormat": @"", @"PredefinedContent": @{ }, @"OutputText": @[ @{ } ], @"OutputXHTML": @"" } ], @"OutputSignature": @"" },
@"InputData": @{ @"Device": @"", @"InfoQualify": @"", @"InputCommand": @"", @"NotifyCardInputFlag": @NO, @"MaxInputTime": @0, @"ImmediateResponseFlag": @NO, @"MinLength": @0, @"MaxLength": @0, @"MaxDecimalLength": @0, @"WaitUserValidationFlag": @NO, @"DefaultInputString": @"", @"DefaultLayoutString": @"", @"StringMask": @"", @"FromRightToLeftFlag": @NO, @"MaskCharactersFlag": @NO, @"BeepKeyFlag": @NO, @"GlobalCorrectionFlag": @NO, @"DisableCancelFlag": @NO, @"DisableCorrectFlag": @NO, @"DisableValidFlag": @NO, @"MenuBackFlag": @NO } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/input"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/input" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n },\n \"InputData\": {\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"InputCommand\": \"\",\n \"NotifyCardInputFlag\": false,\n \"MaxInputTime\": 0,\n \"ImmediateResponseFlag\": false,\n \"MinLength\": 0,\n \"MaxLength\": 0,\n \"MaxDecimalLength\": 0,\n \"WaitUserValidationFlag\": false,\n \"DefaultInputString\": \"\",\n \"DefaultLayoutString\": \"\",\n \"StringMask\": \"\",\n \"FromRightToLeftFlag\": false,\n \"MaskCharactersFlag\": false,\n \"BeepKeyFlag\": false,\n \"GlobalCorrectionFlag\": false,\n \"DisableCancelFlag\": false,\n \"DisableCorrectFlag\": false,\n \"DisableValidFlag\": false,\n \"MenuBackFlag\": false\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/input",
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([
'DisplayOutput' => [
'ResponseRequiredFlag' => null,
'MinimumDisplayTime' => 0,
'Device' => '',
'InfoQualify' => '',
'OutputContent' => [
'OutputFormat' => '',
'PredefinedContent' => [
'ReferenceID' => '',
'Language' => ''
],
'OutputText' => [
[
'Text' => '',
'CharacterSet' => 0,
'Font' => '',
'StartRow' => 0,
'StartColumn' => 0,
'Color' => '',
'CharacterWidth' => '',
'CharacterHeight' => '',
'CharacterStyle' => '',
'Alignment' => '',
'EndOfLineFlag' => null
]
],
'OutputXHTML' => '',
'OutputBarcode' => [
'BarcodeType' => '',
'BarcodeValue' => ''
]
],
'MenuEntry' => [
[
'MenuEntryTag' => '',
'DefaultSelectedFlag' => null,
'OutputFormat' => '',
'PredefinedContent' => [
],
'OutputText' => [
[
]
],
'OutputXHTML' => ''
]
],
'OutputSignature' => ''
],
'InputData' => [
'Device' => '',
'InfoQualify' => '',
'InputCommand' => '',
'NotifyCardInputFlag' => null,
'MaxInputTime' => 0,
'ImmediateResponseFlag' => null,
'MinLength' => 0,
'MaxLength' => 0,
'MaxDecimalLength' => 0,
'WaitUserValidationFlag' => null,
'DefaultInputString' => '',
'DefaultLayoutString' => '',
'StringMask' => '',
'FromRightToLeftFlag' => null,
'MaskCharactersFlag' => null,
'BeepKeyFlag' => null,
'GlobalCorrectionFlag' => null,
'DisableCancelFlag' => null,
'DisableCorrectFlag' => null,
'DisableValidFlag' => null,
'MenuBackFlag' => null
]
]),
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;
}
request('POST', '{{baseUrl}}/input', [
'body' => '{
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
},
"InputData": {
"Device": "",
"InfoQualify": "",
"InputCommand": "",
"NotifyCardInputFlag": false,
"MaxInputTime": 0,
"ImmediateResponseFlag": false,
"MinLength": 0,
"MaxLength": 0,
"MaxDecimalLength": 0,
"WaitUserValidationFlag": false,
"DefaultInputString": "",
"DefaultLayoutString": "",
"StringMask": "",
"FromRightToLeftFlag": false,
"MaskCharactersFlag": false,
"BeepKeyFlag": false,
"GlobalCorrectionFlag": false,
"DisableCancelFlag": false,
"DisableCorrectFlag": false,
"DisableValidFlag": false,
"MenuBackFlag": false
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/input');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DisplayOutput' => [
'ResponseRequiredFlag' => null,
'MinimumDisplayTime' => 0,
'Device' => '',
'InfoQualify' => '',
'OutputContent' => [
'OutputFormat' => '',
'PredefinedContent' => [
'ReferenceID' => '',
'Language' => ''
],
'OutputText' => [
[
'Text' => '',
'CharacterSet' => 0,
'Font' => '',
'StartRow' => 0,
'StartColumn' => 0,
'Color' => '',
'CharacterWidth' => '',
'CharacterHeight' => '',
'CharacterStyle' => '',
'Alignment' => '',
'EndOfLineFlag' => null
]
],
'OutputXHTML' => '',
'OutputBarcode' => [
'BarcodeType' => '',
'BarcodeValue' => ''
]
],
'MenuEntry' => [
[
'MenuEntryTag' => '',
'DefaultSelectedFlag' => null,
'OutputFormat' => '',
'PredefinedContent' => [
],
'OutputText' => [
[
]
],
'OutputXHTML' => ''
]
],
'OutputSignature' => ''
],
'InputData' => [
'Device' => '',
'InfoQualify' => '',
'InputCommand' => '',
'NotifyCardInputFlag' => null,
'MaxInputTime' => 0,
'ImmediateResponseFlag' => null,
'MinLength' => 0,
'MaxLength' => 0,
'MaxDecimalLength' => 0,
'WaitUserValidationFlag' => null,
'DefaultInputString' => '',
'DefaultLayoutString' => '',
'StringMask' => '',
'FromRightToLeftFlag' => null,
'MaskCharactersFlag' => null,
'BeepKeyFlag' => null,
'GlobalCorrectionFlag' => null,
'DisableCancelFlag' => null,
'DisableCorrectFlag' => null,
'DisableValidFlag' => null,
'MenuBackFlag' => null
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DisplayOutput' => [
'ResponseRequiredFlag' => null,
'MinimumDisplayTime' => 0,
'Device' => '',
'InfoQualify' => '',
'OutputContent' => [
'OutputFormat' => '',
'PredefinedContent' => [
'ReferenceID' => '',
'Language' => ''
],
'OutputText' => [
[
'Text' => '',
'CharacterSet' => 0,
'Font' => '',
'StartRow' => 0,
'StartColumn' => 0,
'Color' => '',
'CharacterWidth' => '',
'CharacterHeight' => '',
'CharacterStyle' => '',
'Alignment' => '',
'EndOfLineFlag' => null
]
],
'OutputXHTML' => '',
'OutputBarcode' => [
'BarcodeType' => '',
'BarcodeValue' => ''
]
],
'MenuEntry' => [
[
'MenuEntryTag' => '',
'DefaultSelectedFlag' => null,
'OutputFormat' => '',
'PredefinedContent' => [
],
'OutputText' => [
[
]
],
'OutputXHTML' => ''
]
],
'OutputSignature' => ''
],
'InputData' => [
'Device' => '',
'InfoQualify' => '',
'InputCommand' => '',
'NotifyCardInputFlag' => null,
'MaxInputTime' => 0,
'ImmediateResponseFlag' => null,
'MinLength' => 0,
'MaxLength' => 0,
'MaxDecimalLength' => 0,
'WaitUserValidationFlag' => null,
'DefaultInputString' => '',
'DefaultLayoutString' => '',
'StringMask' => '',
'FromRightToLeftFlag' => null,
'MaskCharactersFlag' => null,
'BeepKeyFlag' => null,
'GlobalCorrectionFlag' => null,
'DisableCancelFlag' => null,
'DisableCorrectFlag' => null,
'DisableValidFlag' => null,
'MenuBackFlag' => null
]
]));
$request->setRequestUrl('{{baseUrl}}/input');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/input' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
},
"InputData": {
"Device": "",
"InfoQualify": "",
"InputCommand": "",
"NotifyCardInputFlag": false,
"MaxInputTime": 0,
"ImmediateResponseFlag": false,
"MinLength": 0,
"MaxLength": 0,
"MaxDecimalLength": 0,
"WaitUserValidationFlag": false,
"DefaultInputString": "",
"DefaultLayoutString": "",
"StringMask": "",
"FromRightToLeftFlag": false,
"MaskCharactersFlag": false,
"BeepKeyFlag": false,
"GlobalCorrectionFlag": false,
"DisableCancelFlag": false,
"DisableCorrectFlag": false,
"DisableValidFlag": false,
"MenuBackFlag": false
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/input' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
},
"InputData": {
"Device": "",
"InfoQualify": "",
"InputCommand": "",
"NotifyCardInputFlag": false,
"MaxInputTime": 0,
"ImmediateResponseFlag": false,
"MinLength": 0,
"MaxLength": 0,
"MaxDecimalLength": 0,
"WaitUserValidationFlag": false,
"DefaultInputString": "",
"DefaultLayoutString": "",
"StringMask": "",
"FromRightToLeftFlag": false,
"MaskCharactersFlag": false,
"BeepKeyFlag": false,
"GlobalCorrectionFlag": false,
"DisableCancelFlag": false,
"DisableCorrectFlag": false,
"DisableValidFlag": false,
"MenuBackFlag": false
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n },\n \"InputData\": {\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"InputCommand\": \"\",\n \"NotifyCardInputFlag\": false,\n \"MaxInputTime\": 0,\n \"ImmediateResponseFlag\": false,\n \"MinLength\": 0,\n \"MaxLength\": 0,\n \"MaxDecimalLength\": 0,\n \"WaitUserValidationFlag\": false,\n \"DefaultInputString\": \"\",\n \"DefaultLayoutString\": \"\",\n \"StringMask\": \"\",\n \"FromRightToLeftFlag\": false,\n \"MaskCharactersFlag\": false,\n \"BeepKeyFlag\": false,\n \"GlobalCorrectionFlag\": false,\n \"DisableCancelFlag\": false,\n \"DisableCorrectFlag\": false,\n \"DisableValidFlag\": false,\n \"MenuBackFlag\": false\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/input", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/input"
payload = {
"DisplayOutput": {
"ResponseRequiredFlag": False,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": False
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": False,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [{}],
"OutputXHTML": ""
}
],
"OutputSignature": ""
},
"InputData": {
"Device": "",
"InfoQualify": "",
"InputCommand": "",
"NotifyCardInputFlag": False,
"MaxInputTime": 0,
"ImmediateResponseFlag": False,
"MinLength": 0,
"MaxLength": 0,
"MaxDecimalLength": 0,
"WaitUserValidationFlag": False,
"DefaultInputString": "",
"DefaultLayoutString": "",
"StringMask": "",
"FromRightToLeftFlag": False,
"MaskCharactersFlag": False,
"BeepKeyFlag": False,
"GlobalCorrectionFlag": False,
"DisableCancelFlag": False,
"DisableCorrectFlag": False,
"DisableValidFlag": False,
"MenuBackFlag": False
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/input"
payload <- "{\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n },\n \"InputData\": {\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"InputCommand\": \"\",\n \"NotifyCardInputFlag\": false,\n \"MaxInputTime\": 0,\n \"ImmediateResponseFlag\": false,\n \"MinLength\": 0,\n \"MaxLength\": 0,\n \"MaxDecimalLength\": 0,\n \"WaitUserValidationFlag\": false,\n \"DefaultInputString\": \"\",\n \"DefaultLayoutString\": \"\",\n \"StringMask\": \"\",\n \"FromRightToLeftFlag\": false,\n \"MaskCharactersFlag\": false,\n \"BeepKeyFlag\": false,\n \"GlobalCorrectionFlag\": false,\n \"DisableCancelFlag\": false,\n \"DisableCorrectFlag\": false,\n \"DisableValidFlag\": false,\n \"MenuBackFlag\": false\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/input")
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 \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n },\n \"InputData\": {\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"InputCommand\": \"\",\n \"NotifyCardInputFlag\": false,\n \"MaxInputTime\": 0,\n \"ImmediateResponseFlag\": false,\n \"MinLength\": 0,\n \"MaxLength\": 0,\n \"MaxDecimalLength\": 0,\n \"WaitUserValidationFlag\": false,\n \"DefaultInputString\": \"\",\n \"DefaultLayoutString\": \"\",\n \"StringMask\": \"\",\n \"FromRightToLeftFlag\": false,\n \"MaskCharactersFlag\": false,\n \"BeepKeyFlag\": false,\n \"GlobalCorrectionFlag\": false,\n \"DisableCancelFlag\": false,\n \"DisableCorrectFlag\": false,\n \"DisableValidFlag\": false,\n \"MenuBackFlag\": false\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/input') do |req|
req.body = "{\n \"DisplayOutput\": {\n \"ResponseRequiredFlag\": false,\n \"MinimumDisplayTime\": 0,\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n },\n \"MenuEntry\": [\n {\n \"MenuEntryTag\": \"\",\n \"DefaultSelectedFlag\": false,\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {},\n \"OutputText\": [\n {}\n ],\n \"OutputXHTML\": \"\"\n }\n ],\n \"OutputSignature\": \"\"\n },\n \"InputData\": {\n \"Device\": \"\",\n \"InfoQualify\": \"\",\n \"InputCommand\": \"\",\n \"NotifyCardInputFlag\": false,\n \"MaxInputTime\": 0,\n \"ImmediateResponseFlag\": false,\n \"MinLength\": 0,\n \"MaxLength\": 0,\n \"MaxDecimalLength\": 0,\n \"WaitUserValidationFlag\": false,\n \"DefaultInputString\": \"\",\n \"DefaultLayoutString\": \"\",\n \"StringMask\": \"\",\n \"FromRightToLeftFlag\": false,\n \"MaskCharactersFlag\": false,\n \"BeepKeyFlag\": false,\n \"GlobalCorrectionFlag\": false,\n \"DisableCancelFlag\": false,\n \"DisableCorrectFlag\": false,\n \"DisableValidFlag\": false,\n \"MenuBackFlag\": false\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/input";
let payload = json!({
"DisplayOutput": json!({
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": json!({
"OutputFormat": "",
"PredefinedContent": json!({
"ReferenceID": "",
"Language": ""
}),
"OutputText": (
json!({
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
})
),
"OutputXHTML": "",
"OutputBarcode": json!({
"BarcodeType": "",
"BarcodeValue": ""
})
}),
"MenuEntry": (
json!({
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": json!({}),
"OutputText": (json!({})),
"OutputXHTML": ""
})
),
"OutputSignature": ""
}),
"InputData": json!({
"Device": "",
"InfoQualify": "",
"InputCommand": "",
"NotifyCardInputFlag": false,
"MaxInputTime": 0,
"ImmediateResponseFlag": false,
"MinLength": 0,
"MaxLength": 0,
"MaxDecimalLength": 0,
"WaitUserValidationFlag": false,
"DefaultInputString": "",
"DefaultLayoutString": "",
"StringMask": "",
"FromRightToLeftFlag": false,
"MaskCharactersFlag": false,
"BeepKeyFlag": false,
"GlobalCorrectionFlag": false,
"DisableCancelFlag": false,
"DisableCorrectFlag": false,
"DisableValidFlag": false,
"MenuBackFlag": false
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/input \
--header 'content-type: application/json' \
--data '{
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
},
"InputData": {
"Device": "",
"InfoQualify": "",
"InputCommand": "",
"NotifyCardInputFlag": false,
"MaxInputTime": 0,
"ImmediateResponseFlag": false,
"MinLength": 0,
"MaxLength": 0,
"MaxDecimalLength": 0,
"WaitUserValidationFlag": false,
"DefaultInputString": "",
"DefaultLayoutString": "",
"StringMask": "",
"FromRightToLeftFlag": false,
"MaskCharactersFlag": false,
"BeepKeyFlag": false,
"GlobalCorrectionFlag": false,
"DisableCancelFlag": false,
"DisableCorrectFlag": false,
"DisableValidFlag": false,
"MenuBackFlag": false
}
}'
echo '{
"DisplayOutput": {
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
},
"MenuEntry": [
{
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": {},
"OutputText": [
{}
],
"OutputXHTML": ""
}
],
"OutputSignature": ""
},
"InputData": {
"Device": "",
"InfoQualify": "",
"InputCommand": "",
"NotifyCardInputFlag": false,
"MaxInputTime": 0,
"ImmediateResponseFlag": false,
"MinLength": 0,
"MaxLength": 0,
"MaxDecimalLength": 0,
"WaitUserValidationFlag": false,
"DefaultInputString": "",
"DefaultLayoutString": "",
"StringMask": "",
"FromRightToLeftFlag": false,
"MaskCharactersFlag": false,
"BeepKeyFlag": false,
"GlobalCorrectionFlag": false,
"DisableCancelFlag": false,
"DisableCorrectFlag": false,
"DisableValidFlag": false,
"MenuBackFlag": false
}
}' | \
http POST {{baseUrl}}/input \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "DisplayOutput": {\n "ResponseRequiredFlag": false,\n "MinimumDisplayTime": 0,\n "Device": "",\n "InfoQualify": "",\n "OutputContent": {\n "OutputFormat": "",\n "PredefinedContent": {\n "ReferenceID": "",\n "Language": ""\n },\n "OutputText": [\n {\n "Text": "",\n "CharacterSet": 0,\n "Font": "",\n "StartRow": 0,\n "StartColumn": 0,\n "Color": "",\n "CharacterWidth": "",\n "CharacterHeight": "",\n "CharacterStyle": "",\n "Alignment": "",\n "EndOfLineFlag": false\n }\n ],\n "OutputXHTML": "",\n "OutputBarcode": {\n "BarcodeType": "",\n "BarcodeValue": ""\n }\n },\n "MenuEntry": [\n {\n "MenuEntryTag": "",\n "DefaultSelectedFlag": false,\n "OutputFormat": "",\n "PredefinedContent": {},\n "OutputText": [\n {}\n ],\n "OutputXHTML": ""\n }\n ],\n "OutputSignature": ""\n },\n "InputData": {\n "Device": "",\n "InfoQualify": "",\n "InputCommand": "",\n "NotifyCardInputFlag": false,\n "MaxInputTime": 0,\n "ImmediateResponseFlag": false,\n "MinLength": 0,\n "MaxLength": 0,\n "MaxDecimalLength": 0,\n "WaitUserValidationFlag": false,\n "DefaultInputString": "",\n "DefaultLayoutString": "",\n "StringMask": "",\n "FromRightToLeftFlag": false,\n "MaskCharactersFlag": false,\n "BeepKeyFlag": false,\n "GlobalCorrectionFlag": false,\n "DisableCancelFlag": false,\n "DisableCorrectFlag": false,\n "DisableValidFlag": false,\n "MenuBackFlag": false\n }\n}' \
--output-document \
- {{baseUrl}}/input
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"DisplayOutput": [
"ResponseRequiredFlag": false,
"MinimumDisplayTime": 0,
"Device": "",
"InfoQualify": "",
"OutputContent": [
"OutputFormat": "",
"PredefinedContent": [
"ReferenceID": "",
"Language": ""
],
"OutputText": [
[
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
]
],
"OutputXHTML": "",
"OutputBarcode": [
"BarcodeType": "",
"BarcodeValue": ""
]
],
"MenuEntry": [
[
"MenuEntryTag": "",
"DefaultSelectedFlag": false,
"OutputFormat": "",
"PredefinedContent": [],
"OutputText": [[]],
"OutputXHTML": ""
]
],
"OutputSignature": ""
],
"InputData": [
"Device": "",
"InfoQualify": "",
"InputCommand": "",
"NotifyCardInputFlag": false,
"MaxInputTime": 0,
"ImmediateResponseFlag": false,
"MinLength": 0,
"MaxLength": 0,
"MaxDecimalLength": 0,
"WaitUserValidationFlag": false,
"DefaultInputString": "",
"DefaultLayoutString": "",
"StringMask": "",
"FromRightToLeftFlag": false,
"MaskCharactersFlag": false,
"BeepKeyFlag": false,
"GlobalCorrectionFlag": false,
"DisableCancelFlag": false,
"DisableCorrectFlag": false,
"DisableValidFlag": false,
"MenuBackFlag": false
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/input")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Login Request
{{baseUrl}}/login
BODY json
{
"DateTime": "",
"SaleSoftware": {
"ManufacturerID": "",
"ApplicationName": "",
"SoftwareVersion": "",
"CertificationCode": ""
},
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TrainingModeFlag": false,
"OperatorLanguage": "",
"OperatorID": "",
"ShiftNumber": "",
"TokenRequestedType": "",
"CustomerOrderReq": [],
"POISerialNumber": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/login");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DateTime\": \"\",\n \"SaleSoftware\": {\n \"ManufacturerID\": \"\",\n \"ApplicationName\": \"\",\n \"SoftwareVersion\": \"\",\n \"CertificationCode\": \"\"\n },\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TrainingModeFlag\": false,\n \"OperatorLanguage\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TokenRequestedType\": \"\",\n \"CustomerOrderReq\": [],\n \"POISerialNumber\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/login" {:content-type :json
:form-params {:DateTime ""
:SaleSoftware {:ManufacturerID ""
:ApplicationName ""
:SoftwareVersion ""
:CertificationCode ""}
:SaleTerminalData {:TotalsGroupID ""}
:TrainingModeFlag false
:OperatorLanguage ""
:OperatorID ""
:ShiftNumber ""
:TokenRequestedType ""
:CustomerOrderReq []
:POISerialNumber ""}})
require "http/client"
url = "{{baseUrl}}/login"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"DateTime\": \"\",\n \"SaleSoftware\": {\n \"ManufacturerID\": \"\",\n \"ApplicationName\": \"\",\n \"SoftwareVersion\": \"\",\n \"CertificationCode\": \"\"\n },\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TrainingModeFlag\": false,\n \"OperatorLanguage\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TokenRequestedType\": \"\",\n \"CustomerOrderReq\": [],\n \"POISerialNumber\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/login"),
Content = new StringContent("{\n \"DateTime\": \"\",\n \"SaleSoftware\": {\n \"ManufacturerID\": \"\",\n \"ApplicationName\": \"\",\n \"SoftwareVersion\": \"\",\n \"CertificationCode\": \"\"\n },\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TrainingModeFlag\": false,\n \"OperatorLanguage\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TokenRequestedType\": \"\",\n \"CustomerOrderReq\": [],\n \"POISerialNumber\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/login");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DateTime\": \"\",\n \"SaleSoftware\": {\n \"ManufacturerID\": \"\",\n \"ApplicationName\": \"\",\n \"SoftwareVersion\": \"\",\n \"CertificationCode\": \"\"\n },\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TrainingModeFlag\": false,\n \"OperatorLanguage\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TokenRequestedType\": \"\",\n \"CustomerOrderReq\": [],\n \"POISerialNumber\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/login"
payload := strings.NewReader("{\n \"DateTime\": \"\",\n \"SaleSoftware\": {\n \"ManufacturerID\": \"\",\n \"ApplicationName\": \"\",\n \"SoftwareVersion\": \"\",\n \"CertificationCode\": \"\"\n },\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TrainingModeFlag\": false,\n \"OperatorLanguage\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TokenRequestedType\": \"\",\n \"CustomerOrderReq\": [],\n \"POISerialNumber\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/login HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 381
{
"DateTime": "",
"SaleSoftware": {
"ManufacturerID": "",
"ApplicationName": "",
"SoftwareVersion": "",
"CertificationCode": ""
},
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TrainingModeFlag": false,
"OperatorLanguage": "",
"OperatorID": "",
"ShiftNumber": "",
"TokenRequestedType": "",
"CustomerOrderReq": [],
"POISerialNumber": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/login")
.setHeader("content-type", "application/json")
.setBody("{\n \"DateTime\": \"\",\n \"SaleSoftware\": {\n \"ManufacturerID\": \"\",\n \"ApplicationName\": \"\",\n \"SoftwareVersion\": \"\",\n \"CertificationCode\": \"\"\n },\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TrainingModeFlag\": false,\n \"OperatorLanguage\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TokenRequestedType\": \"\",\n \"CustomerOrderReq\": [],\n \"POISerialNumber\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/login"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DateTime\": \"\",\n \"SaleSoftware\": {\n \"ManufacturerID\": \"\",\n \"ApplicationName\": \"\",\n \"SoftwareVersion\": \"\",\n \"CertificationCode\": \"\"\n },\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TrainingModeFlag\": false,\n \"OperatorLanguage\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TokenRequestedType\": \"\",\n \"CustomerOrderReq\": [],\n \"POISerialNumber\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DateTime\": \"\",\n \"SaleSoftware\": {\n \"ManufacturerID\": \"\",\n \"ApplicationName\": \"\",\n \"SoftwareVersion\": \"\",\n \"CertificationCode\": \"\"\n },\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TrainingModeFlag\": false,\n \"OperatorLanguage\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TokenRequestedType\": \"\",\n \"CustomerOrderReq\": [],\n \"POISerialNumber\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/login")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/login")
.header("content-type", "application/json")
.body("{\n \"DateTime\": \"\",\n \"SaleSoftware\": {\n \"ManufacturerID\": \"\",\n \"ApplicationName\": \"\",\n \"SoftwareVersion\": \"\",\n \"CertificationCode\": \"\"\n },\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TrainingModeFlag\": false,\n \"OperatorLanguage\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TokenRequestedType\": \"\",\n \"CustomerOrderReq\": [],\n \"POISerialNumber\": \"\"\n}")
.asString();
const data = JSON.stringify({
DateTime: '',
SaleSoftware: {
ManufacturerID: '',
ApplicationName: '',
SoftwareVersion: '',
CertificationCode: ''
},
SaleTerminalData: {
TotalsGroupID: ''
},
TrainingModeFlag: false,
OperatorLanguage: '',
OperatorID: '',
ShiftNumber: '',
TokenRequestedType: '',
CustomerOrderReq: [],
POISerialNumber: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/login');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/login',
headers: {'content-type': 'application/json'},
data: {
DateTime: '',
SaleSoftware: {
ManufacturerID: '',
ApplicationName: '',
SoftwareVersion: '',
CertificationCode: ''
},
SaleTerminalData: {TotalsGroupID: ''},
TrainingModeFlag: false,
OperatorLanguage: '',
OperatorID: '',
ShiftNumber: '',
TokenRequestedType: '',
CustomerOrderReq: [],
POISerialNumber: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/login';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"DateTime":"","SaleSoftware":{"ManufacturerID":"","ApplicationName":"","SoftwareVersion":"","CertificationCode":""},"SaleTerminalData":{"TotalsGroupID":""},"TrainingModeFlag":false,"OperatorLanguage":"","OperatorID":"","ShiftNumber":"","TokenRequestedType":"","CustomerOrderReq":[],"POISerialNumber":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/login',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "DateTime": "",\n "SaleSoftware": {\n "ManufacturerID": "",\n "ApplicationName": "",\n "SoftwareVersion": "",\n "CertificationCode": ""\n },\n "SaleTerminalData": {\n "TotalsGroupID": ""\n },\n "TrainingModeFlag": false,\n "OperatorLanguage": "",\n "OperatorID": "",\n "ShiftNumber": "",\n "TokenRequestedType": "",\n "CustomerOrderReq": [],\n "POISerialNumber": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DateTime\": \"\",\n \"SaleSoftware\": {\n \"ManufacturerID\": \"\",\n \"ApplicationName\": \"\",\n \"SoftwareVersion\": \"\",\n \"CertificationCode\": \"\"\n },\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TrainingModeFlag\": false,\n \"OperatorLanguage\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TokenRequestedType\": \"\",\n \"CustomerOrderReq\": [],\n \"POISerialNumber\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/login")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/login',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
DateTime: '',
SaleSoftware: {
ManufacturerID: '',
ApplicationName: '',
SoftwareVersion: '',
CertificationCode: ''
},
SaleTerminalData: {TotalsGroupID: ''},
TrainingModeFlag: false,
OperatorLanguage: '',
OperatorID: '',
ShiftNumber: '',
TokenRequestedType: '',
CustomerOrderReq: [],
POISerialNumber: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/login',
headers: {'content-type': 'application/json'},
body: {
DateTime: '',
SaleSoftware: {
ManufacturerID: '',
ApplicationName: '',
SoftwareVersion: '',
CertificationCode: ''
},
SaleTerminalData: {TotalsGroupID: ''},
TrainingModeFlag: false,
OperatorLanguage: '',
OperatorID: '',
ShiftNumber: '',
TokenRequestedType: '',
CustomerOrderReq: [],
POISerialNumber: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/login');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
DateTime: '',
SaleSoftware: {
ManufacturerID: '',
ApplicationName: '',
SoftwareVersion: '',
CertificationCode: ''
},
SaleTerminalData: {
TotalsGroupID: ''
},
TrainingModeFlag: false,
OperatorLanguage: '',
OperatorID: '',
ShiftNumber: '',
TokenRequestedType: '',
CustomerOrderReq: [],
POISerialNumber: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/login',
headers: {'content-type': 'application/json'},
data: {
DateTime: '',
SaleSoftware: {
ManufacturerID: '',
ApplicationName: '',
SoftwareVersion: '',
CertificationCode: ''
},
SaleTerminalData: {TotalsGroupID: ''},
TrainingModeFlag: false,
OperatorLanguage: '',
OperatorID: '',
ShiftNumber: '',
TokenRequestedType: '',
CustomerOrderReq: [],
POISerialNumber: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/login';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"DateTime":"","SaleSoftware":{"ManufacturerID":"","ApplicationName":"","SoftwareVersion":"","CertificationCode":""},"SaleTerminalData":{"TotalsGroupID":""},"TrainingModeFlag":false,"OperatorLanguage":"","OperatorID":"","ShiftNumber":"","TokenRequestedType":"","CustomerOrderReq":[],"POISerialNumber":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DateTime": @"",
@"SaleSoftware": @{ @"ManufacturerID": @"", @"ApplicationName": @"", @"SoftwareVersion": @"", @"CertificationCode": @"" },
@"SaleTerminalData": @{ @"TotalsGroupID": @"" },
@"TrainingModeFlag": @NO,
@"OperatorLanguage": @"",
@"OperatorID": @"",
@"ShiftNumber": @"",
@"TokenRequestedType": @"",
@"CustomerOrderReq": @[ ],
@"POISerialNumber": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/login"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/login" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"DateTime\": \"\",\n \"SaleSoftware\": {\n \"ManufacturerID\": \"\",\n \"ApplicationName\": \"\",\n \"SoftwareVersion\": \"\",\n \"CertificationCode\": \"\"\n },\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TrainingModeFlag\": false,\n \"OperatorLanguage\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TokenRequestedType\": \"\",\n \"CustomerOrderReq\": [],\n \"POISerialNumber\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/login",
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([
'DateTime' => '',
'SaleSoftware' => [
'ManufacturerID' => '',
'ApplicationName' => '',
'SoftwareVersion' => '',
'CertificationCode' => ''
],
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TrainingModeFlag' => null,
'OperatorLanguage' => '',
'OperatorID' => '',
'ShiftNumber' => '',
'TokenRequestedType' => '',
'CustomerOrderReq' => [
],
'POISerialNumber' => ''
]),
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;
}
request('POST', '{{baseUrl}}/login', [
'body' => '{
"DateTime": "",
"SaleSoftware": {
"ManufacturerID": "",
"ApplicationName": "",
"SoftwareVersion": "",
"CertificationCode": ""
},
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TrainingModeFlag": false,
"OperatorLanguage": "",
"OperatorID": "",
"ShiftNumber": "",
"TokenRequestedType": "",
"CustomerOrderReq": [],
"POISerialNumber": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/login');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DateTime' => '',
'SaleSoftware' => [
'ManufacturerID' => '',
'ApplicationName' => '',
'SoftwareVersion' => '',
'CertificationCode' => ''
],
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TrainingModeFlag' => null,
'OperatorLanguage' => '',
'OperatorID' => '',
'ShiftNumber' => '',
'TokenRequestedType' => '',
'CustomerOrderReq' => [
],
'POISerialNumber' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DateTime' => '',
'SaleSoftware' => [
'ManufacturerID' => '',
'ApplicationName' => '',
'SoftwareVersion' => '',
'CertificationCode' => ''
],
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TrainingModeFlag' => null,
'OperatorLanguage' => '',
'OperatorID' => '',
'ShiftNumber' => '',
'TokenRequestedType' => '',
'CustomerOrderReq' => [
],
'POISerialNumber' => ''
]));
$request->setRequestUrl('{{baseUrl}}/login');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/login' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DateTime": "",
"SaleSoftware": {
"ManufacturerID": "",
"ApplicationName": "",
"SoftwareVersion": "",
"CertificationCode": ""
},
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TrainingModeFlag": false,
"OperatorLanguage": "",
"OperatorID": "",
"ShiftNumber": "",
"TokenRequestedType": "",
"CustomerOrderReq": [],
"POISerialNumber": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/login' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DateTime": "",
"SaleSoftware": {
"ManufacturerID": "",
"ApplicationName": "",
"SoftwareVersion": "",
"CertificationCode": ""
},
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TrainingModeFlag": false,
"OperatorLanguage": "",
"OperatorID": "",
"ShiftNumber": "",
"TokenRequestedType": "",
"CustomerOrderReq": [],
"POISerialNumber": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DateTime\": \"\",\n \"SaleSoftware\": {\n \"ManufacturerID\": \"\",\n \"ApplicationName\": \"\",\n \"SoftwareVersion\": \"\",\n \"CertificationCode\": \"\"\n },\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TrainingModeFlag\": false,\n \"OperatorLanguage\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TokenRequestedType\": \"\",\n \"CustomerOrderReq\": [],\n \"POISerialNumber\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/login", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/login"
payload = {
"DateTime": "",
"SaleSoftware": {
"ManufacturerID": "",
"ApplicationName": "",
"SoftwareVersion": "",
"CertificationCode": ""
},
"SaleTerminalData": { "TotalsGroupID": "" },
"TrainingModeFlag": False,
"OperatorLanguage": "",
"OperatorID": "",
"ShiftNumber": "",
"TokenRequestedType": "",
"CustomerOrderReq": [],
"POISerialNumber": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/login"
payload <- "{\n \"DateTime\": \"\",\n \"SaleSoftware\": {\n \"ManufacturerID\": \"\",\n \"ApplicationName\": \"\",\n \"SoftwareVersion\": \"\",\n \"CertificationCode\": \"\"\n },\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TrainingModeFlag\": false,\n \"OperatorLanguage\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TokenRequestedType\": \"\",\n \"CustomerOrderReq\": [],\n \"POISerialNumber\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/login")
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 \"DateTime\": \"\",\n \"SaleSoftware\": {\n \"ManufacturerID\": \"\",\n \"ApplicationName\": \"\",\n \"SoftwareVersion\": \"\",\n \"CertificationCode\": \"\"\n },\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TrainingModeFlag\": false,\n \"OperatorLanguage\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TokenRequestedType\": \"\",\n \"CustomerOrderReq\": [],\n \"POISerialNumber\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/login') do |req|
req.body = "{\n \"DateTime\": \"\",\n \"SaleSoftware\": {\n \"ManufacturerID\": \"\",\n \"ApplicationName\": \"\",\n \"SoftwareVersion\": \"\",\n \"CertificationCode\": \"\"\n },\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TrainingModeFlag\": false,\n \"OperatorLanguage\": \"\",\n \"OperatorID\": \"\",\n \"ShiftNumber\": \"\",\n \"TokenRequestedType\": \"\",\n \"CustomerOrderReq\": [],\n \"POISerialNumber\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/login";
let payload = json!({
"DateTime": "",
"SaleSoftware": json!({
"ManufacturerID": "",
"ApplicationName": "",
"SoftwareVersion": "",
"CertificationCode": ""
}),
"SaleTerminalData": json!({"TotalsGroupID": ""}),
"TrainingModeFlag": false,
"OperatorLanguage": "",
"OperatorID": "",
"ShiftNumber": "",
"TokenRequestedType": "",
"CustomerOrderReq": (),
"POISerialNumber": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/login \
--header 'content-type: application/json' \
--data '{
"DateTime": "",
"SaleSoftware": {
"ManufacturerID": "",
"ApplicationName": "",
"SoftwareVersion": "",
"CertificationCode": ""
},
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TrainingModeFlag": false,
"OperatorLanguage": "",
"OperatorID": "",
"ShiftNumber": "",
"TokenRequestedType": "",
"CustomerOrderReq": [],
"POISerialNumber": ""
}'
echo '{
"DateTime": "",
"SaleSoftware": {
"ManufacturerID": "",
"ApplicationName": "",
"SoftwareVersion": "",
"CertificationCode": ""
},
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TrainingModeFlag": false,
"OperatorLanguage": "",
"OperatorID": "",
"ShiftNumber": "",
"TokenRequestedType": "",
"CustomerOrderReq": [],
"POISerialNumber": ""
}' | \
http POST {{baseUrl}}/login \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "DateTime": "",\n "SaleSoftware": {\n "ManufacturerID": "",\n "ApplicationName": "",\n "SoftwareVersion": "",\n "CertificationCode": ""\n },\n "SaleTerminalData": {\n "TotalsGroupID": ""\n },\n "TrainingModeFlag": false,\n "OperatorLanguage": "",\n "OperatorID": "",\n "ShiftNumber": "",\n "TokenRequestedType": "",\n "CustomerOrderReq": [],\n "POISerialNumber": ""\n}' \
--output-document \
- {{baseUrl}}/login
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"DateTime": "",
"SaleSoftware": [
"ManufacturerID": "",
"ApplicationName": "",
"SoftwareVersion": "",
"CertificationCode": ""
],
"SaleTerminalData": ["TotalsGroupID": ""],
"TrainingModeFlag": false,
"OperatorLanguage": "",
"OperatorID": "",
"ShiftNumber": "",
"TokenRequestedType": "",
"CustomerOrderReq": [],
"POISerialNumber": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/login")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Logout Request
{{baseUrl}}/logout
BODY json
{
"MaintenanceAllowed": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/logout");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"MaintenanceAllowed\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/logout" {:content-type :json
:form-params {:MaintenanceAllowed false}})
require "http/client"
url = "{{baseUrl}}/logout"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"MaintenanceAllowed\": false\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/logout"),
Content = new StringContent("{\n \"MaintenanceAllowed\": false\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/logout");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"MaintenanceAllowed\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/logout"
payload := strings.NewReader("{\n \"MaintenanceAllowed\": false\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(res)
fmt.Println(string(body))
}
POST /baseUrl/logout HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 33
{
"MaintenanceAllowed": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/logout")
.setHeader("content-type", "application/json")
.setBody("{\n \"MaintenanceAllowed\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/logout"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"MaintenanceAllowed\": false\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"MaintenanceAllowed\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/logout")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/logout")
.header("content-type", "application/json")
.body("{\n \"MaintenanceAllowed\": false\n}")
.asString();
const data = JSON.stringify({
MaintenanceAllowed: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/logout');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/logout',
headers: {'content-type': 'application/json'},
data: {MaintenanceAllowed: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/logout';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"MaintenanceAllowed":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/logout',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "MaintenanceAllowed": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"MaintenanceAllowed\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/logout")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/logout',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({MaintenanceAllowed: false}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/logout',
headers: {'content-type': 'application/json'},
body: {MaintenanceAllowed: false},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/logout');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
MaintenanceAllowed: false
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/logout',
headers: {'content-type': 'application/json'},
data: {MaintenanceAllowed: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/logout';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"MaintenanceAllowed":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"MaintenanceAllowed": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/logout"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/logout" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"MaintenanceAllowed\": false\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/logout",
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([
'MaintenanceAllowed' => null
]),
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;
}
request('POST', '{{baseUrl}}/logout', [
'body' => '{
"MaintenanceAllowed": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/logout');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'MaintenanceAllowed' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'MaintenanceAllowed' => null
]));
$request->setRequestUrl('{{baseUrl}}/logout');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/logout' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MaintenanceAllowed": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/logout' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MaintenanceAllowed": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"MaintenanceAllowed\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/logout", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/logout"
payload = { "MaintenanceAllowed": False }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/logout"
payload <- "{\n \"MaintenanceAllowed\": false\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/logout")
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 \"MaintenanceAllowed\": false\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/logout') do |req|
req.body = "{\n \"MaintenanceAllowed\": false\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/logout";
let payload = json!({"MaintenanceAllowed": false});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/logout \
--header 'content-type: application/json' \
--data '{
"MaintenanceAllowed": false
}'
echo '{
"MaintenanceAllowed": false
}' | \
http POST {{baseUrl}}/logout \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "MaintenanceAllowed": false\n}' \
--output-document \
- {{baseUrl}}/logout
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["MaintenanceAllowed": false] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/logout")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Loyalty Request
{{baseUrl}}/loyalty
BODY json
{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"LoyaltyTransaction": {
"LoyaltyTransactionType": "",
"Currency": "",
"TotalAmount": "",
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"TransactionConditions": {
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
},
"SaleItem": [
{
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
]
},
"LoyaltyData": {
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
},
"LoyaltyAmount": {
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/loyalty");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"LoyaltyTransaction\": {\n \"LoyaltyTransactionType\": \"\",\n \"Currency\": \"\",\n \"TotalAmount\": \"\",\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"LoyaltyData\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/loyalty" {:content-type :json
:form-params {:SaleData {:OperatorID ""
:OperatorLanguage ""
:ShiftNumber ""
:SaleTransactionID {:TransactionID ""
:TimeStamp ""}
:SaleReferenceID ""
:SaleTerminalData {:TotalsGroupID ""}
:TokenRequestedType ""
:CustomerOrderID ""
:CustomerOrderReq []
:SaleToPOIData ""
:SaleToAcquirerData ""
:SaleToIssuerData {:StatementReference ""}}
:LoyaltyTransaction {:LoyaltyTransactionType ""
:Currency ""
:TotalAmount ""
:OriginalPOITransaction {:SaleID ""
:POIID ""
:POITransactionID {}
:ReuseCardDataFlag false
:ApprovalCode ""
:AcquirerID 0
:AmountValue ""
:HostTransactionID {}}
:TransactionConditions {:AllowedPaymentBrand []
:AcquirerID []
:DebitPreferredFlag false
:AllowedLoyaltyBrand []
:LoyaltyHandling ""
:ForceOnlineFlag false
:ForceEntryMode []
:MerchantCategoryCode ""}
:SaleItem [{:ItemID 0
:ProductCode 0
:EanUpc 0
:UnitOfMeasure ""
:Quantity ""
:UnitPrice ""
:ItemAmount ""
:TaxCode 0
:SaleChannel 0
:ProductLabel ""
:AdditionalProductInfo ""}]}
:LoyaltyData {:CardAcquisitionReference {}
:LoyaltyAccountID {:EntryMode []
:IdentificationType ""
:IdentificationSupport ""
:LoyaltyID ""}
:LoyaltyAmount {:LoyaltyUnit ""
:Currency ""
:AmountValue ""}}}})
require "http/client"
url = "{{baseUrl}}/loyalty"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"LoyaltyTransaction\": {\n \"LoyaltyTransactionType\": \"\",\n \"Currency\": \"\",\n \"TotalAmount\": \"\",\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"LoyaltyData\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/loyalty"),
Content = new StringContent("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"LoyaltyTransaction\": {\n \"LoyaltyTransactionType\": \"\",\n \"Currency\": \"\",\n \"TotalAmount\": \"\",\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"LoyaltyData\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/loyalty");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"LoyaltyTransaction\": {\n \"LoyaltyTransactionType\": \"\",\n \"Currency\": \"\",\n \"TotalAmount\": \"\",\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"LoyaltyData\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/loyalty"
payload := strings.NewReader("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"LoyaltyTransaction\": {\n \"LoyaltyTransactionType\": \"\",\n \"Currency\": \"\",\n \"TotalAmount\": \"\",\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"LoyaltyData\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\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(res)
fmt.Println(string(body))
}
POST /baseUrl/loyalty HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1736
{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"LoyaltyTransaction": {
"LoyaltyTransactionType": "",
"Currency": "",
"TotalAmount": "",
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"TransactionConditions": {
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
},
"SaleItem": [
{
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
]
},
"LoyaltyData": {
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
},
"LoyaltyAmount": {
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/loyalty")
.setHeader("content-type", "application/json")
.setBody("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"LoyaltyTransaction\": {\n \"LoyaltyTransactionType\": \"\",\n \"Currency\": \"\",\n \"TotalAmount\": \"\",\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"LoyaltyData\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/loyalty"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"LoyaltyTransaction\": {\n \"LoyaltyTransactionType\": \"\",\n \"Currency\": \"\",\n \"TotalAmount\": \"\",\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"LoyaltyData\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"LoyaltyTransaction\": {\n \"LoyaltyTransactionType\": \"\",\n \"Currency\": \"\",\n \"TotalAmount\": \"\",\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"LoyaltyData\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/loyalty")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/loyalty")
.header("content-type", "application/json")
.body("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"LoyaltyTransaction\": {\n \"LoyaltyTransactionType\": \"\",\n \"Currency\": \"\",\n \"TotalAmount\": \"\",\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"LoyaltyData\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n}")
.asString();
const data = JSON.stringify({
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {
TransactionID: '',
TimeStamp: ''
},
SaleReferenceID: '',
SaleTerminalData: {
TotalsGroupID: ''
},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {
StatementReference: ''
}
},
LoyaltyTransaction: {
LoyaltyTransactionType: '',
Currency: '',
TotalAmount: '',
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
TransactionConditions: {
AllowedPaymentBrand: [],
AcquirerID: [],
DebitPreferredFlag: false,
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceOnlineFlag: false,
ForceEntryMode: [],
MerchantCategoryCode: ''
},
SaleItem: [
{
ItemID: 0,
ProductCode: 0,
EanUpc: 0,
UnitOfMeasure: '',
Quantity: '',
UnitPrice: '',
ItemAmount: '',
TaxCode: 0,
SaleChannel: 0,
ProductLabel: '',
AdditionalProductInfo: ''
}
]
},
LoyaltyData: {
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
},
LoyaltyAmount: {
LoyaltyUnit: '',
Currency: '',
AmountValue: ''
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/loyalty');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/loyalty',
headers: {'content-type': 'application/json'},
data: {
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
LoyaltyTransaction: {
LoyaltyTransactionType: '',
Currency: '',
TotalAmount: '',
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
TransactionConditions: {
AllowedPaymentBrand: [],
AcquirerID: [],
DebitPreferredFlag: false,
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceOnlineFlag: false,
ForceEntryMode: [],
MerchantCategoryCode: ''
},
SaleItem: [
{
ItemID: 0,
ProductCode: 0,
EanUpc: 0,
UnitOfMeasure: '',
Quantity: '',
UnitPrice: '',
ItemAmount: '',
TaxCode: 0,
SaleChannel: 0,
ProductLabel: '',
AdditionalProductInfo: ''
}
]
},
LoyaltyData: {
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
},
LoyaltyAmount: {LoyaltyUnit: '', Currency: '', AmountValue: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/loyalty';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"SaleData":{"OperatorID":"","OperatorLanguage":"","ShiftNumber":"","SaleTransactionID":{"TransactionID":"","TimeStamp":""},"SaleReferenceID":"","SaleTerminalData":{"TotalsGroupID":""},"TokenRequestedType":"","CustomerOrderID":"","CustomerOrderReq":[],"SaleToPOIData":"","SaleToAcquirerData":"","SaleToIssuerData":{"StatementReference":""}},"LoyaltyTransaction":{"LoyaltyTransactionType":"","Currency":"","TotalAmount":"","OriginalPOITransaction":{"SaleID":"","POIID":"","POITransactionID":{},"ReuseCardDataFlag":false,"ApprovalCode":"","AcquirerID":0,"AmountValue":"","HostTransactionID":{}},"TransactionConditions":{"AllowedPaymentBrand":[],"AcquirerID":[],"DebitPreferredFlag":false,"AllowedLoyaltyBrand":[],"LoyaltyHandling":"","ForceOnlineFlag":false,"ForceEntryMode":[],"MerchantCategoryCode":""},"SaleItem":[{"ItemID":0,"ProductCode":0,"EanUpc":0,"UnitOfMeasure":"","Quantity":"","UnitPrice":"","ItemAmount":"","TaxCode":0,"SaleChannel":0,"ProductLabel":"","AdditionalProductInfo":""}]},"LoyaltyData":{"CardAcquisitionReference":{},"LoyaltyAccountID":{"EntryMode":[],"IdentificationType":"","IdentificationSupport":"","LoyaltyID":""},"LoyaltyAmount":{"LoyaltyUnit":"","Currency":"","AmountValue":""}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/loyalty',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "SaleData": {\n "OperatorID": "",\n "OperatorLanguage": "",\n "ShiftNumber": "",\n "SaleTransactionID": {\n "TransactionID": "",\n "TimeStamp": ""\n },\n "SaleReferenceID": "",\n "SaleTerminalData": {\n "TotalsGroupID": ""\n },\n "TokenRequestedType": "",\n "CustomerOrderID": "",\n "CustomerOrderReq": [],\n "SaleToPOIData": "",\n "SaleToAcquirerData": "",\n "SaleToIssuerData": {\n "StatementReference": ""\n }\n },\n "LoyaltyTransaction": {\n "LoyaltyTransactionType": "",\n "Currency": "",\n "TotalAmount": "",\n "OriginalPOITransaction": {\n "SaleID": "",\n "POIID": "",\n "POITransactionID": {},\n "ReuseCardDataFlag": false,\n "ApprovalCode": "",\n "AcquirerID": 0,\n "AmountValue": "",\n "HostTransactionID": {}\n },\n "TransactionConditions": {\n "AllowedPaymentBrand": [],\n "AcquirerID": [],\n "DebitPreferredFlag": false,\n "AllowedLoyaltyBrand": [],\n "LoyaltyHandling": "",\n "ForceOnlineFlag": false,\n "ForceEntryMode": [],\n "MerchantCategoryCode": ""\n },\n "SaleItem": [\n {\n "ItemID": 0,\n "ProductCode": 0,\n "EanUpc": 0,\n "UnitOfMeasure": "",\n "Quantity": "",\n "UnitPrice": "",\n "ItemAmount": "",\n "TaxCode": 0,\n "SaleChannel": 0,\n "ProductLabel": "",\n "AdditionalProductInfo": ""\n }\n ]\n },\n "LoyaltyData": {\n "CardAcquisitionReference": {},\n "LoyaltyAccountID": {\n "EntryMode": [],\n "IdentificationType": "",\n "IdentificationSupport": "",\n "LoyaltyID": ""\n },\n "LoyaltyAmount": {\n "LoyaltyUnit": "",\n "Currency": "",\n "AmountValue": ""\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"LoyaltyTransaction\": {\n \"LoyaltyTransactionType\": \"\",\n \"Currency\": \"\",\n \"TotalAmount\": \"\",\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"LoyaltyData\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/loyalty")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/loyalty',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
LoyaltyTransaction: {
LoyaltyTransactionType: '',
Currency: '',
TotalAmount: '',
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
TransactionConditions: {
AllowedPaymentBrand: [],
AcquirerID: [],
DebitPreferredFlag: false,
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceOnlineFlag: false,
ForceEntryMode: [],
MerchantCategoryCode: ''
},
SaleItem: [
{
ItemID: 0,
ProductCode: 0,
EanUpc: 0,
UnitOfMeasure: '',
Quantity: '',
UnitPrice: '',
ItemAmount: '',
TaxCode: 0,
SaleChannel: 0,
ProductLabel: '',
AdditionalProductInfo: ''
}
]
},
LoyaltyData: {
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
},
LoyaltyAmount: {LoyaltyUnit: '', Currency: '', AmountValue: ''}
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/loyalty',
headers: {'content-type': 'application/json'},
body: {
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
LoyaltyTransaction: {
LoyaltyTransactionType: '',
Currency: '',
TotalAmount: '',
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
TransactionConditions: {
AllowedPaymentBrand: [],
AcquirerID: [],
DebitPreferredFlag: false,
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceOnlineFlag: false,
ForceEntryMode: [],
MerchantCategoryCode: ''
},
SaleItem: [
{
ItemID: 0,
ProductCode: 0,
EanUpc: 0,
UnitOfMeasure: '',
Quantity: '',
UnitPrice: '',
ItemAmount: '',
TaxCode: 0,
SaleChannel: 0,
ProductLabel: '',
AdditionalProductInfo: ''
}
]
},
LoyaltyData: {
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
},
LoyaltyAmount: {LoyaltyUnit: '', Currency: '', AmountValue: ''}
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/loyalty');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {
TransactionID: '',
TimeStamp: ''
},
SaleReferenceID: '',
SaleTerminalData: {
TotalsGroupID: ''
},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {
StatementReference: ''
}
},
LoyaltyTransaction: {
LoyaltyTransactionType: '',
Currency: '',
TotalAmount: '',
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
TransactionConditions: {
AllowedPaymentBrand: [],
AcquirerID: [],
DebitPreferredFlag: false,
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceOnlineFlag: false,
ForceEntryMode: [],
MerchantCategoryCode: ''
},
SaleItem: [
{
ItemID: 0,
ProductCode: 0,
EanUpc: 0,
UnitOfMeasure: '',
Quantity: '',
UnitPrice: '',
ItemAmount: '',
TaxCode: 0,
SaleChannel: 0,
ProductLabel: '',
AdditionalProductInfo: ''
}
]
},
LoyaltyData: {
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
},
LoyaltyAmount: {
LoyaltyUnit: '',
Currency: '',
AmountValue: ''
}
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/loyalty',
headers: {'content-type': 'application/json'},
data: {
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
LoyaltyTransaction: {
LoyaltyTransactionType: '',
Currency: '',
TotalAmount: '',
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
TransactionConditions: {
AllowedPaymentBrand: [],
AcquirerID: [],
DebitPreferredFlag: false,
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceOnlineFlag: false,
ForceEntryMode: [],
MerchantCategoryCode: ''
},
SaleItem: [
{
ItemID: 0,
ProductCode: 0,
EanUpc: 0,
UnitOfMeasure: '',
Quantity: '',
UnitPrice: '',
ItemAmount: '',
TaxCode: 0,
SaleChannel: 0,
ProductLabel: '',
AdditionalProductInfo: ''
}
]
},
LoyaltyData: {
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
},
LoyaltyAmount: {LoyaltyUnit: '', Currency: '', AmountValue: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/loyalty';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"SaleData":{"OperatorID":"","OperatorLanguage":"","ShiftNumber":"","SaleTransactionID":{"TransactionID":"","TimeStamp":""},"SaleReferenceID":"","SaleTerminalData":{"TotalsGroupID":""},"TokenRequestedType":"","CustomerOrderID":"","CustomerOrderReq":[],"SaleToPOIData":"","SaleToAcquirerData":"","SaleToIssuerData":{"StatementReference":""}},"LoyaltyTransaction":{"LoyaltyTransactionType":"","Currency":"","TotalAmount":"","OriginalPOITransaction":{"SaleID":"","POIID":"","POITransactionID":{},"ReuseCardDataFlag":false,"ApprovalCode":"","AcquirerID":0,"AmountValue":"","HostTransactionID":{}},"TransactionConditions":{"AllowedPaymentBrand":[],"AcquirerID":[],"DebitPreferredFlag":false,"AllowedLoyaltyBrand":[],"LoyaltyHandling":"","ForceOnlineFlag":false,"ForceEntryMode":[],"MerchantCategoryCode":""},"SaleItem":[{"ItemID":0,"ProductCode":0,"EanUpc":0,"UnitOfMeasure":"","Quantity":"","UnitPrice":"","ItemAmount":"","TaxCode":0,"SaleChannel":0,"ProductLabel":"","AdditionalProductInfo":""}]},"LoyaltyData":{"CardAcquisitionReference":{},"LoyaltyAccountID":{"EntryMode":[],"IdentificationType":"","IdentificationSupport":"","LoyaltyID":""},"LoyaltyAmount":{"LoyaltyUnit":"","Currency":"","AmountValue":""}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"SaleData": @{ @"OperatorID": @"", @"OperatorLanguage": @"", @"ShiftNumber": @"", @"SaleTransactionID": @{ @"TransactionID": @"", @"TimeStamp": @"" }, @"SaleReferenceID": @"", @"SaleTerminalData": @{ @"TotalsGroupID": @"" }, @"TokenRequestedType": @"", @"CustomerOrderID": @"", @"CustomerOrderReq": @[ ], @"SaleToPOIData": @"", @"SaleToAcquirerData": @"", @"SaleToIssuerData": @{ @"StatementReference": @"" } },
@"LoyaltyTransaction": @{ @"LoyaltyTransactionType": @"", @"Currency": @"", @"TotalAmount": @"", @"OriginalPOITransaction": @{ @"SaleID": @"", @"POIID": @"", @"POITransactionID": @{ }, @"ReuseCardDataFlag": @NO, @"ApprovalCode": @"", @"AcquirerID": @0, @"AmountValue": @"", @"HostTransactionID": @{ } }, @"TransactionConditions": @{ @"AllowedPaymentBrand": @[ ], @"AcquirerID": @[ ], @"DebitPreferredFlag": @NO, @"AllowedLoyaltyBrand": @[ ], @"LoyaltyHandling": @"", @"ForceOnlineFlag": @NO, @"ForceEntryMode": @[ ], @"MerchantCategoryCode": @"" }, @"SaleItem": @[ @{ @"ItemID": @0, @"ProductCode": @0, @"EanUpc": @0, @"UnitOfMeasure": @"", @"Quantity": @"", @"UnitPrice": @"", @"ItemAmount": @"", @"TaxCode": @0, @"SaleChannel": @0, @"ProductLabel": @"", @"AdditionalProductInfo": @"" } ] },
@"LoyaltyData": @{ @"CardAcquisitionReference": @{ }, @"LoyaltyAccountID": @{ @"EntryMode": @[ ], @"IdentificationType": @"", @"IdentificationSupport": @"", @"LoyaltyID": @"" }, @"LoyaltyAmount": @{ @"LoyaltyUnit": @"", @"Currency": @"", @"AmountValue": @"" } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/loyalty"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/loyalty" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"LoyaltyTransaction\": {\n \"LoyaltyTransactionType\": \"\",\n \"Currency\": \"\",\n \"TotalAmount\": \"\",\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"LoyaltyData\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/loyalty",
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([
'SaleData' => [
'OperatorID' => '',
'OperatorLanguage' => '',
'ShiftNumber' => '',
'SaleTransactionID' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'SaleReferenceID' => '',
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TokenRequestedType' => '',
'CustomerOrderID' => '',
'CustomerOrderReq' => [
],
'SaleToPOIData' => '',
'SaleToAcquirerData' => '',
'SaleToIssuerData' => [
'StatementReference' => ''
]
],
'LoyaltyTransaction' => [
'LoyaltyTransactionType' => '',
'Currency' => '',
'TotalAmount' => '',
'OriginalPOITransaction' => [
'SaleID' => '',
'POIID' => '',
'POITransactionID' => [
],
'ReuseCardDataFlag' => null,
'ApprovalCode' => '',
'AcquirerID' => 0,
'AmountValue' => '',
'HostTransactionID' => [
]
],
'TransactionConditions' => [
'AllowedPaymentBrand' => [
],
'AcquirerID' => [
],
'DebitPreferredFlag' => null,
'AllowedLoyaltyBrand' => [
],
'LoyaltyHandling' => '',
'ForceOnlineFlag' => null,
'ForceEntryMode' => [
],
'MerchantCategoryCode' => ''
],
'SaleItem' => [
[
'ItemID' => 0,
'ProductCode' => 0,
'EanUpc' => 0,
'UnitOfMeasure' => '',
'Quantity' => '',
'UnitPrice' => '',
'ItemAmount' => '',
'TaxCode' => 0,
'SaleChannel' => 0,
'ProductLabel' => '',
'AdditionalProductInfo' => ''
]
]
],
'LoyaltyData' => [
'CardAcquisitionReference' => [
],
'LoyaltyAccountID' => [
'EntryMode' => [
],
'IdentificationType' => '',
'IdentificationSupport' => '',
'LoyaltyID' => ''
],
'LoyaltyAmount' => [
'LoyaltyUnit' => '',
'Currency' => '',
'AmountValue' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/loyalty', [
'body' => '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"LoyaltyTransaction": {
"LoyaltyTransactionType": "",
"Currency": "",
"TotalAmount": "",
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"TransactionConditions": {
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
},
"SaleItem": [
{
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
]
},
"LoyaltyData": {
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
},
"LoyaltyAmount": {
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/loyalty');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SaleData' => [
'OperatorID' => '',
'OperatorLanguage' => '',
'ShiftNumber' => '',
'SaleTransactionID' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'SaleReferenceID' => '',
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TokenRequestedType' => '',
'CustomerOrderID' => '',
'CustomerOrderReq' => [
],
'SaleToPOIData' => '',
'SaleToAcquirerData' => '',
'SaleToIssuerData' => [
'StatementReference' => ''
]
],
'LoyaltyTransaction' => [
'LoyaltyTransactionType' => '',
'Currency' => '',
'TotalAmount' => '',
'OriginalPOITransaction' => [
'SaleID' => '',
'POIID' => '',
'POITransactionID' => [
],
'ReuseCardDataFlag' => null,
'ApprovalCode' => '',
'AcquirerID' => 0,
'AmountValue' => '',
'HostTransactionID' => [
]
],
'TransactionConditions' => [
'AllowedPaymentBrand' => [
],
'AcquirerID' => [
],
'DebitPreferredFlag' => null,
'AllowedLoyaltyBrand' => [
],
'LoyaltyHandling' => '',
'ForceOnlineFlag' => null,
'ForceEntryMode' => [
],
'MerchantCategoryCode' => ''
],
'SaleItem' => [
[
'ItemID' => 0,
'ProductCode' => 0,
'EanUpc' => 0,
'UnitOfMeasure' => '',
'Quantity' => '',
'UnitPrice' => '',
'ItemAmount' => '',
'TaxCode' => 0,
'SaleChannel' => 0,
'ProductLabel' => '',
'AdditionalProductInfo' => ''
]
]
],
'LoyaltyData' => [
'CardAcquisitionReference' => [
],
'LoyaltyAccountID' => [
'EntryMode' => [
],
'IdentificationType' => '',
'IdentificationSupport' => '',
'LoyaltyID' => ''
],
'LoyaltyAmount' => [
'LoyaltyUnit' => '',
'Currency' => '',
'AmountValue' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SaleData' => [
'OperatorID' => '',
'OperatorLanguage' => '',
'ShiftNumber' => '',
'SaleTransactionID' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'SaleReferenceID' => '',
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TokenRequestedType' => '',
'CustomerOrderID' => '',
'CustomerOrderReq' => [
],
'SaleToPOIData' => '',
'SaleToAcquirerData' => '',
'SaleToIssuerData' => [
'StatementReference' => ''
]
],
'LoyaltyTransaction' => [
'LoyaltyTransactionType' => '',
'Currency' => '',
'TotalAmount' => '',
'OriginalPOITransaction' => [
'SaleID' => '',
'POIID' => '',
'POITransactionID' => [
],
'ReuseCardDataFlag' => null,
'ApprovalCode' => '',
'AcquirerID' => 0,
'AmountValue' => '',
'HostTransactionID' => [
]
],
'TransactionConditions' => [
'AllowedPaymentBrand' => [
],
'AcquirerID' => [
],
'DebitPreferredFlag' => null,
'AllowedLoyaltyBrand' => [
],
'LoyaltyHandling' => '',
'ForceOnlineFlag' => null,
'ForceEntryMode' => [
],
'MerchantCategoryCode' => ''
],
'SaleItem' => [
[
'ItemID' => 0,
'ProductCode' => 0,
'EanUpc' => 0,
'UnitOfMeasure' => '',
'Quantity' => '',
'UnitPrice' => '',
'ItemAmount' => '',
'TaxCode' => 0,
'SaleChannel' => 0,
'ProductLabel' => '',
'AdditionalProductInfo' => ''
]
]
],
'LoyaltyData' => [
'CardAcquisitionReference' => [
],
'LoyaltyAccountID' => [
'EntryMode' => [
],
'IdentificationType' => '',
'IdentificationSupport' => '',
'LoyaltyID' => ''
],
'LoyaltyAmount' => [
'LoyaltyUnit' => '',
'Currency' => '',
'AmountValue' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/loyalty');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/loyalty' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"LoyaltyTransaction": {
"LoyaltyTransactionType": "",
"Currency": "",
"TotalAmount": "",
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"TransactionConditions": {
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
},
"SaleItem": [
{
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
]
},
"LoyaltyData": {
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
},
"LoyaltyAmount": {
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/loyalty' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"LoyaltyTransaction": {
"LoyaltyTransactionType": "",
"Currency": "",
"TotalAmount": "",
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"TransactionConditions": {
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
},
"SaleItem": [
{
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
]
},
"LoyaltyData": {
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
},
"LoyaltyAmount": {
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"LoyaltyTransaction\": {\n \"LoyaltyTransactionType\": \"\",\n \"Currency\": \"\",\n \"TotalAmount\": \"\",\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"LoyaltyData\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/loyalty", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/loyalty"
payload = {
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": { "TotalsGroupID": "" },
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": { "StatementReference": "" }
},
"LoyaltyTransaction": {
"LoyaltyTransactionType": "",
"Currency": "",
"TotalAmount": "",
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": False,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"TransactionConditions": {
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": False,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": False,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
},
"SaleItem": [
{
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
]
},
"LoyaltyData": {
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
},
"LoyaltyAmount": {
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
}
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/loyalty"
payload <- "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"LoyaltyTransaction\": {\n \"LoyaltyTransactionType\": \"\",\n \"Currency\": \"\",\n \"TotalAmount\": \"\",\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"LoyaltyData\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/loyalty")
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 \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"LoyaltyTransaction\": {\n \"LoyaltyTransactionType\": \"\",\n \"Currency\": \"\",\n \"TotalAmount\": \"\",\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"LoyaltyData\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/loyalty') do |req|
req.body = "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"LoyaltyTransaction\": {\n \"LoyaltyTransactionType\": \"\",\n \"Currency\": \"\",\n \"TotalAmount\": \"\",\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"LoyaltyData\": {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/loyalty";
let payload = json!({
"SaleData": json!({
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": json!({
"TransactionID": "",
"TimeStamp": ""
}),
"SaleReferenceID": "",
"SaleTerminalData": json!({"TotalsGroupID": ""}),
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": (),
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": json!({"StatementReference": ""})
}),
"LoyaltyTransaction": json!({
"LoyaltyTransactionType": "",
"Currency": "",
"TotalAmount": "",
"OriginalPOITransaction": json!({
"SaleID": "",
"POIID": "",
"POITransactionID": json!({}),
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": json!({})
}),
"TransactionConditions": json!({
"AllowedPaymentBrand": (),
"AcquirerID": (),
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": (),
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": (),
"MerchantCategoryCode": ""
}),
"SaleItem": (
json!({
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
})
)
}),
"LoyaltyData": json!({
"CardAcquisitionReference": json!({}),
"LoyaltyAccountID": json!({
"EntryMode": (),
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
}),
"LoyaltyAmount": json!({
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
})
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/loyalty \
--header 'content-type: application/json' \
--data '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"LoyaltyTransaction": {
"LoyaltyTransactionType": "",
"Currency": "",
"TotalAmount": "",
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"TransactionConditions": {
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
},
"SaleItem": [
{
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
]
},
"LoyaltyData": {
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
},
"LoyaltyAmount": {
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
}
}
}'
echo '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"LoyaltyTransaction": {
"LoyaltyTransactionType": "",
"Currency": "",
"TotalAmount": "",
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"TransactionConditions": {
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
},
"SaleItem": [
{
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
]
},
"LoyaltyData": {
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
},
"LoyaltyAmount": {
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
}
}
}' | \
http POST {{baseUrl}}/loyalty \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "SaleData": {\n "OperatorID": "",\n "OperatorLanguage": "",\n "ShiftNumber": "",\n "SaleTransactionID": {\n "TransactionID": "",\n "TimeStamp": ""\n },\n "SaleReferenceID": "",\n "SaleTerminalData": {\n "TotalsGroupID": ""\n },\n "TokenRequestedType": "",\n "CustomerOrderID": "",\n "CustomerOrderReq": [],\n "SaleToPOIData": "",\n "SaleToAcquirerData": "",\n "SaleToIssuerData": {\n "StatementReference": ""\n }\n },\n "LoyaltyTransaction": {\n "LoyaltyTransactionType": "",\n "Currency": "",\n "TotalAmount": "",\n "OriginalPOITransaction": {\n "SaleID": "",\n "POIID": "",\n "POITransactionID": {},\n "ReuseCardDataFlag": false,\n "ApprovalCode": "",\n "AcquirerID": 0,\n "AmountValue": "",\n "HostTransactionID": {}\n },\n "TransactionConditions": {\n "AllowedPaymentBrand": [],\n "AcquirerID": [],\n "DebitPreferredFlag": false,\n "AllowedLoyaltyBrand": [],\n "LoyaltyHandling": "",\n "ForceOnlineFlag": false,\n "ForceEntryMode": [],\n "MerchantCategoryCode": ""\n },\n "SaleItem": [\n {\n "ItemID": 0,\n "ProductCode": 0,\n "EanUpc": 0,\n "UnitOfMeasure": "",\n "Quantity": "",\n "UnitPrice": "",\n "ItemAmount": "",\n "TaxCode": 0,\n "SaleChannel": 0,\n "ProductLabel": "",\n "AdditionalProductInfo": ""\n }\n ]\n },\n "LoyaltyData": {\n "CardAcquisitionReference": {},\n "LoyaltyAccountID": {\n "EntryMode": [],\n "IdentificationType": "",\n "IdentificationSupport": "",\n "LoyaltyID": ""\n },\n "LoyaltyAmount": {\n "LoyaltyUnit": "",\n "Currency": "",\n "AmountValue": ""\n }\n }\n}' \
--output-document \
- {{baseUrl}}/loyalty
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"SaleData": [
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": [
"TransactionID": "",
"TimeStamp": ""
],
"SaleReferenceID": "",
"SaleTerminalData": ["TotalsGroupID": ""],
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": ["StatementReference": ""]
],
"LoyaltyTransaction": [
"LoyaltyTransactionType": "",
"Currency": "",
"TotalAmount": "",
"OriginalPOITransaction": [
"SaleID": "",
"POIID": "",
"POITransactionID": [],
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": []
],
"TransactionConditions": [
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
],
"SaleItem": [
[
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
]
]
],
"LoyaltyData": [
"CardAcquisitionReference": [],
"LoyaltyAccountID": [
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
],
"LoyaltyAmount": [
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/loyalty")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Payment Request
{{baseUrl}}/payment
BODY json
{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"PaymentTransaction": {
"AmountsReq": {
"Currency": "",
"RequestedAmount": "",
"CashBackAmount": "",
"TipAmount": "",
"PaidAmount": "",
"MinimumAmountToDeliver": "",
"MaximumCashBackAmount": "",
"MinimumSplitAmount": ""
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"TransactionConditions": {
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
},
"SaleItem": [
{
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
]
},
"PaymentData": {
"PaymentType": "",
"SplitPaymentFlag": false,
"RequestedValidityDate": "",
"CardAcquisitionReference": {},
"Instalment": {
"InstalmentType": "",
"SequenceNumber": 0,
"PlanID": "",
"Period": 0,
"PeriodUnit": "",
"FirstPaymentDate": "",
"TotalNbOfPayments": 0,
"CumulativeAmount": "",
"FirstAmount": "",
"Charges": ""
},
"CustomerOrder": {
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
},
"PaymentInstrumentData": {
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": {
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": {
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
{
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
}
]
},
"AllowedProductCode": [],
"AllowedProduct": [
{
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
],
"PaymentToken": {
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
},
"CustomerOrder": [
{}
]
},
"CheckData": {
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": {},
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
},
"MobileData": {
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": {
"GeographicCoordinates": {
"Latitude": "",
"Longitude": ""
},
"UTMCoordinates": {
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
}
},
"ProtectedMobileData": "",
"SensitiveMobileData": {
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
}
},
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
}
}
},
"LoyaltyData": [
{
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
},
"LoyaltyAmount": {
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
}
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/payment");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"PaymentTransaction\": {\n \"AmountsReq\": {\n \"Currency\": \"\",\n \"RequestedAmount\": \"\",\n \"CashBackAmount\": \"\",\n \"TipAmount\": \"\",\n \"PaidAmount\": \"\",\n \"MinimumAmountToDeliver\": \"\",\n \"MaximumCashBackAmount\": \"\",\n \"MinimumSplitAmount\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"PaymentData\": {\n \"PaymentType\": \"\",\n \"SplitPaymentFlag\": false,\n \"RequestedValidityDate\": \"\",\n \"CardAcquisitionReference\": {},\n \"Instalment\": {\n \"InstalmentType\": \"\",\n \"SequenceNumber\": 0,\n \"PlanID\": \"\",\n \"Period\": 0,\n \"PeriodUnit\": \"\",\n \"FirstPaymentDate\": \"\",\n \"TotalNbOfPayments\": 0,\n \"CumulativeAmount\": \"\",\n \"FirstAmount\": \"\",\n \"Charges\": \"\"\n },\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {}\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyData\": [\n {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/payment" {:content-type :json
:form-params {:SaleData {:OperatorID ""
:OperatorLanguage ""
:ShiftNumber ""
:SaleTransactionID {:TransactionID ""
:TimeStamp ""}
:SaleReferenceID ""
:SaleTerminalData {:TotalsGroupID ""}
:TokenRequestedType ""
:CustomerOrderID ""
:CustomerOrderReq []
:SaleToPOIData ""
:SaleToAcquirerData ""
:SaleToIssuerData {:StatementReference ""}}
:PaymentTransaction {:AmountsReq {:Currency ""
:RequestedAmount ""
:CashBackAmount ""
:TipAmount ""
:PaidAmount ""
:MinimumAmountToDeliver ""
:MaximumCashBackAmount ""
:MinimumSplitAmount ""}
:OriginalPOITransaction {:SaleID ""
:POIID ""
:POITransactionID {}
:ReuseCardDataFlag false
:ApprovalCode ""
:AcquirerID 0
:AmountValue ""
:HostTransactionID {}}
:TransactionConditions {:AllowedPaymentBrand []
:AcquirerID []
:DebitPreferredFlag false
:AllowedLoyaltyBrand []
:LoyaltyHandling ""
:ForceOnlineFlag false
:ForceEntryMode []
:MerchantCategoryCode ""}
:SaleItem [{:ItemID 0
:ProductCode 0
:EanUpc 0
:UnitOfMeasure ""
:Quantity ""
:UnitPrice ""
:ItemAmount ""
:TaxCode 0
:SaleChannel 0
:ProductLabel ""
:AdditionalProductInfo ""}]}
:PaymentData {:PaymentType ""
:SplitPaymentFlag false
:RequestedValidityDate ""
:CardAcquisitionReference {}
:Instalment {:InstalmentType ""
:SequenceNumber 0
:PlanID ""
:Period 0
:PeriodUnit ""
:FirstPaymentDate ""
:TotalNbOfPayments 0
:CumulativeAmount ""
:FirstAmount ""
:Charges ""}
:CustomerOrder {:CustomerOrderID ""
:SaleReferenceID ""
:OpenOrderState false
:StartDate ""
:EndDate ""
:ForecastedAmount ""
:CurrentAmount ""
:Currency ""
:AccessedBy ""
:AdditionalInformation ""}
:PaymentInstrumentData {:PaymentInstrumentType ""
:ProtectedCardData ""
:CardData {:PaymentBrand ""
:MaskedPan ""
:PaymentAccountRef ""
:EntryMode []
:CardCountryCode 0
:ProtectedCardData ""
:SensitiveCardData {:PAN 0
:CardSeqNumb 0
:ExpiryDate 0
:TrackData [{:TrackNumb 0
:TrackFormat ""
:TrackValue ""}]}
:AllowedProductCode []
:AllowedProduct [{:ProductCode 0
:EanUpc 0
:ProductLabel ""
:AdditionalProductInfo ""}]
:PaymentToken {:TokenRequestedType ""
:TokenValue ""
:ExpiryDateTime ""}
:CustomerOrder [{}]}
:CheckData {:BankID ""
:AccountNumber ""
:CheckNumber ""
:TrackData {}
:CheckCardNumber ""
:TypeCode ""
:Country ""}
:MobileData {:MobileCountryCode 0
:MobileNetworkCode 0
:MaskedMSISDN 0
:Geolocation {:GeographicCoordinates {:Latitude ""
:Longitude ""}
:UTMCoordinates {:UTMZone ""
:UTMEastward ""
:UTMNorthward ""}}
:ProtectedMobileData ""
:SensitiveMobileData {:MSISDN 0
:IMSI 0
:IMEI 0}}
:StoredValueAccountID {:StoredValueAccountType ""
:StoredValueProvider ""
:OwnerName ""
:ExpiryDate 0
:EntryMode []
:IdentificationType ""
:StoredValueID ""}}}
:LoyaltyData [{:CardAcquisitionReference {}
:LoyaltyAccountID {:EntryMode []
:IdentificationType ""
:IdentificationSupport ""
:LoyaltyID ""}
:LoyaltyAmount {:LoyaltyUnit ""
:Currency ""
:AmountValue ""}}]}})
require "http/client"
url = "{{baseUrl}}/payment"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"PaymentTransaction\": {\n \"AmountsReq\": {\n \"Currency\": \"\",\n \"RequestedAmount\": \"\",\n \"CashBackAmount\": \"\",\n \"TipAmount\": \"\",\n \"PaidAmount\": \"\",\n \"MinimumAmountToDeliver\": \"\",\n \"MaximumCashBackAmount\": \"\",\n \"MinimumSplitAmount\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"PaymentData\": {\n \"PaymentType\": \"\",\n \"SplitPaymentFlag\": false,\n \"RequestedValidityDate\": \"\",\n \"CardAcquisitionReference\": {},\n \"Instalment\": {\n \"InstalmentType\": \"\",\n \"SequenceNumber\": 0,\n \"PlanID\": \"\",\n \"Period\": 0,\n \"PeriodUnit\": \"\",\n \"FirstPaymentDate\": \"\",\n \"TotalNbOfPayments\": 0,\n \"CumulativeAmount\": \"\",\n \"FirstAmount\": \"\",\n \"Charges\": \"\"\n },\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {}\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyData\": [\n {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/payment"),
Content = new StringContent("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"PaymentTransaction\": {\n \"AmountsReq\": {\n \"Currency\": \"\",\n \"RequestedAmount\": \"\",\n \"CashBackAmount\": \"\",\n \"TipAmount\": \"\",\n \"PaidAmount\": \"\",\n \"MinimumAmountToDeliver\": \"\",\n \"MaximumCashBackAmount\": \"\",\n \"MinimumSplitAmount\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"PaymentData\": {\n \"PaymentType\": \"\",\n \"SplitPaymentFlag\": false,\n \"RequestedValidityDate\": \"\",\n \"CardAcquisitionReference\": {},\n \"Instalment\": {\n \"InstalmentType\": \"\",\n \"SequenceNumber\": 0,\n \"PlanID\": \"\",\n \"Period\": 0,\n \"PeriodUnit\": \"\",\n \"FirstPaymentDate\": \"\",\n \"TotalNbOfPayments\": 0,\n \"CumulativeAmount\": \"\",\n \"FirstAmount\": \"\",\n \"Charges\": \"\"\n },\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {}\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyData\": [\n {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/payment");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"PaymentTransaction\": {\n \"AmountsReq\": {\n \"Currency\": \"\",\n \"RequestedAmount\": \"\",\n \"CashBackAmount\": \"\",\n \"TipAmount\": \"\",\n \"PaidAmount\": \"\",\n \"MinimumAmountToDeliver\": \"\",\n \"MaximumCashBackAmount\": \"\",\n \"MinimumSplitAmount\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"PaymentData\": {\n \"PaymentType\": \"\",\n \"SplitPaymentFlag\": false,\n \"RequestedValidityDate\": \"\",\n \"CardAcquisitionReference\": {},\n \"Instalment\": {\n \"InstalmentType\": \"\",\n \"SequenceNumber\": 0,\n \"PlanID\": \"\",\n \"Period\": 0,\n \"PeriodUnit\": \"\",\n \"FirstPaymentDate\": \"\",\n \"TotalNbOfPayments\": 0,\n \"CumulativeAmount\": \"\",\n \"FirstAmount\": \"\",\n \"Charges\": \"\"\n },\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {}\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyData\": [\n {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/payment"
payload := strings.NewReader("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"PaymentTransaction\": {\n \"AmountsReq\": {\n \"Currency\": \"\",\n \"RequestedAmount\": \"\",\n \"CashBackAmount\": \"\",\n \"TipAmount\": \"\",\n \"PaidAmount\": \"\",\n \"MinimumAmountToDeliver\": \"\",\n \"MaximumCashBackAmount\": \"\",\n \"MinimumSplitAmount\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"PaymentData\": {\n \"PaymentType\": \"\",\n \"SplitPaymentFlag\": false,\n \"RequestedValidityDate\": \"\",\n \"CardAcquisitionReference\": {},\n \"Instalment\": {\n \"InstalmentType\": \"\",\n \"SequenceNumber\": 0,\n \"PlanID\": \"\",\n \"Period\": 0,\n \"PeriodUnit\": \"\",\n \"FirstPaymentDate\": \"\",\n \"TotalNbOfPayments\": 0,\n \"CumulativeAmount\": \"\",\n \"FirstAmount\": \"\",\n \"Charges\": \"\"\n },\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {}\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyData\": [\n {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\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(res)
fmt.Println(string(body))
}
POST /baseUrl/payment HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 4662
{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"PaymentTransaction": {
"AmountsReq": {
"Currency": "",
"RequestedAmount": "",
"CashBackAmount": "",
"TipAmount": "",
"PaidAmount": "",
"MinimumAmountToDeliver": "",
"MaximumCashBackAmount": "",
"MinimumSplitAmount": ""
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"TransactionConditions": {
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
},
"SaleItem": [
{
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
]
},
"PaymentData": {
"PaymentType": "",
"SplitPaymentFlag": false,
"RequestedValidityDate": "",
"CardAcquisitionReference": {},
"Instalment": {
"InstalmentType": "",
"SequenceNumber": 0,
"PlanID": "",
"Period": 0,
"PeriodUnit": "",
"FirstPaymentDate": "",
"TotalNbOfPayments": 0,
"CumulativeAmount": "",
"FirstAmount": "",
"Charges": ""
},
"CustomerOrder": {
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
},
"PaymentInstrumentData": {
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": {
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": {
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
{
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
}
]
},
"AllowedProductCode": [],
"AllowedProduct": [
{
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
],
"PaymentToken": {
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
},
"CustomerOrder": [
{}
]
},
"CheckData": {
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": {},
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
},
"MobileData": {
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": {
"GeographicCoordinates": {
"Latitude": "",
"Longitude": ""
},
"UTMCoordinates": {
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
}
},
"ProtectedMobileData": "",
"SensitiveMobileData": {
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
}
},
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
}
}
},
"LoyaltyData": [
{
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
},
"LoyaltyAmount": {
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
}
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/payment")
.setHeader("content-type", "application/json")
.setBody("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"PaymentTransaction\": {\n \"AmountsReq\": {\n \"Currency\": \"\",\n \"RequestedAmount\": \"\",\n \"CashBackAmount\": \"\",\n \"TipAmount\": \"\",\n \"PaidAmount\": \"\",\n \"MinimumAmountToDeliver\": \"\",\n \"MaximumCashBackAmount\": \"\",\n \"MinimumSplitAmount\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"PaymentData\": {\n \"PaymentType\": \"\",\n \"SplitPaymentFlag\": false,\n \"RequestedValidityDate\": \"\",\n \"CardAcquisitionReference\": {},\n \"Instalment\": {\n \"InstalmentType\": \"\",\n \"SequenceNumber\": 0,\n \"PlanID\": \"\",\n \"Period\": 0,\n \"PeriodUnit\": \"\",\n \"FirstPaymentDate\": \"\",\n \"TotalNbOfPayments\": 0,\n \"CumulativeAmount\": \"\",\n \"FirstAmount\": \"\",\n \"Charges\": \"\"\n },\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {}\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyData\": [\n {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/payment"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"PaymentTransaction\": {\n \"AmountsReq\": {\n \"Currency\": \"\",\n \"RequestedAmount\": \"\",\n \"CashBackAmount\": \"\",\n \"TipAmount\": \"\",\n \"PaidAmount\": \"\",\n \"MinimumAmountToDeliver\": \"\",\n \"MaximumCashBackAmount\": \"\",\n \"MinimumSplitAmount\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"PaymentData\": {\n \"PaymentType\": \"\",\n \"SplitPaymentFlag\": false,\n \"RequestedValidityDate\": \"\",\n \"CardAcquisitionReference\": {},\n \"Instalment\": {\n \"InstalmentType\": \"\",\n \"SequenceNumber\": 0,\n \"PlanID\": \"\",\n \"Period\": 0,\n \"PeriodUnit\": \"\",\n \"FirstPaymentDate\": \"\",\n \"TotalNbOfPayments\": 0,\n \"CumulativeAmount\": \"\",\n \"FirstAmount\": \"\",\n \"Charges\": \"\"\n },\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {}\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyData\": [\n {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"PaymentTransaction\": {\n \"AmountsReq\": {\n \"Currency\": \"\",\n \"RequestedAmount\": \"\",\n \"CashBackAmount\": \"\",\n \"TipAmount\": \"\",\n \"PaidAmount\": \"\",\n \"MinimumAmountToDeliver\": \"\",\n \"MaximumCashBackAmount\": \"\",\n \"MinimumSplitAmount\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"PaymentData\": {\n \"PaymentType\": \"\",\n \"SplitPaymentFlag\": false,\n \"RequestedValidityDate\": \"\",\n \"CardAcquisitionReference\": {},\n \"Instalment\": {\n \"InstalmentType\": \"\",\n \"SequenceNumber\": 0,\n \"PlanID\": \"\",\n \"Period\": 0,\n \"PeriodUnit\": \"\",\n \"FirstPaymentDate\": \"\",\n \"TotalNbOfPayments\": 0,\n \"CumulativeAmount\": \"\",\n \"FirstAmount\": \"\",\n \"Charges\": \"\"\n },\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {}\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyData\": [\n {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/payment")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/payment")
.header("content-type", "application/json")
.body("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"PaymentTransaction\": {\n \"AmountsReq\": {\n \"Currency\": \"\",\n \"RequestedAmount\": \"\",\n \"CashBackAmount\": \"\",\n \"TipAmount\": \"\",\n \"PaidAmount\": \"\",\n \"MinimumAmountToDeliver\": \"\",\n \"MaximumCashBackAmount\": \"\",\n \"MinimumSplitAmount\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"PaymentData\": {\n \"PaymentType\": \"\",\n \"SplitPaymentFlag\": false,\n \"RequestedValidityDate\": \"\",\n \"CardAcquisitionReference\": {},\n \"Instalment\": {\n \"InstalmentType\": \"\",\n \"SequenceNumber\": 0,\n \"PlanID\": \"\",\n \"Period\": 0,\n \"PeriodUnit\": \"\",\n \"FirstPaymentDate\": \"\",\n \"TotalNbOfPayments\": 0,\n \"CumulativeAmount\": \"\",\n \"FirstAmount\": \"\",\n \"Charges\": \"\"\n },\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {}\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyData\": [\n {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n ]\n}")
.asString();
const data = JSON.stringify({
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {
TransactionID: '',
TimeStamp: ''
},
SaleReferenceID: '',
SaleTerminalData: {
TotalsGroupID: ''
},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {
StatementReference: ''
}
},
PaymentTransaction: {
AmountsReq: {
Currency: '',
RequestedAmount: '',
CashBackAmount: '',
TipAmount: '',
PaidAmount: '',
MinimumAmountToDeliver: '',
MaximumCashBackAmount: '',
MinimumSplitAmount: ''
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
TransactionConditions: {
AllowedPaymentBrand: [],
AcquirerID: [],
DebitPreferredFlag: false,
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceOnlineFlag: false,
ForceEntryMode: [],
MerchantCategoryCode: ''
},
SaleItem: [
{
ItemID: 0,
ProductCode: 0,
EanUpc: 0,
UnitOfMeasure: '',
Quantity: '',
UnitPrice: '',
ItemAmount: '',
TaxCode: 0,
SaleChannel: 0,
ProductLabel: '',
AdditionalProductInfo: ''
}
]
},
PaymentData: {
PaymentType: '',
SplitPaymentFlag: false,
RequestedValidityDate: '',
CardAcquisitionReference: {},
Instalment: {
InstalmentType: '',
SequenceNumber: 0,
PlanID: '',
Period: 0,
PeriodUnit: '',
FirstPaymentDate: '',
TotalNbOfPayments: 0,
CumulativeAmount: '',
FirstAmount: '',
Charges: ''
},
CustomerOrder: {
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
},
PaymentInstrumentData: {
PaymentInstrumentType: '',
ProtectedCardData: '',
CardData: {
PaymentBrand: '',
MaskedPan: '',
PaymentAccountRef: '',
EntryMode: [],
CardCountryCode: 0,
ProtectedCardData: '',
SensitiveCardData: {
PAN: 0,
CardSeqNumb: 0,
ExpiryDate: 0,
TrackData: [
{
TrackNumb: 0,
TrackFormat: '',
TrackValue: ''
}
]
},
AllowedProductCode: [],
AllowedProduct: [
{
ProductCode: 0,
EanUpc: 0,
ProductLabel: '',
AdditionalProductInfo: ''
}
],
PaymentToken: {
TokenRequestedType: '',
TokenValue: '',
ExpiryDateTime: ''
},
CustomerOrder: [
{}
]
},
CheckData: {
BankID: '',
AccountNumber: '',
CheckNumber: '',
TrackData: {},
CheckCardNumber: '',
TypeCode: '',
Country: ''
},
MobileData: {
MobileCountryCode: 0,
MobileNetworkCode: 0,
MaskedMSISDN: 0,
Geolocation: {
GeographicCoordinates: {
Latitude: '',
Longitude: ''
},
UTMCoordinates: {
UTMZone: '',
UTMEastward: '',
UTMNorthward: ''
}
},
ProtectedMobileData: '',
SensitiveMobileData: {
MSISDN: 0,
IMSI: 0,
IMEI: 0
}
},
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
}
}
},
LoyaltyData: [
{
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
},
LoyaltyAmount: {
LoyaltyUnit: '',
Currency: '',
AmountValue: ''
}
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/payment');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/payment',
headers: {'content-type': 'application/json'},
data: {
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
PaymentTransaction: {
AmountsReq: {
Currency: '',
RequestedAmount: '',
CashBackAmount: '',
TipAmount: '',
PaidAmount: '',
MinimumAmountToDeliver: '',
MaximumCashBackAmount: '',
MinimumSplitAmount: ''
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
TransactionConditions: {
AllowedPaymentBrand: [],
AcquirerID: [],
DebitPreferredFlag: false,
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceOnlineFlag: false,
ForceEntryMode: [],
MerchantCategoryCode: ''
},
SaleItem: [
{
ItemID: 0,
ProductCode: 0,
EanUpc: 0,
UnitOfMeasure: '',
Quantity: '',
UnitPrice: '',
ItemAmount: '',
TaxCode: 0,
SaleChannel: 0,
ProductLabel: '',
AdditionalProductInfo: ''
}
]
},
PaymentData: {
PaymentType: '',
SplitPaymentFlag: false,
RequestedValidityDate: '',
CardAcquisitionReference: {},
Instalment: {
InstalmentType: '',
SequenceNumber: 0,
PlanID: '',
Period: 0,
PeriodUnit: '',
FirstPaymentDate: '',
TotalNbOfPayments: 0,
CumulativeAmount: '',
FirstAmount: '',
Charges: ''
},
CustomerOrder: {
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
},
PaymentInstrumentData: {
PaymentInstrumentType: '',
ProtectedCardData: '',
CardData: {
PaymentBrand: '',
MaskedPan: '',
PaymentAccountRef: '',
EntryMode: [],
CardCountryCode: 0,
ProtectedCardData: '',
SensitiveCardData: {
PAN: 0,
CardSeqNumb: 0,
ExpiryDate: 0,
TrackData: [{TrackNumb: 0, TrackFormat: '', TrackValue: ''}]
},
AllowedProductCode: [],
AllowedProduct: [{ProductCode: 0, EanUpc: 0, ProductLabel: '', AdditionalProductInfo: ''}],
PaymentToken: {TokenRequestedType: '', TokenValue: '', ExpiryDateTime: ''},
CustomerOrder: [{}]
},
CheckData: {
BankID: '',
AccountNumber: '',
CheckNumber: '',
TrackData: {},
CheckCardNumber: '',
TypeCode: '',
Country: ''
},
MobileData: {
MobileCountryCode: 0,
MobileNetworkCode: 0,
MaskedMSISDN: 0,
Geolocation: {
GeographicCoordinates: {Latitude: '', Longitude: ''},
UTMCoordinates: {UTMZone: '', UTMEastward: '', UTMNorthward: ''}
},
ProtectedMobileData: '',
SensitiveMobileData: {MSISDN: 0, IMSI: 0, IMEI: 0}
},
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
}
}
},
LoyaltyData: [
{
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
},
LoyaltyAmount: {LoyaltyUnit: '', Currency: '', AmountValue: ''}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/payment';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"SaleData":{"OperatorID":"","OperatorLanguage":"","ShiftNumber":"","SaleTransactionID":{"TransactionID":"","TimeStamp":""},"SaleReferenceID":"","SaleTerminalData":{"TotalsGroupID":""},"TokenRequestedType":"","CustomerOrderID":"","CustomerOrderReq":[],"SaleToPOIData":"","SaleToAcquirerData":"","SaleToIssuerData":{"StatementReference":""}},"PaymentTransaction":{"AmountsReq":{"Currency":"","RequestedAmount":"","CashBackAmount":"","TipAmount":"","PaidAmount":"","MinimumAmountToDeliver":"","MaximumCashBackAmount":"","MinimumSplitAmount":""},"OriginalPOITransaction":{"SaleID":"","POIID":"","POITransactionID":{},"ReuseCardDataFlag":false,"ApprovalCode":"","AcquirerID":0,"AmountValue":"","HostTransactionID":{}},"TransactionConditions":{"AllowedPaymentBrand":[],"AcquirerID":[],"DebitPreferredFlag":false,"AllowedLoyaltyBrand":[],"LoyaltyHandling":"","ForceOnlineFlag":false,"ForceEntryMode":[],"MerchantCategoryCode":""},"SaleItem":[{"ItemID":0,"ProductCode":0,"EanUpc":0,"UnitOfMeasure":"","Quantity":"","UnitPrice":"","ItemAmount":"","TaxCode":0,"SaleChannel":0,"ProductLabel":"","AdditionalProductInfo":""}]},"PaymentData":{"PaymentType":"","SplitPaymentFlag":false,"RequestedValidityDate":"","CardAcquisitionReference":{},"Instalment":{"InstalmentType":"","SequenceNumber":0,"PlanID":"","Period":0,"PeriodUnit":"","FirstPaymentDate":"","TotalNbOfPayments":0,"CumulativeAmount":"","FirstAmount":"","Charges":""},"CustomerOrder":{"CustomerOrderID":"","SaleReferenceID":"","OpenOrderState":false,"StartDate":"","EndDate":"","ForecastedAmount":"","CurrentAmount":"","Currency":"","AccessedBy":"","AdditionalInformation":""},"PaymentInstrumentData":{"PaymentInstrumentType":"","ProtectedCardData":"","CardData":{"PaymentBrand":"","MaskedPan":"","PaymentAccountRef":"","EntryMode":[],"CardCountryCode":0,"ProtectedCardData":"","SensitiveCardData":{"PAN":0,"CardSeqNumb":0,"ExpiryDate":0,"TrackData":[{"TrackNumb":0,"TrackFormat":"","TrackValue":""}]},"AllowedProductCode":[],"AllowedProduct":[{"ProductCode":0,"EanUpc":0,"ProductLabel":"","AdditionalProductInfo":""}],"PaymentToken":{"TokenRequestedType":"","TokenValue":"","ExpiryDateTime":""},"CustomerOrder":[{}]},"CheckData":{"BankID":"","AccountNumber":"","CheckNumber":"","TrackData":{},"CheckCardNumber":"","TypeCode":"","Country":""},"MobileData":{"MobileCountryCode":0,"MobileNetworkCode":0,"MaskedMSISDN":0,"Geolocation":{"GeographicCoordinates":{"Latitude":"","Longitude":""},"UTMCoordinates":{"UTMZone":"","UTMEastward":"","UTMNorthward":""}},"ProtectedMobileData":"","SensitiveMobileData":{"MSISDN":0,"IMSI":0,"IMEI":0}},"StoredValueAccountID":{"StoredValueAccountType":"","StoredValueProvider":"","OwnerName":"","ExpiryDate":0,"EntryMode":[],"IdentificationType":"","StoredValueID":""}}},"LoyaltyData":[{"CardAcquisitionReference":{},"LoyaltyAccountID":{"EntryMode":[],"IdentificationType":"","IdentificationSupport":"","LoyaltyID":""},"LoyaltyAmount":{"LoyaltyUnit":"","Currency":"","AmountValue":""}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/payment',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "SaleData": {\n "OperatorID": "",\n "OperatorLanguage": "",\n "ShiftNumber": "",\n "SaleTransactionID": {\n "TransactionID": "",\n "TimeStamp": ""\n },\n "SaleReferenceID": "",\n "SaleTerminalData": {\n "TotalsGroupID": ""\n },\n "TokenRequestedType": "",\n "CustomerOrderID": "",\n "CustomerOrderReq": [],\n "SaleToPOIData": "",\n "SaleToAcquirerData": "",\n "SaleToIssuerData": {\n "StatementReference": ""\n }\n },\n "PaymentTransaction": {\n "AmountsReq": {\n "Currency": "",\n "RequestedAmount": "",\n "CashBackAmount": "",\n "TipAmount": "",\n "PaidAmount": "",\n "MinimumAmountToDeliver": "",\n "MaximumCashBackAmount": "",\n "MinimumSplitAmount": ""\n },\n "OriginalPOITransaction": {\n "SaleID": "",\n "POIID": "",\n "POITransactionID": {},\n "ReuseCardDataFlag": false,\n "ApprovalCode": "",\n "AcquirerID": 0,\n "AmountValue": "",\n "HostTransactionID": {}\n },\n "TransactionConditions": {\n "AllowedPaymentBrand": [],\n "AcquirerID": [],\n "DebitPreferredFlag": false,\n "AllowedLoyaltyBrand": [],\n "LoyaltyHandling": "",\n "ForceOnlineFlag": false,\n "ForceEntryMode": [],\n "MerchantCategoryCode": ""\n },\n "SaleItem": [\n {\n "ItemID": 0,\n "ProductCode": 0,\n "EanUpc": 0,\n "UnitOfMeasure": "",\n "Quantity": "",\n "UnitPrice": "",\n "ItemAmount": "",\n "TaxCode": 0,\n "SaleChannel": 0,\n "ProductLabel": "",\n "AdditionalProductInfo": ""\n }\n ]\n },\n "PaymentData": {\n "PaymentType": "",\n "SplitPaymentFlag": false,\n "RequestedValidityDate": "",\n "CardAcquisitionReference": {},\n "Instalment": {\n "InstalmentType": "",\n "SequenceNumber": 0,\n "PlanID": "",\n "Period": 0,\n "PeriodUnit": "",\n "FirstPaymentDate": "",\n "TotalNbOfPayments": 0,\n "CumulativeAmount": "",\n "FirstAmount": "",\n "Charges": ""\n },\n "CustomerOrder": {\n "CustomerOrderID": "",\n "SaleReferenceID": "",\n "OpenOrderState": false,\n "StartDate": "",\n "EndDate": "",\n "ForecastedAmount": "",\n "CurrentAmount": "",\n "Currency": "",\n "AccessedBy": "",\n "AdditionalInformation": ""\n },\n "PaymentInstrumentData": {\n "PaymentInstrumentType": "",\n "ProtectedCardData": "",\n "CardData": {\n "PaymentBrand": "",\n "MaskedPan": "",\n "PaymentAccountRef": "",\n "EntryMode": [],\n "CardCountryCode": 0,\n "ProtectedCardData": "",\n "SensitiveCardData": {\n "PAN": 0,\n "CardSeqNumb": 0,\n "ExpiryDate": 0,\n "TrackData": [\n {\n "TrackNumb": 0,\n "TrackFormat": "",\n "TrackValue": ""\n }\n ]\n },\n "AllowedProductCode": [],\n "AllowedProduct": [\n {\n "ProductCode": 0,\n "EanUpc": 0,\n "ProductLabel": "",\n "AdditionalProductInfo": ""\n }\n ],\n "PaymentToken": {\n "TokenRequestedType": "",\n "TokenValue": "",\n "ExpiryDateTime": ""\n },\n "CustomerOrder": [\n {}\n ]\n },\n "CheckData": {\n "BankID": "",\n "AccountNumber": "",\n "CheckNumber": "",\n "TrackData": {},\n "CheckCardNumber": "",\n "TypeCode": "",\n "Country": ""\n },\n "MobileData": {\n "MobileCountryCode": 0,\n "MobileNetworkCode": 0,\n "MaskedMSISDN": 0,\n "Geolocation": {\n "GeographicCoordinates": {\n "Latitude": "",\n "Longitude": ""\n },\n "UTMCoordinates": {\n "UTMZone": "",\n "UTMEastward": "",\n "UTMNorthward": ""\n }\n },\n "ProtectedMobileData": "",\n "SensitiveMobileData": {\n "MSISDN": 0,\n "IMSI": 0,\n "IMEI": 0\n }\n },\n "StoredValueAccountID": {\n "StoredValueAccountType": "",\n "StoredValueProvider": "",\n "OwnerName": "",\n "ExpiryDate": 0,\n "EntryMode": [],\n "IdentificationType": "",\n "StoredValueID": ""\n }\n }\n },\n "LoyaltyData": [\n {\n "CardAcquisitionReference": {},\n "LoyaltyAccountID": {\n "EntryMode": [],\n "IdentificationType": "",\n "IdentificationSupport": "",\n "LoyaltyID": ""\n },\n "LoyaltyAmount": {\n "LoyaltyUnit": "",\n "Currency": "",\n "AmountValue": ""\n }\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"PaymentTransaction\": {\n \"AmountsReq\": {\n \"Currency\": \"\",\n \"RequestedAmount\": \"\",\n \"CashBackAmount\": \"\",\n \"TipAmount\": \"\",\n \"PaidAmount\": \"\",\n \"MinimumAmountToDeliver\": \"\",\n \"MaximumCashBackAmount\": \"\",\n \"MinimumSplitAmount\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"PaymentData\": {\n \"PaymentType\": \"\",\n \"SplitPaymentFlag\": false,\n \"RequestedValidityDate\": \"\",\n \"CardAcquisitionReference\": {},\n \"Instalment\": {\n \"InstalmentType\": \"\",\n \"SequenceNumber\": 0,\n \"PlanID\": \"\",\n \"Period\": 0,\n \"PeriodUnit\": \"\",\n \"FirstPaymentDate\": \"\",\n \"TotalNbOfPayments\": 0,\n \"CumulativeAmount\": \"\",\n \"FirstAmount\": \"\",\n \"Charges\": \"\"\n },\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {}\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyData\": [\n {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/payment")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/payment',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
PaymentTransaction: {
AmountsReq: {
Currency: '',
RequestedAmount: '',
CashBackAmount: '',
TipAmount: '',
PaidAmount: '',
MinimumAmountToDeliver: '',
MaximumCashBackAmount: '',
MinimumSplitAmount: ''
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
TransactionConditions: {
AllowedPaymentBrand: [],
AcquirerID: [],
DebitPreferredFlag: false,
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceOnlineFlag: false,
ForceEntryMode: [],
MerchantCategoryCode: ''
},
SaleItem: [
{
ItemID: 0,
ProductCode: 0,
EanUpc: 0,
UnitOfMeasure: '',
Quantity: '',
UnitPrice: '',
ItemAmount: '',
TaxCode: 0,
SaleChannel: 0,
ProductLabel: '',
AdditionalProductInfo: ''
}
]
},
PaymentData: {
PaymentType: '',
SplitPaymentFlag: false,
RequestedValidityDate: '',
CardAcquisitionReference: {},
Instalment: {
InstalmentType: '',
SequenceNumber: 0,
PlanID: '',
Period: 0,
PeriodUnit: '',
FirstPaymentDate: '',
TotalNbOfPayments: 0,
CumulativeAmount: '',
FirstAmount: '',
Charges: ''
},
CustomerOrder: {
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
},
PaymentInstrumentData: {
PaymentInstrumentType: '',
ProtectedCardData: '',
CardData: {
PaymentBrand: '',
MaskedPan: '',
PaymentAccountRef: '',
EntryMode: [],
CardCountryCode: 0,
ProtectedCardData: '',
SensitiveCardData: {
PAN: 0,
CardSeqNumb: 0,
ExpiryDate: 0,
TrackData: [{TrackNumb: 0, TrackFormat: '', TrackValue: ''}]
},
AllowedProductCode: [],
AllowedProduct: [{ProductCode: 0, EanUpc: 0, ProductLabel: '', AdditionalProductInfo: ''}],
PaymentToken: {TokenRequestedType: '', TokenValue: '', ExpiryDateTime: ''},
CustomerOrder: [{}]
},
CheckData: {
BankID: '',
AccountNumber: '',
CheckNumber: '',
TrackData: {},
CheckCardNumber: '',
TypeCode: '',
Country: ''
},
MobileData: {
MobileCountryCode: 0,
MobileNetworkCode: 0,
MaskedMSISDN: 0,
Geolocation: {
GeographicCoordinates: {Latitude: '', Longitude: ''},
UTMCoordinates: {UTMZone: '', UTMEastward: '', UTMNorthward: ''}
},
ProtectedMobileData: '',
SensitiveMobileData: {MSISDN: 0, IMSI: 0, IMEI: 0}
},
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
}
}
},
LoyaltyData: [
{
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
},
LoyaltyAmount: {LoyaltyUnit: '', Currency: '', AmountValue: ''}
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/payment',
headers: {'content-type': 'application/json'},
body: {
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
PaymentTransaction: {
AmountsReq: {
Currency: '',
RequestedAmount: '',
CashBackAmount: '',
TipAmount: '',
PaidAmount: '',
MinimumAmountToDeliver: '',
MaximumCashBackAmount: '',
MinimumSplitAmount: ''
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
TransactionConditions: {
AllowedPaymentBrand: [],
AcquirerID: [],
DebitPreferredFlag: false,
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceOnlineFlag: false,
ForceEntryMode: [],
MerchantCategoryCode: ''
},
SaleItem: [
{
ItemID: 0,
ProductCode: 0,
EanUpc: 0,
UnitOfMeasure: '',
Quantity: '',
UnitPrice: '',
ItemAmount: '',
TaxCode: 0,
SaleChannel: 0,
ProductLabel: '',
AdditionalProductInfo: ''
}
]
},
PaymentData: {
PaymentType: '',
SplitPaymentFlag: false,
RequestedValidityDate: '',
CardAcquisitionReference: {},
Instalment: {
InstalmentType: '',
SequenceNumber: 0,
PlanID: '',
Period: 0,
PeriodUnit: '',
FirstPaymentDate: '',
TotalNbOfPayments: 0,
CumulativeAmount: '',
FirstAmount: '',
Charges: ''
},
CustomerOrder: {
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
},
PaymentInstrumentData: {
PaymentInstrumentType: '',
ProtectedCardData: '',
CardData: {
PaymentBrand: '',
MaskedPan: '',
PaymentAccountRef: '',
EntryMode: [],
CardCountryCode: 0,
ProtectedCardData: '',
SensitiveCardData: {
PAN: 0,
CardSeqNumb: 0,
ExpiryDate: 0,
TrackData: [{TrackNumb: 0, TrackFormat: '', TrackValue: ''}]
},
AllowedProductCode: [],
AllowedProduct: [{ProductCode: 0, EanUpc: 0, ProductLabel: '', AdditionalProductInfo: ''}],
PaymentToken: {TokenRequestedType: '', TokenValue: '', ExpiryDateTime: ''},
CustomerOrder: [{}]
},
CheckData: {
BankID: '',
AccountNumber: '',
CheckNumber: '',
TrackData: {},
CheckCardNumber: '',
TypeCode: '',
Country: ''
},
MobileData: {
MobileCountryCode: 0,
MobileNetworkCode: 0,
MaskedMSISDN: 0,
Geolocation: {
GeographicCoordinates: {Latitude: '', Longitude: ''},
UTMCoordinates: {UTMZone: '', UTMEastward: '', UTMNorthward: ''}
},
ProtectedMobileData: '',
SensitiveMobileData: {MSISDN: 0, IMSI: 0, IMEI: 0}
},
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
}
}
},
LoyaltyData: [
{
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
},
LoyaltyAmount: {LoyaltyUnit: '', Currency: '', AmountValue: ''}
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/payment');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {
TransactionID: '',
TimeStamp: ''
},
SaleReferenceID: '',
SaleTerminalData: {
TotalsGroupID: ''
},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {
StatementReference: ''
}
},
PaymentTransaction: {
AmountsReq: {
Currency: '',
RequestedAmount: '',
CashBackAmount: '',
TipAmount: '',
PaidAmount: '',
MinimumAmountToDeliver: '',
MaximumCashBackAmount: '',
MinimumSplitAmount: ''
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
TransactionConditions: {
AllowedPaymentBrand: [],
AcquirerID: [],
DebitPreferredFlag: false,
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceOnlineFlag: false,
ForceEntryMode: [],
MerchantCategoryCode: ''
},
SaleItem: [
{
ItemID: 0,
ProductCode: 0,
EanUpc: 0,
UnitOfMeasure: '',
Quantity: '',
UnitPrice: '',
ItemAmount: '',
TaxCode: 0,
SaleChannel: 0,
ProductLabel: '',
AdditionalProductInfo: ''
}
]
},
PaymentData: {
PaymentType: '',
SplitPaymentFlag: false,
RequestedValidityDate: '',
CardAcquisitionReference: {},
Instalment: {
InstalmentType: '',
SequenceNumber: 0,
PlanID: '',
Period: 0,
PeriodUnit: '',
FirstPaymentDate: '',
TotalNbOfPayments: 0,
CumulativeAmount: '',
FirstAmount: '',
Charges: ''
},
CustomerOrder: {
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
},
PaymentInstrumentData: {
PaymentInstrumentType: '',
ProtectedCardData: '',
CardData: {
PaymentBrand: '',
MaskedPan: '',
PaymentAccountRef: '',
EntryMode: [],
CardCountryCode: 0,
ProtectedCardData: '',
SensitiveCardData: {
PAN: 0,
CardSeqNumb: 0,
ExpiryDate: 0,
TrackData: [
{
TrackNumb: 0,
TrackFormat: '',
TrackValue: ''
}
]
},
AllowedProductCode: [],
AllowedProduct: [
{
ProductCode: 0,
EanUpc: 0,
ProductLabel: '',
AdditionalProductInfo: ''
}
],
PaymentToken: {
TokenRequestedType: '',
TokenValue: '',
ExpiryDateTime: ''
},
CustomerOrder: [
{}
]
},
CheckData: {
BankID: '',
AccountNumber: '',
CheckNumber: '',
TrackData: {},
CheckCardNumber: '',
TypeCode: '',
Country: ''
},
MobileData: {
MobileCountryCode: 0,
MobileNetworkCode: 0,
MaskedMSISDN: 0,
Geolocation: {
GeographicCoordinates: {
Latitude: '',
Longitude: ''
},
UTMCoordinates: {
UTMZone: '',
UTMEastward: '',
UTMNorthward: ''
}
},
ProtectedMobileData: '',
SensitiveMobileData: {
MSISDN: 0,
IMSI: 0,
IMEI: 0
}
},
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
}
}
},
LoyaltyData: [
{
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
},
LoyaltyAmount: {
LoyaltyUnit: '',
Currency: '',
AmountValue: ''
}
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/payment',
headers: {'content-type': 'application/json'},
data: {
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
PaymentTransaction: {
AmountsReq: {
Currency: '',
RequestedAmount: '',
CashBackAmount: '',
TipAmount: '',
PaidAmount: '',
MinimumAmountToDeliver: '',
MaximumCashBackAmount: '',
MinimumSplitAmount: ''
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
TransactionConditions: {
AllowedPaymentBrand: [],
AcquirerID: [],
DebitPreferredFlag: false,
AllowedLoyaltyBrand: [],
LoyaltyHandling: '',
ForceOnlineFlag: false,
ForceEntryMode: [],
MerchantCategoryCode: ''
},
SaleItem: [
{
ItemID: 0,
ProductCode: 0,
EanUpc: 0,
UnitOfMeasure: '',
Quantity: '',
UnitPrice: '',
ItemAmount: '',
TaxCode: 0,
SaleChannel: 0,
ProductLabel: '',
AdditionalProductInfo: ''
}
]
},
PaymentData: {
PaymentType: '',
SplitPaymentFlag: false,
RequestedValidityDate: '',
CardAcquisitionReference: {},
Instalment: {
InstalmentType: '',
SequenceNumber: 0,
PlanID: '',
Period: 0,
PeriodUnit: '',
FirstPaymentDate: '',
TotalNbOfPayments: 0,
CumulativeAmount: '',
FirstAmount: '',
Charges: ''
},
CustomerOrder: {
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
},
PaymentInstrumentData: {
PaymentInstrumentType: '',
ProtectedCardData: '',
CardData: {
PaymentBrand: '',
MaskedPan: '',
PaymentAccountRef: '',
EntryMode: [],
CardCountryCode: 0,
ProtectedCardData: '',
SensitiveCardData: {
PAN: 0,
CardSeqNumb: 0,
ExpiryDate: 0,
TrackData: [{TrackNumb: 0, TrackFormat: '', TrackValue: ''}]
},
AllowedProductCode: [],
AllowedProduct: [{ProductCode: 0, EanUpc: 0, ProductLabel: '', AdditionalProductInfo: ''}],
PaymentToken: {TokenRequestedType: '', TokenValue: '', ExpiryDateTime: ''},
CustomerOrder: [{}]
},
CheckData: {
BankID: '',
AccountNumber: '',
CheckNumber: '',
TrackData: {},
CheckCardNumber: '',
TypeCode: '',
Country: ''
},
MobileData: {
MobileCountryCode: 0,
MobileNetworkCode: 0,
MaskedMSISDN: 0,
Geolocation: {
GeographicCoordinates: {Latitude: '', Longitude: ''},
UTMCoordinates: {UTMZone: '', UTMEastward: '', UTMNorthward: ''}
},
ProtectedMobileData: '',
SensitiveMobileData: {MSISDN: 0, IMSI: 0, IMEI: 0}
},
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
}
}
},
LoyaltyData: [
{
CardAcquisitionReference: {},
LoyaltyAccountID: {
EntryMode: [],
IdentificationType: '',
IdentificationSupport: '',
LoyaltyID: ''
},
LoyaltyAmount: {LoyaltyUnit: '', Currency: '', AmountValue: ''}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/payment';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"SaleData":{"OperatorID":"","OperatorLanguage":"","ShiftNumber":"","SaleTransactionID":{"TransactionID":"","TimeStamp":""},"SaleReferenceID":"","SaleTerminalData":{"TotalsGroupID":""},"TokenRequestedType":"","CustomerOrderID":"","CustomerOrderReq":[],"SaleToPOIData":"","SaleToAcquirerData":"","SaleToIssuerData":{"StatementReference":""}},"PaymentTransaction":{"AmountsReq":{"Currency":"","RequestedAmount":"","CashBackAmount":"","TipAmount":"","PaidAmount":"","MinimumAmountToDeliver":"","MaximumCashBackAmount":"","MinimumSplitAmount":""},"OriginalPOITransaction":{"SaleID":"","POIID":"","POITransactionID":{},"ReuseCardDataFlag":false,"ApprovalCode":"","AcquirerID":0,"AmountValue":"","HostTransactionID":{}},"TransactionConditions":{"AllowedPaymentBrand":[],"AcquirerID":[],"DebitPreferredFlag":false,"AllowedLoyaltyBrand":[],"LoyaltyHandling":"","ForceOnlineFlag":false,"ForceEntryMode":[],"MerchantCategoryCode":""},"SaleItem":[{"ItemID":0,"ProductCode":0,"EanUpc":0,"UnitOfMeasure":"","Quantity":"","UnitPrice":"","ItemAmount":"","TaxCode":0,"SaleChannel":0,"ProductLabel":"","AdditionalProductInfo":""}]},"PaymentData":{"PaymentType":"","SplitPaymentFlag":false,"RequestedValidityDate":"","CardAcquisitionReference":{},"Instalment":{"InstalmentType":"","SequenceNumber":0,"PlanID":"","Period":0,"PeriodUnit":"","FirstPaymentDate":"","TotalNbOfPayments":0,"CumulativeAmount":"","FirstAmount":"","Charges":""},"CustomerOrder":{"CustomerOrderID":"","SaleReferenceID":"","OpenOrderState":false,"StartDate":"","EndDate":"","ForecastedAmount":"","CurrentAmount":"","Currency":"","AccessedBy":"","AdditionalInformation":""},"PaymentInstrumentData":{"PaymentInstrumentType":"","ProtectedCardData":"","CardData":{"PaymentBrand":"","MaskedPan":"","PaymentAccountRef":"","EntryMode":[],"CardCountryCode":0,"ProtectedCardData":"","SensitiveCardData":{"PAN":0,"CardSeqNumb":0,"ExpiryDate":0,"TrackData":[{"TrackNumb":0,"TrackFormat":"","TrackValue":""}]},"AllowedProductCode":[],"AllowedProduct":[{"ProductCode":0,"EanUpc":0,"ProductLabel":"","AdditionalProductInfo":""}],"PaymentToken":{"TokenRequestedType":"","TokenValue":"","ExpiryDateTime":""},"CustomerOrder":[{}]},"CheckData":{"BankID":"","AccountNumber":"","CheckNumber":"","TrackData":{},"CheckCardNumber":"","TypeCode":"","Country":""},"MobileData":{"MobileCountryCode":0,"MobileNetworkCode":0,"MaskedMSISDN":0,"Geolocation":{"GeographicCoordinates":{"Latitude":"","Longitude":""},"UTMCoordinates":{"UTMZone":"","UTMEastward":"","UTMNorthward":""}},"ProtectedMobileData":"","SensitiveMobileData":{"MSISDN":0,"IMSI":0,"IMEI":0}},"StoredValueAccountID":{"StoredValueAccountType":"","StoredValueProvider":"","OwnerName":"","ExpiryDate":0,"EntryMode":[],"IdentificationType":"","StoredValueID":""}}},"LoyaltyData":[{"CardAcquisitionReference":{},"LoyaltyAccountID":{"EntryMode":[],"IdentificationType":"","IdentificationSupport":"","LoyaltyID":""},"LoyaltyAmount":{"LoyaltyUnit":"","Currency":"","AmountValue":""}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"SaleData": @{ @"OperatorID": @"", @"OperatorLanguage": @"", @"ShiftNumber": @"", @"SaleTransactionID": @{ @"TransactionID": @"", @"TimeStamp": @"" }, @"SaleReferenceID": @"", @"SaleTerminalData": @{ @"TotalsGroupID": @"" }, @"TokenRequestedType": @"", @"CustomerOrderID": @"", @"CustomerOrderReq": @[ ], @"SaleToPOIData": @"", @"SaleToAcquirerData": @"", @"SaleToIssuerData": @{ @"StatementReference": @"" } },
@"PaymentTransaction": @{ @"AmountsReq": @{ @"Currency": @"", @"RequestedAmount": @"", @"CashBackAmount": @"", @"TipAmount": @"", @"PaidAmount": @"", @"MinimumAmountToDeliver": @"", @"MaximumCashBackAmount": @"", @"MinimumSplitAmount": @"" }, @"OriginalPOITransaction": @{ @"SaleID": @"", @"POIID": @"", @"POITransactionID": @{ }, @"ReuseCardDataFlag": @NO, @"ApprovalCode": @"", @"AcquirerID": @0, @"AmountValue": @"", @"HostTransactionID": @{ } }, @"TransactionConditions": @{ @"AllowedPaymentBrand": @[ ], @"AcquirerID": @[ ], @"DebitPreferredFlag": @NO, @"AllowedLoyaltyBrand": @[ ], @"LoyaltyHandling": @"", @"ForceOnlineFlag": @NO, @"ForceEntryMode": @[ ], @"MerchantCategoryCode": @"" }, @"SaleItem": @[ @{ @"ItemID": @0, @"ProductCode": @0, @"EanUpc": @0, @"UnitOfMeasure": @"", @"Quantity": @"", @"UnitPrice": @"", @"ItemAmount": @"", @"TaxCode": @0, @"SaleChannel": @0, @"ProductLabel": @"", @"AdditionalProductInfo": @"" } ] },
@"PaymentData": @{ @"PaymentType": @"", @"SplitPaymentFlag": @NO, @"RequestedValidityDate": @"", @"CardAcquisitionReference": @{ }, @"Instalment": @{ @"InstalmentType": @"", @"SequenceNumber": @0, @"PlanID": @"", @"Period": @0, @"PeriodUnit": @"", @"FirstPaymentDate": @"", @"TotalNbOfPayments": @0, @"CumulativeAmount": @"", @"FirstAmount": @"", @"Charges": @"" }, @"CustomerOrder": @{ @"CustomerOrderID": @"", @"SaleReferenceID": @"", @"OpenOrderState": @NO, @"StartDate": @"", @"EndDate": @"", @"ForecastedAmount": @"", @"CurrentAmount": @"", @"Currency": @"", @"AccessedBy": @"", @"AdditionalInformation": @"" }, @"PaymentInstrumentData": @{ @"PaymentInstrumentType": @"", @"ProtectedCardData": @"", @"CardData": @{ @"PaymentBrand": @"", @"MaskedPan": @"", @"PaymentAccountRef": @"", @"EntryMode": @[ ], @"CardCountryCode": @0, @"ProtectedCardData": @"", @"SensitiveCardData": @{ @"PAN": @0, @"CardSeqNumb": @0, @"ExpiryDate": @0, @"TrackData": @[ @{ @"TrackNumb": @0, @"TrackFormat": @"", @"TrackValue": @"" } ] }, @"AllowedProductCode": @[ ], @"AllowedProduct": @[ @{ @"ProductCode": @0, @"EanUpc": @0, @"ProductLabel": @"", @"AdditionalProductInfo": @"" } ], @"PaymentToken": @{ @"TokenRequestedType": @"", @"TokenValue": @"", @"ExpiryDateTime": @"" }, @"CustomerOrder": @[ @{ } ] }, @"CheckData": @{ @"BankID": @"", @"AccountNumber": @"", @"CheckNumber": @"", @"TrackData": @{ }, @"CheckCardNumber": @"", @"TypeCode": @"", @"Country": @"" }, @"MobileData": @{ @"MobileCountryCode": @0, @"MobileNetworkCode": @0, @"MaskedMSISDN": @0, @"Geolocation": @{ @"GeographicCoordinates": @{ @"Latitude": @"", @"Longitude": @"" }, @"UTMCoordinates": @{ @"UTMZone": @"", @"UTMEastward": @"", @"UTMNorthward": @"" } }, @"ProtectedMobileData": @"", @"SensitiveMobileData": @{ @"MSISDN": @0, @"IMSI": @0, @"IMEI": @0 } }, @"StoredValueAccountID": @{ @"StoredValueAccountType": @"", @"StoredValueProvider": @"", @"OwnerName": @"", @"ExpiryDate": @0, @"EntryMode": @[ ], @"IdentificationType": @"", @"StoredValueID": @"" } } },
@"LoyaltyData": @[ @{ @"CardAcquisitionReference": @{ }, @"LoyaltyAccountID": @{ @"EntryMode": @[ ], @"IdentificationType": @"", @"IdentificationSupport": @"", @"LoyaltyID": @"" }, @"LoyaltyAmount": @{ @"LoyaltyUnit": @"", @"Currency": @"", @"AmountValue": @"" } } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/payment"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/payment" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"PaymentTransaction\": {\n \"AmountsReq\": {\n \"Currency\": \"\",\n \"RequestedAmount\": \"\",\n \"CashBackAmount\": \"\",\n \"TipAmount\": \"\",\n \"PaidAmount\": \"\",\n \"MinimumAmountToDeliver\": \"\",\n \"MaximumCashBackAmount\": \"\",\n \"MinimumSplitAmount\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"PaymentData\": {\n \"PaymentType\": \"\",\n \"SplitPaymentFlag\": false,\n \"RequestedValidityDate\": \"\",\n \"CardAcquisitionReference\": {},\n \"Instalment\": {\n \"InstalmentType\": \"\",\n \"SequenceNumber\": 0,\n \"PlanID\": \"\",\n \"Period\": 0,\n \"PeriodUnit\": \"\",\n \"FirstPaymentDate\": \"\",\n \"TotalNbOfPayments\": 0,\n \"CumulativeAmount\": \"\",\n \"FirstAmount\": \"\",\n \"Charges\": \"\"\n },\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {}\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyData\": [\n {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/payment",
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([
'SaleData' => [
'OperatorID' => '',
'OperatorLanguage' => '',
'ShiftNumber' => '',
'SaleTransactionID' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'SaleReferenceID' => '',
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TokenRequestedType' => '',
'CustomerOrderID' => '',
'CustomerOrderReq' => [
],
'SaleToPOIData' => '',
'SaleToAcquirerData' => '',
'SaleToIssuerData' => [
'StatementReference' => ''
]
],
'PaymentTransaction' => [
'AmountsReq' => [
'Currency' => '',
'RequestedAmount' => '',
'CashBackAmount' => '',
'TipAmount' => '',
'PaidAmount' => '',
'MinimumAmountToDeliver' => '',
'MaximumCashBackAmount' => '',
'MinimumSplitAmount' => ''
],
'OriginalPOITransaction' => [
'SaleID' => '',
'POIID' => '',
'POITransactionID' => [
],
'ReuseCardDataFlag' => null,
'ApprovalCode' => '',
'AcquirerID' => 0,
'AmountValue' => '',
'HostTransactionID' => [
]
],
'TransactionConditions' => [
'AllowedPaymentBrand' => [
],
'AcquirerID' => [
],
'DebitPreferredFlag' => null,
'AllowedLoyaltyBrand' => [
],
'LoyaltyHandling' => '',
'ForceOnlineFlag' => null,
'ForceEntryMode' => [
],
'MerchantCategoryCode' => ''
],
'SaleItem' => [
[
'ItemID' => 0,
'ProductCode' => 0,
'EanUpc' => 0,
'UnitOfMeasure' => '',
'Quantity' => '',
'UnitPrice' => '',
'ItemAmount' => '',
'TaxCode' => 0,
'SaleChannel' => 0,
'ProductLabel' => '',
'AdditionalProductInfo' => ''
]
]
],
'PaymentData' => [
'PaymentType' => '',
'SplitPaymentFlag' => null,
'RequestedValidityDate' => '',
'CardAcquisitionReference' => [
],
'Instalment' => [
'InstalmentType' => '',
'SequenceNumber' => 0,
'PlanID' => '',
'Period' => 0,
'PeriodUnit' => '',
'FirstPaymentDate' => '',
'TotalNbOfPayments' => 0,
'CumulativeAmount' => '',
'FirstAmount' => '',
'Charges' => ''
],
'CustomerOrder' => [
'CustomerOrderID' => '',
'SaleReferenceID' => '',
'OpenOrderState' => null,
'StartDate' => '',
'EndDate' => '',
'ForecastedAmount' => '',
'CurrentAmount' => '',
'Currency' => '',
'AccessedBy' => '',
'AdditionalInformation' => ''
],
'PaymentInstrumentData' => [
'PaymentInstrumentType' => '',
'ProtectedCardData' => '',
'CardData' => [
'PaymentBrand' => '',
'MaskedPan' => '',
'PaymentAccountRef' => '',
'EntryMode' => [
],
'CardCountryCode' => 0,
'ProtectedCardData' => '',
'SensitiveCardData' => [
'PAN' => 0,
'CardSeqNumb' => 0,
'ExpiryDate' => 0,
'TrackData' => [
[
'TrackNumb' => 0,
'TrackFormat' => '',
'TrackValue' => ''
]
]
],
'AllowedProductCode' => [
],
'AllowedProduct' => [
[
'ProductCode' => 0,
'EanUpc' => 0,
'ProductLabel' => '',
'AdditionalProductInfo' => ''
]
],
'PaymentToken' => [
'TokenRequestedType' => '',
'TokenValue' => '',
'ExpiryDateTime' => ''
],
'CustomerOrder' => [
[
]
]
],
'CheckData' => [
'BankID' => '',
'AccountNumber' => '',
'CheckNumber' => '',
'TrackData' => [
],
'CheckCardNumber' => '',
'TypeCode' => '',
'Country' => ''
],
'MobileData' => [
'MobileCountryCode' => 0,
'MobileNetworkCode' => 0,
'MaskedMSISDN' => 0,
'Geolocation' => [
'GeographicCoordinates' => [
'Latitude' => '',
'Longitude' => ''
],
'UTMCoordinates' => [
'UTMZone' => '',
'UTMEastward' => '',
'UTMNorthward' => ''
]
],
'ProtectedMobileData' => '',
'SensitiveMobileData' => [
'MSISDN' => 0,
'IMSI' => 0,
'IMEI' => 0
]
],
'StoredValueAccountID' => [
'StoredValueAccountType' => '',
'StoredValueProvider' => '',
'OwnerName' => '',
'ExpiryDate' => 0,
'EntryMode' => [
],
'IdentificationType' => '',
'StoredValueID' => ''
]
]
],
'LoyaltyData' => [
[
'CardAcquisitionReference' => [
],
'LoyaltyAccountID' => [
'EntryMode' => [
],
'IdentificationType' => '',
'IdentificationSupport' => '',
'LoyaltyID' => ''
],
'LoyaltyAmount' => [
'LoyaltyUnit' => '',
'Currency' => '',
'AmountValue' => ''
]
]
]
]),
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;
}
request('POST', '{{baseUrl}}/payment', [
'body' => '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"PaymentTransaction": {
"AmountsReq": {
"Currency": "",
"RequestedAmount": "",
"CashBackAmount": "",
"TipAmount": "",
"PaidAmount": "",
"MinimumAmountToDeliver": "",
"MaximumCashBackAmount": "",
"MinimumSplitAmount": ""
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"TransactionConditions": {
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
},
"SaleItem": [
{
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
]
},
"PaymentData": {
"PaymentType": "",
"SplitPaymentFlag": false,
"RequestedValidityDate": "",
"CardAcquisitionReference": {},
"Instalment": {
"InstalmentType": "",
"SequenceNumber": 0,
"PlanID": "",
"Period": 0,
"PeriodUnit": "",
"FirstPaymentDate": "",
"TotalNbOfPayments": 0,
"CumulativeAmount": "",
"FirstAmount": "",
"Charges": ""
},
"CustomerOrder": {
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
},
"PaymentInstrumentData": {
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": {
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": {
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
{
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
}
]
},
"AllowedProductCode": [],
"AllowedProduct": [
{
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
],
"PaymentToken": {
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
},
"CustomerOrder": [
{}
]
},
"CheckData": {
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": {},
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
},
"MobileData": {
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": {
"GeographicCoordinates": {
"Latitude": "",
"Longitude": ""
},
"UTMCoordinates": {
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
}
},
"ProtectedMobileData": "",
"SensitiveMobileData": {
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
}
},
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
}
}
},
"LoyaltyData": [
{
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
},
"LoyaltyAmount": {
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
}
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/payment');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SaleData' => [
'OperatorID' => '',
'OperatorLanguage' => '',
'ShiftNumber' => '',
'SaleTransactionID' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'SaleReferenceID' => '',
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TokenRequestedType' => '',
'CustomerOrderID' => '',
'CustomerOrderReq' => [
],
'SaleToPOIData' => '',
'SaleToAcquirerData' => '',
'SaleToIssuerData' => [
'StatementReference' => ''
]
],
'PaymentTransaction' => [
'AmountsReq' => [
'Currency' => '',
'RequestedAmount' => '',
'CashBackAmount' => '',
'TipAmount' => '',
'PaidAmount' => '',
'MinimumAmountToDeliver' => '',
'MaximumCashBackAmount' => '',
'MinimumSplitAmount' => ''
],
'OriginalPOITransaction' => [
'SaleID' => '',
'POIID' => '',
'POITransactionID' => [
],
'ReuseCardDataFlag' => null,
'ApprovalCode' => '',
'AcquirerID' => 0,
'AmountValue' => '',
'HostTransactionID' => [
]
],
'TransactionConditions' => [
'AllowedPaymentBrand' => [
],
'AcquirerID' => [
],
'DebitPreferredFlag' => null,
'AllowedLoyaltyBrand' => [
],
'LoyaltyHandling' => '',
'ForceOnlineFlag' => null,
'ForceEntryMode' => [
],
'MerchantCategoryCode' => ''
],
'SaleItem' => [
[
'ItemID' => 0,
'ProductCode' => 0,
'EanUpc' => 0,
'UnitOfMeasure' => '',
'Quantity' => '',
'UnitPrice' => '',
'ItemAmount' => '',
'TaxCode' => 0,
'SaleChannel' => 0,
'ProductLabel' => '',
'AdditionalProductInfo' => ''
]
]
],
'PaymentData' => [
'PaymentType' => '',
'SplitPaymentFlag' => null,
'RequestedValidityDate' => '',
'CardAcquisitionReference' => [
],
'Instalment' => [
'InstalmentType' => '',
'SequenceNumber' => 0,
'PlanID' => '',
'Period' => 0,
'PeriodUnit' => '',
'FirstPaymentDate' => '',
'TotalNbOfPayments' => 0,
'CumulativeAmount' => '',
'FirstAmount' => '',
'Charges' => ''
],
'CustomerOrder' => [
'CustomerOrderID' => '',
'SaleReferenceID' => '',
'OpenOrderState' => null,
'StartDate' => '',
'EndDate' => '',
'ForecastedAmount' => '',
'CurrentAmount' => '',
'Currency' => '',
'AccessedBy' => '',
'AdditionalInformation' => ''
],
'PaymentInstrumentData' => [
'PaymentInstrumentType' => '',
'ProtectedCardData' => '',
'CardData' => [
'PaymentBrand' => '',
'MaskedPan' => '',
'PaymentAccountRef' => '',
'EntryMode' => [
],
'CardCountryCode' => 0,
'ProtectedCardData' => '',
'SensitiveCardData' => [
'PAN' => 0,
'CardSeqNumb' => 0,
'ExpiryDate' => 0,
'TrackData' => [
[
'TrackNumb' => 0,
'TrackFormat' => '',
'TrackValue' => ''
]
]
],
'AllowedProductCode' => [
],
'AllowedProduct' => [
[
'ProductCode' => 0,
'EanUpc' => 0,
'ProductLabel' => '',
'AdditionalProductInfo' => ''
]
],
'PaymentToken' => [
'TokenRequestedType' => '',
'TokenValue' => '',
'ExpiryDateTime' => ''
],
'CustomerOrder' => [
[
]
]
],
'CheckData' => [
'BankID' => '',
'AccountNumber' => '',
'CheckNumber' => '',
'TrackData' => [
],
'CheckCardNumber' => '',
'TypeCode' => '',
'Country' => ''
],
'MobileData' => [
'MobileCountryCode' => 0,
'MobileNetworkCode' => 0,
'MaskedMSISDN' => 0,
'Geolocation' => [
'GeographicCoordinates' => [
'Latitude' => '',
'Longitude' => ''
],
'UTMCoordinates' => [
'UTMZone' => '',
'UTMEastward' => '',
'UTMNorthward' => ''
]
],
'ProtectedMobileData' => '',
'SensitiveMobileData' => [
'MSISDN' => 0,
'IMSI' => 0,
'IMEI' => 0
]
],
'StoredValueAccountID' => [
'StoredValueAccountType' => '',
'StoredValueProvider' => '',
'OwnerName' => '',
'ExpiryDate' => 0,
'EntryMode' => [
],
'IdentificationType' => '',
'StoredValueID' => ''
]
]
],
'LoyaltyData' => [
[
'CardAcquisitionReference' => [
],
'LoyaltyAccountID' => [
'EntryMode' => [
],
'IdentificationType' => '',
'IdentificationSupport' => '',
'LoyaltyID' => ''
],
'LoyaltyAmount' => [
'LoyaltyUnit' => '',
'Currency' => '',
'AmountValue' => ''
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SaleData' => [
'OperatorID' => '',
'OperatorLanguage' => '',
'ShiftNumber' => '',
'SaleTransactionID' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'SaleReferenceID' => '',
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TokenRequestedType' => '',
'CustomerOrderID' => '',
'CustomerOrderReq' => [
],
'SaleToPOIData' => '',
'SaleToAcquirerData' => '',
'SaleToIssuerData' => [
'StatementReference' => ''
]
],
'PaymentTransaction' => [
'AmountsReq' => [
'Currency' => '',
'RequestedAmount' => '',
'CashBackAmount' => '',
'TipAmount' => '',
'PaidAmount' => '',
'MinimumAmountToDeliver' => '',
'MaximumCashBackAmount' => '',
'MinimumSplitAmount' => ''
],
'OriginalPOITransaction' => [
'SaleID' => '',
'POIID' => '',
'POITransactionID' => [
],
'ReuseCardDataFlag' => null,
'ApprovalCode' => '',
'AcquirerID' => 0,
'AmountValue' => '',
'HostTransactionID' => [
]
],
'TransactionConditions' => [
'AllowedPaymentBrand' => [
],
'AcquirerID' => [
],
'DebitPreferredFlag' => null,
'AllowedLoyaltyBrand' => [
],
'LoyaltyHandling' => '',
'ForceOnlineFlag' => null,
'ForceEntryMode' => [
],
'MerchantCategoryCode' => ''
],
'SaleItem' => [
[
'ItemID' => 0,
'ProductCode' => 0,
'EanUpc' => 0,
'UnitOfMeasure' => '',
'Quantity' => '',
'UnitPrice' => '',
'ItemAmount' => '',
'TaxCode' => 0,
'SaleChannel' => 0,
'ProductLabel' => '',
'AdditionalProductInfo' => ''
]
]
],
'PaymentData' => [
'PaymentType' => '',
'SplitPaymentFlag' => null,
'RequestedValidityDate' => '',
'CardAcquisitionReference' => [
],
'Instalment' => [
'InstalmentType' => '',
'SequenceNumber' => 0,
'PlanID' => '',
'Period' => 0,
'PeriodUnit' => '',
'FirstPaymentDate' => '',
'TotalNbOfPayments' => 0,
'CumulativeAmount' => '',
'FirstAmount' => '',
'Charges' => ''
],
'CustomerOrder' => [
'CustomerOrderID' => '',
'SaleReferenceID' => '',
'OpenOrderState' => null,
'StartDate' => '',
'EndDate' => '',
'ForecastedAmount' => '',
'CurrentAmount' => '',
'Currency' => '',
'AccessedBy' => '',
'AdditionalInformation' => ''
],
'PaymentInstrumentData' => [
'PaymentInstrumentType' => '',
'ProtectedCardData' => '',
'CardData' => [
'PaymentBrand' => '',
'MaskedPan' => '',
'PaymentAccountRef' => '',
'EntryMode' => [
],
'CardCountryCode' => 0,
'ProtectedCardData' => '',
'SensitiveCardData' => [
'PAN' => 0,
'CardSeqNumb' => 0,
'ExpiryDate' => 0,
'TrackData' => [
[
'TrackNumb' => 0,
'TrackFormat' => '',
'TrackValue' => ''
]
]
],
'AllowedProductCode' => [
],
'AllowedProduct' => [
[
'ProductCode' => 0,
'EanUpc' => 0,
'ProductLabel' => '',
'AdditionalProductInfo' => ''
]
],
'PaymentToken' => [
'TokenRequestedType' => '',
'TokenValue' => '',
'ExpiryDateTime' => ''
],
'CustomerOrder' => [
[
]
]
],
'CheckData' => [
'BankID' => '',
'AccountNumber' => '',
'CheckNumber' => '',
'TrackData' => [
],
'CheckCardNumber' => '',
'TypeCode' => '',
'Country' => ''
],
'MobileData' => [
'MobileCountryCode' => 0,
'MobileNetworkCode' => 0,
'MaskedMSISDN' => 0,
'Geolocation' => [
'GeographicCoordinates' => [
'Latitude' => '',
'Longitude' => ''
],
'UTMCoordinates' => [
'UTMZone' => '',
'UTMEastward' => '',
'UTMNorthward' => ''
]
],
'ProtectedMobileData' => '',
'SensitiveMobileData' => [
'MSISDN' => 0,
'IMSI' => 0,
'IMEI' => 0
]
],
'StoredValueAccountID' => [
'StoredValueAccountType' => '',
'StoredValueProvider' => '',
'OwnerName' => '',
'ExpiryDate' => 0,
'EntryMode' => [
],
'IdentificationType' => '',
'StoredValueID' => ''
]
]
],
'LoyaltyData' => [
[
'CardAcquisitionReference' => [
],
'LoyaltyAccountID' => [
'EntryMode' => [
],
'IdentificationType' => '',
'IdentificationSupport' => '',
'LoyaltyID' => ''
],
'LoyaltyAmount' => [
'LoyaltyUnit' => '',
'Currency' => '',
'AmountValue' => ''
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/payment');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/payment' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"PaymentTransaction": {
"AmountsReq": {
"Currency": "",
"RequestedAmount": "",
"CashBackAmount": "",
"TipAmount": "",
"PaidAmount": "",
"MinimumAmountToDeliver": "",
"MaximumCashBackAmount": "",
"MinimumSplitAmount": ""
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"TransactionConditions": {
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
},
"SaleItem": [
{
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
]
},
"PaymentData": {
"PaymentType": "",
"SplitPaymentFlag": false,
"RequestedValidityDate": "",
"CardAcquisitionReference": {},
"Instalment": {
"InstalmentType": "",
"SequenceNumber": 0,
"PlanID": "",
"Period": 0,
"PeriodUnit": "",
"FirstPaymentDate": "",
"TotalNbOfPayments": 0,
"CumulativeAmount": "",
"FirstAmount": "",
"Charges": ""
},
"CustomerOrder": {
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
},
"PaymentInstrumentData": {
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": {
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": {
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
{
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
}
]
},
"AllowedProductCode": [],
"AllowedProduct": [
{
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
],
"PaymentToken": {
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
},
"CustomerOrder": [
{}
]
},
"CheckData": {
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": {},
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
},
"MobileData": {
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": {
"GeographicCoordinates": {
"Latitude": "",
"Longitude": ""
},
"UTMCoordinates": {
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
}
},
"ProtectedMobileData": "",
"SensitiveMobileData": {
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
}
},
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
}
}
},
"LoyaltyData": [
{
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
},
"LoyaltyAmount": {
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
}
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/payment' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"PaymentTransaction": {
"AmountsReq": {
"Currency": "",
"RequestedAmount": "",
"CashBackAmount": "",
"TipAmount": "",
"PaidAmount": "",
"MinimumAmountToDeliver": "",
"MaximumCashBackAmount": "",
"MinimumSplitAmount": ""
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"TransactionConditions": {
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
},
"SaleItem": [
{
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
]
},
"PaymentData": {
"PaymentType": "",
"SplitPaymentFlag": false,
"RequestedValidityDate": "",
"CardAcquisitionReference": {},
"Instalment": {
"InstalmentType": "",
"SequenceNumber": 0,
"PlanID": "",
"Period": 0,
"PeriodUnit": "",
"FirstPaymentDate": "",
"TotalNbOfPayments": 0,
"CumulativeAmount": "",
"FirstAmount": "",
"Charges": ""
},
"CustomerOrder": {
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
},
"PaymentInstrumentData": {
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": {
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": {
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
{
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
}
]
},
"AllowedProductCode": [],
"AllowedProduct": [
{
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
],
"PaymentToken": {
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
},
"CustomerOrder": [
{}
]
},
"CheckData": {
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": {},
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
},
"MobileData": {
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": {
"GeographicCoordinates": {
"Latitude": "",
"Longitude": ""
},
"UTMCoordinates": {
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
}
},
"ProtectedMobileData": "",
"SensitiveMobileData": {
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
}
},
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
}
}
},
"LoyaltyData": [
{
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
},
"LoyaltyAmount": {
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
}
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"PaymentTransaction\": {\n \"AmountsReq\": {\n \"Currency\": \"\",\n \"RequestedAmount\": \"\",\n \"CashBackAmount\": \"\",\n \"TipAmount\": \"\",\n \"PaidAmount\": \"\",\n \"MinimumAmountToDeliver\": \"\",\n \"MaximumCashBackAmount\": \"\",\n \"MinimumSplitAmount\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"PaymentData\": {\n \"PaymentType\": \"\",\n \"SplitPaymentFlag\": false,\n \"RequestedValidityDate\": \"\",\n \"CardAcquisitionReference\": {},\n \"Instalment\": {\n \"InstalmentType\": \"\",\n \"SequenceNumber\": 0,\n \"PlanID\": \"\",\n \"Period\": 0,\n \"PeriodUnit\": \"\",\n \"FirstPaymentDate\": \"\",\n \"TotalNbOfPayments\": 0,\n \"CumulativeAmount\": \"\",\n \"FirstAmount\": \"\",\n \"Charges\": \"\"\n },\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {}\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyData\": [\n {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/payment", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/payment"
payload = {
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": { "TotalsGroupID": "" },
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": { "StatementReference": "" }
},
"PaymentTransaction": {
"AmountsReq": {
"Currency": "",
"RequestedAmount": "",
"CashBackAmount": "",
"TipAmount": "",
"PaidAmount": "",
"MinimumAmountToDeliver": "",
"MaximumCashBackAmount": "",
"MinimumSplitAmount": ""
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": False,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"TransactionConditions": {
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": False,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": False,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
},
"SaleItem": [
{
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
]
},
"PaymentData": {
"PaymentType": "",
"SplitPaymentFlag": False,
"RequestedValidityDate": "",
"CardAcquisitionReference": {},
"Instalment": {
"InstalmentType": "",
"SequenceNumber": 0,
"PlanID": "",
"Period": 0,
"PeriodUnit": "",
"FirstPaymentDate": "",
"TotalNbOfPayments": 0,
"CumulativeAmount": "",
"FirstAmount": "",
"Charges": ""
},
"CustomerOrder": {
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": False,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
},
"PaymentInstrumentData": {
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": {
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": {
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
{
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
}
]
},
"AllowedProductCode": [],
"AllowedProduct": [
{
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
],
"PaymentToken": {
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
},
"CustomerOrder": [{}]
},
"CheckData": {
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": {},
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
},
"MobileData": {
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": {
"GeographicCoordinates": {
"Latitude": "",
"Longitude": ""
},
"UTMCoordinates": {
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
}
},
"ProtectedMobileData": "",
"SensitiveMobileData": {
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
}
},
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
}
}
},
"LoyaltyData": [
{
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
},
"LoyaltyAmount": {
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
}
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/payment"
payload <- "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"PaymentTransaction\": {\n \"AmountsReq\": {\n \"Currency\": \"\",\n \"RequestedAmount\": \"\",\n \"CashBackAmount\": \"\",\n \"TipAmount\": \"\",\n \"PaidAmount\": \"\",\n \"MinimumAmountToDeliver\": \"\",\n \"MaximumCashBackAmount\": \"\",\n \"MinimumSplitAmount\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"PaymentData\": {\n \"PaymentType\": \"\",\n \"SplitPaymentFlag\": false,\n \"RequestedValidityDate\": \"\",\n \"CardAcquisitionReference\": {},\n \"Instalment\": {\n \"InstalmentType\": \"\",\n \"SequenceNumber\": 0,\n \"PlanID\": \"\",\n \"Period\": 0,\n \"PeriodUnit\": \"\",\n \"FirstPaymentDate\": \"\",\n \"TotalNbOfPayments\": 0,\n \"CumulativeAmount\": \"\",\n \"FirstAmount\": \"\",\n \"Charges\": \"\"\n },\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {}\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyData\": [\n {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/payment")
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 \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"PaymentTransaction\": {\n \"AmountsReq\": {\n \"Currency\": \"\",\n \"RequestedAmount\": \"\",\n \"CashBackAmount\": \"\",\n \"TipAmount\": \"\",\n \"PaidAmount\": \"\",\n \"MinimumAmountToDeliver\": \"\",\n \"MaximumCashBackAmount\": \"\",\n \"MinimumSplitAmount\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"PaymentData\": {\n \"PaymentType\": \"\",\n \"SplitPaymentFlag\": false,\n \"RequestedValidityDate\": \"\",\n \"CardAcquisitionReference\": {},\n \"Instalment\": {\n \"InstalmentType\": \"\",\n \"SequenceNumber\": 0,\n \"PlanID\": \"\",\n \"Period\": 0,\n \"PeriodUnit\": \"\",\n \"FirstPaymentDate\": \"\",\n \"TotalNbOfPayments\": 0,\n \"CumulativeAmount\": \"\",\n \"FirstAmount\": \"\",\n \"Charges\": \"\"\n },\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {}\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyData\": [\n {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/payment') do |req|
req.body = "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"PaymentTransaction\": {\n \"AmountsReq\": {\n \"Currency\": \"\",\n \"RequestedAmount\": \"\",\n \"CashBackAmount\": \"\",\n \"TipAmount\": \"\",\n \"PaidAmount\": \"\",\n \"MinimumAmountToDeliver\": \"\",\n \"MaximumCashBackAmount\": \"\",\n \"MinimumSplitAmount\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"TransactionConditions\": {\n \"AllowedPaymentBrand\": [],\n \"AcquirerID\": [],\n \"DebitPreferredFlag\": false,\n \"AllowedLoyaltyBrand\": [],\n \"LoyaltyHandling\": \"\",\n \"ForceOnlineFlag\": false,\n \"ForceEntryMode\": [],\n \"MerchantCategoryCode\": \"\"\n },\n \"SaleItem\": [\n {\n \"ItemID\": 0,\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"UnitOfMeasure\": \"\",\n \"Quantity\": \"\",\n \"UnitPrice\": \"\",\n \"ItemAmount\": \"\",\n \"TaxCode\": 0,\n \"SaleChannel\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ]\n },\n \"PaymentData\": {\n \"PaymentType\": \"\",\n \"SplitPaymentFlag\": false,\n \"RequestedValidityDate\": \"\",\n \"CardAcquisitionReference\": {},\n \"Instalment\": {\n \"InstalmentType\": \"\",\n \"SequenceNumber\": 0,\n \"PlanID\": \"\",\n \"Period\": 0,\n \"PeriodUnit\": \"\",\n \"FirstPaymentDate\": \"\",\n \"TotalNbOfPayments\": 0,\n \"CumulativeAmount\": \"\",\n \"FirstAmount\": \"\",\n \"Charges\": \"\"\n },\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n },\n \"PaymentInstrumentData\": {\n \"PaymentInstrumentType\": \"\",\n \"ProtectedCardData\": \"\",\n \"CardData\": {\n \"PaymentBrand\": \"\",\n \"MaskedPan\": \"\",\n \"PaymentAccountRef\": \"\",\n \"EntryMode\": [],\n \"CardCountryCode\": 0,\n \"ProtectedCardData\": \"\",\n \"SensitiveCardData\": {\n \"PAN\": 0,\n \"CardSeqNumb\": 0,\n \"ExpiryDate\": 0,\n \"TrackData\": [\n {\n \"TrackNumb\": 0,\n \"TrackFormat\": \"\",\n \"TrackValue\": \"\"\n }\n ]\n },\n \"AllowedProductCode\": [],\n \"AllowedProduct\": [\n {\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ProductLabel\": \"\",\n \"AdditionalProductInfo\": \"\"\n }\n ],\n \"PaymentToken\": {\n \"TokenRequestedType\": \"\",\n \"TokenValue\": \"\",\n \"ExpiryDateTime\": \"\"\n },\n \"CustomerOrder\": [\n {}\n ]\n },\n \"CheckData\": {\n \"BankID\": \"\",\n \"AccountNumber\": \"\",\n \"CheckNumber\": \"\",\n \"TrackData\": {},\n \"CheckCardNumber\": \"\",\n \"TypeCode\": \"\",\n \"Country\": \"\"\n },\n \"MobileData\": {\n \"MobileCountryCode\": 0,\n \"MobileNetworkCode\": 0,\n \"MaskedMSISDN\": 0,\n \"Geolocation\": {\n \"GeographicCoordinates\": {\n \"Latitude\": \"\",\n \"Longitude\": \"\"\n },\n \"UTMCoordinates\": {\n \"UTMZone\": \"\",\n \"UTMEastward\": \"\",\n \"UTMNorthward\": \"\"\n }\n },\n \"ProtectedMobileData\": \"\",\n \"SensitiveMobileData\": {\n \"MSISDN\": 0,\n \"IMSI\": 0,\n \"IMEI\": 0\n }\n },\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n }\n }\n },\n \"LoyaltyData\": [\n {\n \"CardAcquisitionReference\": {},\n \"LoyaltyAccountID\": {\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"IdentificationSupport\": \"\",\n \"LoyaltyID\": \"\"\n },\n \"LoyaltyAmount\": {\n \"LoyaltyUnit\": \"\",\n \"Currency\": \"\",\n \"AmountValue\": \"\"\n }\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/payment";
let payload = json!({
"SaleData": json!({
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": json!({
"TransactionID": "",
"TimeStamp": ""
}),
"SaleReferenceID": "",
"SaleTerminalData": json!({"TotalsGroupID": ""}),
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": (),
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": json!({"StatementReference": ""})
}),
"PaymentTransaction": json!({
"AmountsReq": json!({
"Currency": "",
"RequestedAmount": "",
"CashBackAmount": "",
"TipAmount": "",
"PaidAmount": "",
"MinimumAmountToDeliver": "",
"MaximumCashBackAmount": "",
"MinimumSplitAmount": ""
}),
"OriginalPOITransaction": json!({
"SaleID": "",
"POIID": "",
"POITransactionID": json!({}),
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": json!({})
}),
"TransactionConditions": json!({
"AllowedPaymentBrand": (),
"AcquirerID": (),
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": (),
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": (),
"MerchantCategoryCode": ""
}),
"SaleItem": (
json!({
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
})
)
}),
"PaymentData": json!({
"PaymentType": "",
"SplitPaymentFlag": false,
"RequestedValidityDate": "",
"CardAcquisitionReference": json!({}),
"Instalment": json!({
"InstalmentType": "",
"SequenceNumber": 0,
"PlanID": "",
"Period": 0,
"PeriodUnit": "",
"FirstPaymentDate": "",
"TotalNbOfPayments": 0,
"CumulativeAmount": "",
"FirstAmount": "",
"Charges": ""
}),
"CustomerOrder": json!({
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
}),
"PaymentInstrumentData": json!({
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": json!({
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": (),
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": json!({
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": (
json!({
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
})
)
}),
"AllowedProductCode": (),
"AllowedProduct": (
json!({
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
})
),
"PaymentToken": json!({
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
}),
"CustomerOrder": (json!({}))
}),
"CheckData": json!({
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": json!({}),
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
}),
"MobileData": json!({
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": json!({
"GeographicCoordinates": json!({
"Latitude": "",
"Longitude": ""
}),
"UTMCoordinates": json!({
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
})
}),
"ProtectedMobileData": "",
"SensitiveMobileData": json!({
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
})
}),
"StoredValueAccountID": json!({
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": (),
"IdentificationType": "",
"StoredValueID": ""
})
})
}),
"LoyaltyData": (
json!({
"CardAcquisitionReference": json!({}),
"LoyaltyAccountID": json!({
"EntryMode": (),
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
}),
"LoyaltyAmount": json!({
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
})
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/payment \
--header 'content-type: application/json' \
--data '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"PaymentTransaction": {
"AmountsReq": {
"Currency": "",
"RequestedAmount": "",
"CashBackAmount": "",
"TipAmount": "",
"PaidAmount": "",
"MinimumAmountToDeliver": "",
"MaximumCashBackAmount": "",
"MinimumSplitAmount": ""
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"TransactionConditions": {
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
},
"SaleItem": [
{
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
]
},
"PaymentData": {
"PaymentType": "",
"SplitPaymentFlag": false,
"RequestedValidityDate": "",
"CardAcquisitionReference": {},
"Instalment": {
"InstalmentType": "",
"SequenceNumber": 0,
"PlanID": "",
"Period": 0,
"PeriodUnit": "",
"FirstPaymentDate": "",
"TotalNbOfPayments": 0,
"CumulativeAmount": "",
"FirstAmount": "",
"Charges": ""
},
"CustomerOrder": {
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
},
"PaymentInstrumentData": {
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": {
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": {
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
{
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
}
]
},
"AllowedProductCode": [],
"AllowedProduct": [
{
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
],
"PaymentToken": {
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
},
"CustomerOrder": [
{}
]
},
"CheckData": {
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": {},
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
},
"MobileData": {
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": {
"GeographicCoordinates": {
"Latitude": "",
"Longitude": ""
},
"UTMCoordinates": {
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
}
},
"ProtectedMobileData": "",
"SensitiveMobileData": {
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
}
},
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
}
}
},
"LoyaltyData": [
{
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
},
"LoyaltyAmount": {
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
}
}
]
}'
echo '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"PaymentTransaction": {
"AmountsReq": {
"Currency": "",
"RequestedAmount": "",
"CashBackAmount": "",
"TipAmount": "",
"PaidAmount": "",
"MinimumAmountToDeliver": "",
"MaximumCashBackAmount": "",
"MinimumSplitAmount": ""
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"TransactionConditions": {
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
},
"SaleItem": [
{
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
]
},
"PaymentData": {
"PaymentType": "",
"SplitPaymentFlag": false,
"RequestedValidityDate": "",
"CardAcquisitionReference": {},
"Instalment": {
"InstalmentType": "",
"SequenceNumber": 0,
"PlanID": "",
"Period": 0,
"PeriodUnit": "",
"FirstPaymentDate": "",
"TotalNbOfPayments": 0,
"CumulativeAmount": "",
"FirstAmount": "",
"Charges": ""
},
"CustomerOrder": {
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
},
"PaymentInstrumentData": {
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": {
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": {
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
{
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
}
]
},
"AllowedProductCode": [],
"AllowedProduct": [
{
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
}
],
"PaymentToken": {
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
},
"CustomerOrder": [
{}
]
},
"CheckData": {
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": {},
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
},
"MobileData": {
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": {
"GeographicCoordinates": {
"Latitude": "",
"Longitude": ""
},
"UTMCoordinates": {
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
}
},
"ProtectedMobileData": "",
"SensitiveMobileData": {
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
}
},
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
}
}
},
"LoyaltyData": [
{
"CardAcquisitionReference": {},
"LoyaltyAccountID": {
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
},
"LoyaltyAmount": {
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
}
}
]
}' | \
http POST {{baseUrl}}/payment \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "SaleData": {\n "OperatorID": "",\n "OperatorLanguage": "",\n "ShiftNumber": "",\n "SaleTransactionID": {\n "TransactionID": "",\n "TimeStamp": ""\n },\n "SaleReferenceID": "",\n "SaleTerminalData": {\n "TotalsGroupID": ""\n },\n "TokenRequestedType": "",\n "CustomerOrderID": "",\n "CustomerOrderReq": [],\n "SaleToPOIData": "",\n "SaleToAcquirerData": "",\n "SaleToIssuerData": {\n "StatementReference": ""\n }\n },\n "PaymentTransaction": {\n "AmountsReq": {\n "Currency": "",\n "RequestedAmount": "",\n "CashBackAmount": "",\n "TipAmount": "",\n "PaidAmount": "",\n "MinimumAmountToDeliver": "",\n "MaximumCashBackAmount": "",\n "MinimumSplitAmount": ""\n },\n "OriginalPOITransaction": {\n "SaleID": "",\n "POIID": "",\n "POITransactionID": {},\n "ReuseCardDataFlag": false,\n "ApprovalCode": "",\n "AcquirerID": 0,\n "AmountValue": "",\n "HostTransactionID": {}\n },\n "TransactionConditions": {\n "AllowedPaymentBrand": [],\n "AcquirerID": [],\n "DebitPreferredFlag": false,\n "AllowedLoyaltyBrand": [],\n "LoyaltyHandling": "",\n "ForceOnlineFlag": false,\n "ForceEntryMode": [],\n "MerchantCategoryCode": ""\n },\n "SaleItem": [\n {\n "ItemID": 0,\n "ProductCode": 0,\n "EanUpc": 0,\n "UnitOfMeasure": "",\n "Quantity": "",\n "UnitPrice": "",\n "ItemAmount": "",\n "TaxCode": 0,\n "SaleChannel": 0,\n "ProductLabel": "",\n "AdditionalProductInfo": ""\n }\n ]\n },\n "PaymentData": {\n "PaymentType": "",\n "SplitPaymentFlag": false,\n "RequestedValidityDate": "",\n "CardAcquisitionReference": {},\n "Instalment": {\n "InstalmentType": "",\n "SequenceNumber": 0,\n "PlanID": "",\n "Period": 0,\n "PeriodUnit": "",\n "FirstPaymentDate": "",\n "TotalNbOfPayments": 0,\n "CumulativeAmount": "",\n "FirstAmount": "",\n "Charges": ""\n },\n "CustomerOrder": {\n "CustomerOrderID": "",\n "SaleReferenceID": "",\n "OpenOrderState": false,\n "StartDate": "",\n "EndDate": "",\n "ForecastedAmount": "",\n "CurrentAmount": "",\n "Currency": "",\n "AccessedBy": "",\n "AdditionalInformation": ""\n },\n "PaymentInstrumentData": {\n "PaymentInstrumentType": "",\n "ProtectedCardData": "",\n "CardData": {\n "PaymentBrand": "",\n "MaskedPan": "",\n "PaymentAccountRef": "",\n "EntryMode": [],\n "CardCountryCode": 0,\n "ProtectedCardData": "",\n "SensitiveCardData": {\n "PAN": 0,\n "CardSeqNumb": 0,\n "ExpiryDate": 0,\n "TrackData": [\n {\n "TrackNumb": 0,\n "TrackFormat": "",\n "TrackValue": ""\n }\n ]\n },\n "AllowedProductCode": [],\n "AllowedProduct": [\n {\n "ProductCode": 0,\n "EanUpc": 0,\n "ProductLabel": "",\n "AdditionalProductInfo": ""\n }\n ],\n "PaymentToken": {\n "TokenRequestedType": "",\n "TokenValue": "",\n "ExpiryDateTime": ""\n },\n "CustomerOrder": [\n {}\n ]\n },\n "CheckData": {\n "BankID": "",\n "AccountNumber": "",\n "CheckNumber": "",\n "TrackData": {},\n "CheckCardNumber": "",\n "TypeCode": "",\n "Country": ""\n },\n "MobileData": {\n "MobileCountryCode": 0,\n "MobileNetworkCode": 0,\n "MaskedMSISDN": 0,\n "Geolocation": {\n "GeographicCoordinates": {\n "Latitude": "",\n "Longitude": ""\n },\n "UTMCoordinates": {\n "UTMZone": "",\n "UTMEastward": "",\n "UTMNorthward": ""\n }\n },\n "ProtectedMobileData": "",\n "SensitiveMobileData": {\n "MSISDN": 0,\n "IMSI": 0,\n "IMEI": 0\n }\n },\n "StoredValueAccountID": {\n "StoredValueAccountType": "",\n "StoredValueProvider": "",\n "OwnerName": "",\n "ExpiryDate": 0,\n "EntryMode": [],\n "IdentificationType": "",\n "StoredValueID": ""\n }\n }\n },\n "LoyaltyData": [\n {\n "CardAcquisitionReference": {},\n "LoyaltyAccountID": {\n "EntryMode": [],\n "IdentificationType": "",\n "IdentificationSupport": "",\n "LoyaltyID": ""\n },\n "LoyaltyAmount": {\n "LoyaltyUnit": "",\n "Currency": "",\n "AmountValue": ""\n }\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/payment
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"SaleData": [
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": [
"TransactionID": "",
"TimeStamp": ""
],
"SaleReferenceID": "",
"SaleTerminalData": ["TotalsGroupID": ""],
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": ["StatementReference": ""]
],
"PaymentTransaction": [
"AmountsReq": [
"Currency": "",
"RequestedAmount": "",
"CashBackAmount": "",
"TipAmount": "",
"PaidAmount": "",
"MinimumAmountToDeliver": "",
"MaximumCashBackAmount": "",
"MinimumSplitAmount": ""
],
"OriginalPOITransaction": [
"SaleID": "",
"POIID": "",
"POITransactionID": [],
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": []
],
"TransactionConditions": [
"AllowedPaymentBrand": [],
"AcquirerID": [],
"DebitPreferredFlag": false,
"AllowedLoyaltyBrand": [],
"LoyaltyHandling": "",
"ForceOnlineFlag": false,
"ForceEntryMode": [],
"MerchantCategoryCode": ""
],
"SaleItem": [
[
"ItemID": 0,
"ProductCode": 0,
"EanUpc": 0,
"UnitOfMeasure": "",
"Quantity": "",
"UnitPrice": "",
"ItemAmount": "",
"TaxCode": 0,
"SaleChannel": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
]
]
],
"PaymentData": [
"PaymentType": "",
"SplitPaymentFlag": false,
"RequestedValidityDate": "",
"CardAcquisitionReference": [],
"Instalment": [
"InstalmentType": "",
"SequenceNumber": 0,
"PlanID": "",
"Period": 0,
"PeriodUnit": "",
"FirstPaymentDate": "",
"TotalNbOfPayments": 0,
"CumulativeAmount": "",
"FirstAmount": "",
"Charges": ""
],
"CustomerOrder": [
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
],
"PaymentInstrumentData": [
"PaymentInstrumentType": "",
"ProtectedCardData": "",
"CardData": [
"PaymentBrand": "",
"MaskedPan": "",
"PaymentAccountRef": "",
"EntryMode": [],
"CardCountryCode": 0,
"ProtectedCardData": "",
"SensitiveCardData": [
"PAN": 0,
"CardSeqNumb": 0,
"ExpiryDate": 0,
"TrackData": [
[
"TrackNumb": 0,
"TrackFormat": "",
"TrackValue": ""
]
]
],
"AllowedProductCode": [],
"AllowedProduct": [
[
"ProductCode": 0,
"EanUpc": 0,
"ProductLabel": "",
"AdditionalProductInfo": ""
]
],
"PaymentToken": [
"TokenRequestedType": "",
"TokenValue": "",
"ExpiryDateTime": ""
],
"CustomerOrder": [[]]
],
"CheckData": [
"BankID": "",
"AccountNumber": "",
"CheckNumber": "",
"TrackData": [],
"CheckCardNumber": "",
"TypeCode": "",
"Country": ""
],
"MobileData": [
"MobileCountryCode": 0,
"MobileNetworkCode": 0,
"MaskedMSISDN": 0,
"Geolocation": [
"GeographicCoordinates": [
"Latitude": "",
"Longitude": ""
],
"UTMCoordinates": [
"UTMZone": "",
"UTMEastward": "",
"UTMNorthward": ""
]
],
"ProtectedMobileData": "",
"SensitiveMobileData": [
"MSISDN": 0,
"IMSI": 0,
"IMEI": 0
]
],
"StoredValueAccountID": [
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
]
]
],
"LoyaltyData": [
[
"CardAcquisitionReference": [],
"LoyaltyAccountID": [
"EntryMode": [],
"IdentificationType": "",
"IdentificationSupport": "",
"LoyaltyID": ""
],
"LoyaltyAmount": [
"LoyaltyUnit": "",
"Currency": "",
"AmountValue": ""
]
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/payment")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Print Request
{{baseUrl}}/print
BODY json
{
"PrintOutput": {
"DocumentQualifier": "",
"ResponseMode": "",
"IntegratedPrintFlag": false,
"RequiredSignatureFlag": false,
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/print");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"PrintOutput\": {\n \"DocumentQualifier\": \"\",\n \"ResponseMode\": \"\",\n \"IntegratedPrintFlag\": false,\n \"RequiredSignatureFlag\": false,\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/print" {:content-type :json
:form-params {:PrintOutput {:DocumentQualifier ""
:ResponseMode ""
:IntegratedPrintFlag false
:RequiredSignatureFlag false
:OutputContent {:OutputFormat ""
:PredefinedContent {:ReferenceID ""
:Language ""}
:OutputText [{:Text ""
:CharacterSet 0
:Font ""
:StartRow 0
:StartColumn 0
:Color ""
:CharacterWidth ""
:CharacterHeight ""
:CharacterStyle ""
:Alignment ""
:EndOfLineFlag false}]
:OutputXHTML ""
:OutputBarcode {:BarcodeType ""
:BarcodeValue ""}}}}})
require "http/client"
url = "{{baseUrl}}/print"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"PrintOutput\": {\n \"DocumentQualifier\": \"\",\n \"ResponseMode\": \"\",\n \"IntegratedPrintFlag\": false,\n \"RequiredSignatureFlag\": false,\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n }\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/print"),
Content = new StringContent("{\n \"PrintOutput\": {\n \"DocumentQualifier\": \"\",\n \"ResponseMode\": \"\",\n \"IntegratedPrintFlag\": false,\n \"RequiredSignatureFlag\": false,\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/print");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"PrintOutput\": {\n \"DocumentQualifier\": \"\",\n \"ResponseMode\": \"\",\n \"IntegratedPrintFlag\": false,\n \"RequiredSignatureFlag\": false,\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/print"
payload := strings.NewReader("{\n \"PrintOutput\": {\n \"DocumentQualifier\": \"\",\n \"ResponseMode\": \"\",\n \"IntegratedPrintFlag\": false,\n \"RequiredSignatureFlag\": false,\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n }\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(res)
fmt.Println(string(body))
}
POST /baseUrl/print HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 761
{
"PrintOutput": {
"DocumentQualifier": "",
"ResponseMode": "",
"IntegratedPrintFlag": false,
"RequiredSignatureFlag": false,
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/print")
.setHeader("content-type", "application/json")
.setBody("{\n \"PrintOutput\": {\n \"DocumentQualifier\": \"\",\n \"ResponseMode\": \"\",\n \"IntegratedPrintFlag\": false,\n \"RequiredSignatureFlag\": false,\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/print"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"PrintOutput\": {\n \"DocumentQualifier\": \"\",\n \"ResponseMode\": \"\",\n \"IntegratedPrintFlag\": false,\n \"RequiredSignatureFlag\": false,\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"PrintOutput\": {\n \"DocumentQualifier\": \"\",\n \"ResponseMode\": \"\",\n \"IntegratedPrintFlag\": false,\n \"RequiredSignatureFlag\": false,\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/print")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/print")
.header("content-type", "application/json")
.body("{\n \"PrintOutput\": {\n \"DocumentQualifier\": \"\",\n \"ResponseMode\": \"\",\n \"IntegratedPrintFlag\": false,\n \"RequiredSignatureFlag\": false,\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n }\n }\n}")
.asString();
const data = JSON.stringify({
PrintOutput: {
DocumentQualifier: '',
ResponseMode: '',
IntegratedPrintFlag: false,
RequiredSignatureFlag: false,
OutputContent: {
OutputFormat: '',
PredefinedContent: {
ReferenceID: '',
Language: ''
},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {
BarcodeType: '',
BarcodeValue: ''
}
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/print');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/print',
headers: {'content-type': 'application/json'},
data: {
PrintOutput: {
DocumentQualifier: '',
ResponseMode: '',
IntegratedPrintFlag: false,
RequiredSignatureFlag: false,
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/print';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"PrintOutput":{"DocumentQualifier":"","ResponseMode":"","IntegratedPrintFlag":false,"RequiredSignatureFlag":false,"OutputContent":{"OutputFormat":"","PredefinedContent":{"ReferenceID":"","Language":""},"OutputText":[{"Text":"","CharacterSet":0,"Font":"","StartRow":0,"StartColumn":0,"Color":"","CharacterWidth":"","CharacterHeight":"","CharacterStyle":"","Alignment":"","EndOfLineFlag":false}],"OutputXHTML":"","OutputBarcode":{"BarcodeType":"","BarcodeValue":""}}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/print',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "PrintOutput": {\n "DocumentQualifier": "",\n "ResponseMode": "",\n "IntegratedPrintFlag": false,\n "RequiredSignatureFlag": false,\n "OutputContent": {\n "OutputFormat": "",\n "PredefinedContent": {\n "ReferenceID": "",\n "Language": ""\n },\n "OutputText": [\n {\n "Text": "",\n "CharacterSet": 0,\n "Font": "",\n "StartRow": 0,\n "StartColumn": 0,\n "Color": "",\n "CharacterWidth": "",\n "CharacterHeight": "",\n "CharacterStyle": "",\n "Alignment": "",\n "EndOfLineFlag": false\n }\n ],\n "OutputXHTML": "",\n "OutputBarcode": {\n "BarcodeType": "",\n "BarcodeValue": ""\n }\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"PrintOutput\": {\n \"DocumentQualifier\": \"\",\n \"ResponseMode\": \"\",\n \"IntegratedPrintFlag\": false,\n \"RequiredSignatureFlag\": false,\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/print")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/print',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
PrintOutput: {
DocumentQualifier: '',
ResponseMode: '',
IntegratedPrintFlag: false,
RequiredSignatureFlag: false,
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
}
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/print',
headers: {'content-type': 'application/json'},
body: {
PrintOutput: {
DocumentQualifier: '',
ResponseMode: '',
IntegratedPrintFlag: false,
RequiredSignatureFlag: false,
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
}
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/print');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
PrintOutput: {
DocumentQualifier: '',
ResponseMode: '',
IntegratedPrintFlag: false,
RequiredSignatureFlag: false,
OutputContent: {
OutputFormat: '',
PredefinedContent: {
ReferenceID: '',
Language: ''
},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {
BarcodeType: '',
BarcodeValue: ''
}
}
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/print',
headers: {'content-type': 'application/json'},
data: {
PrintOutput: {
DocumentQualifier: '',
ResponseMode: '',
IntegratedPrintFlag: false,
RequiredSignatureFlag: false,
OutputContent: {
OutputFormat: '',
PredefinedContent: {ReferenceID: '', Language: ''},
OutputText: [
{
Text: '',
CharacterSet: 0,
Font: '',
StartRow: 0,
StartColumn: 0,
Color: '',
CharacterWidth: '',
CharacterHeight: '',
CharacterStyle: '',
Alignment: '',
EndOfLineFlag: false
}
],
OutputXHTML: '',
OutputBarcode: {BarcodeType: '', BarcodeValue: ''}
}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/print';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"PrintOutput":{"DocumentQualifier":"","ResponseMode":"","IntegratedPrintFlag":false,"RequiredSignatureFlag":false,"OutputContent":{"OutputFormat":"","PredefinedContent":{"ReferenceID":"","Language":""},"OutputText":[{"Text":"","CharacterSet":0,"Font":"","StartRow":0,"StartColumn":0,"Color":"","CharacterWidth":"","CharacterHeight":"","CharacterStyle":"","Alignment":"","EndOfLineFlag":false}],"OutputXHTML":"","OutputBarcode":{"BarcodeType":"","BarcodeValue":""}}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"PrintOutput": @{ @"DocumentQualifier": @"", @"ResponseMode": @"", @"IntegratedPrintFlag": @NO, @"RequiredSignatureFlag": @NO, @"OutputContent": @{ @"OutputFormat": @"", @"PredefinedContent": @{ @"ReferenceID": @"", @"Language": @"" }, @"OutputText": @[ @{ @"Text": @"", @"CharacterSet": @0, @"Font": @"", @"StartRow": @0, @"StartColumn": @0, @"Color": @"", @"CharacterWidth": @"", @"CharacterHeight": @"", @"CharacterStyle": @"", @"Alignment": @"", @"EndOfLineFlag": @NO } ], @"OutputXHTML": @"", @"OutputBarcode": @{ @"BarcodeType": @"", @"BarcodeValue": @"" } } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/print"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/print" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"PrintOutput\": {\n \"DocumentQualifier\": \"\",\n \"ResponseMode\": \"\",\n \"IntegratedPrintFlag\": false,\n \"RequiredSignatureFlag\": false,\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n }\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/print",
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([
'PrintOutput' => [
'DocumentQualifier' => '',
'ResponseMode' => '',
'IntegratedPrintFlag' => null,
'RequiredSignatureFlag' => null,
'OutputContent' => [
'OutputFormat' => '',
'PredefinedContent' => [
'ReferenceID' => '',
'Language' => ''
],
'OutputText' => [
[
'Text' => '',
'CharacterSet' => 0,
'Font' => '',
'StartRow' => 0,
'StartColumn' => 0,
'Color' => '',
'CharacterWidth' => '',
'CharacterHeight' => '',
'CharacterStyle' => '',
'Alignment' => '',
'EndOfLineFlag' => null
]
],
'OutputXHTML' => '',
'OutputBarcode' => [
'BarcodeType' => '',
'BarcodeValue' => ''
]
]
]
]),
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;
}
request('POST', '{{baseUrl}}/print', [
'body' => '{
"PrintOutput": {
"DocumentQualifier": "",
"ResponseMode": "",
"IntegratedPrintFlag": false,
"RequiredSignatureFlag": false,
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/print');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'PrintOutput' => [
'DocumentQualifier' => '',
'ResponseMode' => '',
'IntegratedPrintFlag' => null,
'RequiredSignatureFlag' => null,
'OutputContent' => [
'OutputFormat' => '',
'PredefinedContent' => [
'ReferenceID' => '',
'Language' => ''
],
'OutputText' => [
[
'Text' => '',
'CharacterSet' => 0,
'Font' => '',
'StartRow' => 0,
'StartColumn' => 0,
'Color' => '',
'CharacterWidth' => '',
'CharacterHeight' => '',
'CharacterStyle' => '',
'Alignment' => '',
'EndOfLineFlag' => null
]
],
'OutputXHTML' => '',
'OutputBarcode' => [
'BarcodeType' => '',
'BarcodeValue' => ''
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'PrintOutput' => [
'DocumentQualifier' => '',
'ResponseMode' => '',
'IntegratedPrintFlag' => null,
'RequiredSignatureFlag' => null,
'OutputContent' => [
'OutputFormat' => '',
'PredefinedContent' => [
'ReferenceID' => '',
'Language' => ''
],
'OutputText' => [
[
'Text' => '',
'CharacterSet' => 0,
'Font' => '',
'StartRow' => 0,
'StartColumn' => 0,
'Color' => '',
'CharacterWidth' => '',
'CharacterHeight' => '',
'CharacterStyle' => '',
'Alignment' => '',
'EndOfLineFlag' => null
]
],
'OutputXHTML' => '',
'OutputBarcode' => [
'BarcodeType' => '',
'BarcodeValue' => ''
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/print');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/print' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"PrintOutput": {
"DocumentQualifier": "",
"ResponseMode": "",
"IntegratedPrintFlag": false,
"RequiredSignatureFlag": false,
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/print' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"PrintOutput": {
"DocumentQualifier": "",
"ResponseMode": "",
"IntegratedPrintFlag": false,
"RequiredSignatureFlag": false,
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"PrintOutput\": {\n \"DocumentQualifier\": \"\",\n \"ResponseMode\": \"\",\n \"IntegratedPrintFlag\": false,\n \"RequiredSignatureFlag\": false,\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/print", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/print"
payload = { "PrintOutput": {
"DocumentQualifier": "",
"ResponseMode": "",
"IntegratedPrintFlag": False,
"RequiredSignatureFlag": False,
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": False
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
}
} }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/print"
payload <- "{\n \"PrintOutput\": {\n \"DocumentQualifier\": \"\",\n \"ResponseMode\": \"\",\n \"IntegratedPrintFlag\": false,\n \"RequiredSignatureFlag\": false,\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n }\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/print")
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 \"PrintOutput\": {\n \"DocumentQualifier\": \"\",\n \"ResponseMode\": \"\",\n \"IntegratedPrintFlag\": false,\n \"RequiredSignatureFlag\": false,\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/print') do |req|
req.body = "{\n \"PrintOutput\": {\n \"DocumentQualifier\": \"\",\n \"ResponseMode\": \"\",\n \"IntegratedPrintFlag\": false,\n \"RequiredSignatureFlag\": false,\n \"OutputContent\": {\n \"OutputFormat\": \"\",\n \"PredefinedContent\": {\n \"ReferenceID\": \"\",\n \"Language\": \"\"\n },\n \"OutputText\": [\n {\n \"Text\": \"\",\n \"CharacterSet\": 0,\n \"Font\": \"\",\n \"StartRow\": 0,\n \"StartColumn\": 0,\n \"Color\": \"\",\n \"CharacterWidth\": \"\",\n \"CharacterHeight\": \"\",\n \"CharacterStyle\": \"\",\n \"Alignment\": \"\",\n \"EndOfLineFlag\": false\n }\n ],\n \"OutputXHTML\": \"\",\n \"OutputBarcode\": {\n \"BarcodeType\": \"\",\n \"BarcodeValue\": \"\"\n }\n }\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/print";
let payload = json!({"PrintOutput": json!({
"DocumentQualifier": "",
"ResponseMode": "",
"IntegratedPrintFlag": false,
"RequiredSignatureFlag": false,
"OutputContent": json!({
"OutputFormat": "",
"PredefinedContent": json!({
"ReferenceID": "",
"Language": ""
}),
"OutputText": (
json!({
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
})
),
"OutputXHTML": "",
"OutputBarcode": json!({
"BarcodeType": "",
"BarcodeValue": ""
})
})
})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/print \
--header 'content-type: application/json' \
--data '{
"PrintOutput": {
"DocumentQualifier": "",
"ResponseMode": "",
"IntegratedPrintFlag": false,
"RequiredSignatureFlag": false,
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
}
}
}'
echo '{
"PrintOutput": {
"DocumentQualifier": "",
"ResponseMode": "",
"IntegratedPrintFlag": false,
"RequiredSignatureFlag": false,
"OutputContent": {
"OutputFormat": "",
"PredefinedContent": {
"ReferenceID": "",
"Language": ""
},
"OutputText": [
{
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
}
],
"OutputXHTML": "",
"OutputBarcode": {
"BarcodeType": "",
"BarcodeValue": ""
}
}
}
}' | \
http POST {{baseUrl}}/print \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "PrintOutput": {\n "DocumentQualifier": "",\n "ResponseMode": "",\n "IntegratedPrintFlag": false,\n "RequiredSignatureFlag": false,\n "OutputContent": {\n "OutputFormat": "",\n "PredefinedContent": {\n "ReferenceID": "",\n "Language": ""\n },\n "OutputText": [\n {\n "Text": "",\n "CharacterSet": 0,\n "Font": "",\n "StartRow": 0,\n "StartColumn": 0,\n "Color": "",\n "CharacterWidth": "",\n "CharacterHeight": "",\n "CharacterStyle": "",\n "Alignment": "",\n "EndOfLineFlag": false\n }\n ],\n "OutputXHTML": "",\n "OutputBarcode": {\n "BarcodeType": "",\n "BarcodeValue": ""\n }\n }\n }\n}' \
--output-document \
- {{baseUrl}}/print
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["PrintOutput": [
"DocumentQualifier": "",
"ResponseMode": "",
"IntegratedPrintFlag": false,
"RequiredSignatureFlag": false,
"OutputContent": [
"OutputFormat": "",
"PredefinedContent": [
"ReferenceID": "",
"Language": ""
],
"OutputText": [
[
"Text": "",
"CharacterSet": 0,
"Font": "",
"StartRow": 0,
"StartColumn": 0,
"Color": "",
"CharacterWidth": "",
"CharacterHeight": "",
"CharacterStyle": "",
"Alignment": "",
"EndOfLineFlag": false
]
],
"OutputXHTML": "",
"OutputBarcode": [
"BarcodeType": "",
"BarcodeValue": ""
]
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/print")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Reconciliation Request
{{baseUrl}}/reconciliation
BODY json
{
"ReconciliationType": "",
"AcquirerID": [],
"POIReconciliationID": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/reconciliation");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ReconciliationType\": \"\",\n \"AcquirerID\": [],\n \"POIReconciliationID\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/reconciliation" {:content-type :json
:form-params {:ReconciliationType ""
:AcquirerID []
:POIReconciliationID 0}})
require "http/client"
url = "{{baseUrl}}/reconciliation"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ReconciliationType\": \"\",\n \"AcquirerID\": [],\n \"POIReconciliationID\": 0\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/reconciliation"),
Content = new StringContent("{\n \"ReconciliationType\": \"\",\n \"AcquirerID\": [],\n \"POIReconciliationID\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/reconciliation");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ReconciliationType\": \"\",\n \"AcquirerID\": [],\n \"POIReconciliationID\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/reconciliation"
payload := strings.NewReader("{\n \"ReconciliationType\": \"\",\n \"AcquirerID\": [],\n \"POIReconciliationID\": 0\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(res)
fmt.Println(string(body))
}
POST /baseUrl/reconciliation HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 78
{
"ReconciliationType": "",
"AcquirerID": [],
"POIReconciliationID": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/reconciliation")
.setHeader("content-type", "application/json")
.setBody("{\n \"ReconciliationType\": \"\",\n \"AcquirerID\": [],\n \"POIReconciliationID\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/reconciliation"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ReconciliationType\": \"\",\n \"AcquirerID\": [],\n \"POIReconciliationID\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ReconciliationType\": \"\",\n \"AcquirerID\": [],\n \"POIReconciliationID\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/reconciliation")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/reconciliation")
.header("content-type", "application/json")
.body("{\n \"ReconciliationType\": \"\",\n \"AcquirerID\": [],\n \"POIReconciliationID\": 0\n}")
.asString();
const data = JSON.stringify({
ReconciliationType: '',
AcquirerID: [],
POIReconciliationID: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/reconciliation');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/reconciliation',
headers: {'content-type': 'application/json'},
data: {ReconciliationType: '', AcquirerID: [], POIReconciliationID: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/reconciliation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ReconciliationType":"","AcquirerID":[],"POIReconciliationID":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/reconciliation',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ReconciliationType": "",\n "AcquirerID": [],\n "POIReconciliationID": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ReconciliationType\": \"\",\n \"AcquirerID\": [],\n \"POIReconciliationID\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/reconciliation")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/reconciliation',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ReconciliationType: '', AcquirerID: [], POIReconciliationID: 0}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/reconciliation',
headers: {'content-type': 'application/json'},
body: {ReconciliationType: '', AcquirerID: [], POIReconciliationID: 0},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/reconciliation');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ReconciliationType: '',
AcquirerID: [],
POIReconciliationID: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/reconciliation',
headers: {'content-type': 'application/json'},
data: {ReconciliationType: '', AcquirerID: [], POIReconciliationID: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/reconciliation';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ReconciliationType":"","AcquirerID":[],"POIReconciliationID":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ReconciliationType": @"",
@"AcquirerID": @[ ],
@"POIReconciliationID": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/reconciliation"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/reconciliation" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ReconciliationType\": \"\",\n \"AcquirerID\": [],\n \"POIReconciliationID\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/reconciliation",
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([
'ReconciliationType' => '',
'AcquirerID' => [
],
'POIReconciliationID' => 0
]),
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;
}
request('POST', '{{baseUrl}}/reconciliation', [
'body' => '{
"ReconciliationType": "",
"AcquirerID": [],
"POIReconciliationID": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/reconciliation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ReconciliationType' => '',
'AcquirerID' => [
],
'POIReconciliationID' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ReconciliationType' => '',
'AcquirerID' => [
],
'POIReconciliationID' => 0
]));
$request->setRequestUrl('{{baseUrl}}/reconciliation');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/reconciliation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ReconciliationType": "",
"AcquirerID": [],
"POIReconciliationID": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/reconciliation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ReconciliationType": "",
"AcquirerID": [],
"POIReconciliationID": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ReconciliationType\": \"\",\n \"AcquirerID\": [],\n \"POIReconciliationID\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/reconciliation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/reconciliation"
payload = {
"ReconciliationType": "",
"AcquirerID": [],
"POIReconciliationID": 0
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/reconciliation"
payload <- "{\n \"ReconciliationType\": \"\",\n \"AcquirerID\": [],\n \"POIReconciliationID\": 0\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/reconciliation")
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 \"ReconciliationType\": \"\",\n \"AcquirerID\": [],\n \"POIReconciliationID\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/reconciliation') do |req|
req.body = "{\n \"ReconciliationType\": \"\",\n \"AcquirerID\": [],\n \"POIReconciliationID\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/reconciliation";
let payload = json!({
"ReconciliationType": "",
"AcquirerID": (),
"POIReconciliationID": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/reconciliation \
--header 'content-type: application/json' \
--data '{
"ReconciliationType": "",
"AcquirerID": [],
"POIReconciliationID": 0
}'
echo '{
"ReconciliationType": "",
"AcquirerID": [],
"POIReconciliationID": 0
}' | \
http POST {{baseUrl}}/reconciliation \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "ReconciliationType": "",\n "AcquirerID": [],\n "POIReconciliationID": 0\n}' \
--output-document \
- {{baseUrl}}/reconciliation
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"ReconciliationType": "",
"AcquirerID": [],
"POIReconciliationID": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/reconciliation")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Reversal Request
{{baseUrl}}/reversal
BODY json
{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"ReversedAmount": "",
"ReversalReason": "",
"CustomerOrder": {
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/reversal");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ReversedAmount\": \"\",\n \"ReversalReason\": \"\",\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/reversal" {:content-type :json
:form-params {:SaleData {:OperatorID ""
:OperatorLanguage ""
:ShiftNumber ""
:SaleTransactionID {:TransactionID ""
:TimeStamp ""}
:SaleReferenceID ""
:SaleTerminalData {:TotalsGroupID ""}
:TokenRequestedType ""
:CustomerOrderID ""
:CustomerOrderReq []
:SaleToPOIData ""
:SaleToAcquirerData ""
:SaleToIssuerData {:StatementReference ""}}
:OriginalPOITransaction {:SaleID ""
:POIID ""
:POITransactionID {}
:ReuseCardDataFlag false
:ApprovalCode ""
:AcquirerID 0
:AmountValue ""
:HostTransactionID {}}
:ReversedAmount ""
:ReversalReason ""
:CustomerOrder {:CustomerOrderID ""
:SaleReferenceID ""
:OpenOrderState false
:StartDate ""
:EndDate ""
:ForecastedAmount ""
:CurrentAmount ""
:Currency ""
:AccessedBy ""
:AdditionalInformation ""}}})
require "http/client"
url = "{{baseUrl}}/reversal"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ReversedAmount\": \"\",\n \"ReversalReason\": \"\",\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/reversal"),
Content = new StringContent("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ReversedAmount\": \"\",\n \"ReversalReason\": \"\",\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/reversal");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ReversedAmount\": \"\",\n \"ReversalReason\": \"\",\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/reversal"
payload := strings.NewReader("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ReversedAmount\": \"\",\n \"ReversalReason\": \"\",\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/reversal HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1018
{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"ReversedAmount": "",
"ReversalReason": "",
"CustomerOrder": {
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/reversal")
.setHeader("content-type", "application/json")
.setBody("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ReversedAmount\": \"\",\n \"ReversalReason\": \"\",\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/reversal"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ReversedAmount\": \"\",\n \"ReversalReason\": \"\",\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ReversedAmount\": \"\",\n \"ReversalReason\": \"\",\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/reversal")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/reversal")
.header("content-type", "application/json")
.body("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ReversedAmount\": \"\",\n \"ReversalReason\": \"\",\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {
TransactionID: '',
TimeStamp: ''
},
SaleReferenceID: '',
SaleTerminalData: {
TotalsGroupID: ''
},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {
StatementReference: ''
}
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
ReversedAmount: '',
ReversalReason: '',
CustomerOrder: {
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/reversal');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/reversal',
headers: {'content-type': 'application/json'},
data: {
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
ReversedAmount: '',
ReversalReason: '',
CustomerOrder: {
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/reversal';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"SaleData":{"OperatorID":"","OperatorLanguage":"","ShiftNumber":"","SaleTransactionID":{"TransactionID":"","TimeStamp":""},"SaleReferenceID":"","SaleTerminalData":{"TotalsGroupID":""},"TokenRequestedType":"","CustomerOrderID":"","CustomerOrderReq":[],"SaleToPOIData":"","SaleToAcquirerData":"","SaleToIssuerData":{"StatementReference":""}},"OriginalPOITransaction":{"SaleID":"","POIID":"","POITransactionID":{},"ReuseCardDataFlag":false,"ApprovalCode":"","AcquirerID":0,"AmountValue":"","HostTransactionID":{}},"ReversedAmount":"","ReversalReason":"","CustomerOrder":{"CustomerOrderID":"","SaleReferenceID":"","OpenOrderState":false,"StartDate":"","EndDate":"","ForecastedAmount":"","CurrentAmount":"","Currency":"","AccessedBy":"","AdditionalInformation":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/reversal',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "SaleData": {\n "OperatorID": "",\n "OperatorLanguage": "",\n "ShiftNumber": "",\n "SaleTransactionID": {\n "TransactionID": "",\n "TimeStamp": ""\n },\n "SaleReferenceID": "",\n "SaleTerminalData": {\n "TotalsGroupID": ""\n },\n "TokenRequestedType": "",\n "CustomerOrderID": "",\n "CustomerOrderReq": [],\n "SaleToPOIData": "",\n "SaleToAcquirerData": "",\n "SaleToIssuerData": {\n "StatementReference": ""\n }\n },\n "OriginalPOITransaction": {\n "SaleID": "",\n "POIID": "",\n "POITransactionID": {},\n "ReuseCardDataFlag": false,\n "ApprovalCode": "",\n "AcquirerID": 0,\n "AmountValue": "",\n "HostTransactionID": {}\n },\n "ReversedAmount": "",\n "ReversalReason": "",\n "CustomerOrder": {\n "CustomerOrderID": "",\n "SaleReferenceID": "",\n "OpenOrderState": false,\n "StartDate": "",\n "EndDate": "",\n "ForecastedAmount": "",\n "CurrentAmount": "",\n "Currency": "",\n "AccessedBy": "",\n "AdditionalInformation": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ReversedAmount\": \"\",\n \"ReversalReason\": \"\",\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/reversal")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/reversal',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
ReversedAmount: '',
ReversalReason: '',
CustomerOrder: {
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/reversal',
headers: {'content-type': 'application/json'},
body: {
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
ReversedAmount: '',
ReversalReason: '',
CustomerOrder: {
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/reversal');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {
TransactionID: '',
TimeStamp: ''
},
SaleReferenceID: '',
SaleTerminalData: {
TotalsGroupID: ''
},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {
StatementReference: ''
}
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
ReversedAmount: '',
ReversalReason: '',
CustomerOrder: {
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/reversal',
headers: {'content-type': 'application/json'},
data: {
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
ReversedAmount: '',
ReversalReason: '',
CustomerOrder: {
CustomerOrderID: '',
SaleReferenceID: '',
OpenOrderState: false,
StartDate: '',
EndDate: '',
ForecastedAmount: '',
CurrentAmount: '',
Currency: '',
AccessedBy: '',
AdditionalInformation: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/reversal';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"SaleData":{"OperatorID":"","OperatorLanguage":"","ShiftNumber":"","SaleTransactionID":{"TransactionID":"","TimeStamp":""},"SaleReferenceID":"","SaleTerminalData":{"TotalsGroupID":""},"TokenRequestedType":"","CustomerOrderID":"","CustomerOrderReq":[],"SaleToPOIData":"","SaleToAcquirerData":"","SaleToIssuerData":{"StatementReference":""}},"OriginalPOITransaction":{"SaleID":"","POIID":"","POITransactionID":{},"ReuseCardDataFlag":false,"ApprovalCode":"","AcquirerID":0,"AmountValue":"","HostTransactionID":{}},"ReversedAmount":"","ReversalReason":"","CustomerOrder":{"CustomerOrderID":"","SaleReferenceID":"","OpenOrderState":false,"StartDate":"","EndDate":"","ForecastedAmount":"","CurrentAmount":"","Currency":"","AccessedBy":"","AdditionalInformation":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"SaleData": @{ @"OperatorID": @"", @"OperatorLanguage": @"", @"ShiftNumber": @"", @"SaleTransactionID": @{ @"TransactionID": @"", @"TimeStamp": @"" }, @"SaleReferenceID": @"", @"SaleTerminalData": @{ @"TotalsGroupID": @"" }, @"TokenRequestedType": @"", @"CustomerOrderID": @"", @"CustomerOrderReq": @[ ], @"SaleToPOIData": @"", @"SaleToAcquirerData": @"", @"SaleToIssuerData": @{ @"StatementReference": @"" } },
@"OriginalPOITransaction": @{ @"SaleID": @"", @"POIID": @"", @"POITransactionID": @{ }, @"ReuseCardDataFlag": @NO, @"ApprovalCode": @"", @"AcquirerID": @0, @"AmountValue": @"", @"HostTransactionID": @{ } },
@"ReversedAmount": @"",
@"ReversalReason": @"",
@"CustomerOrder": @{ @"CustomerOrderID": @"", @"SaleReferenceID": @"", @"OpenOrderState": @NO, @"StartDate": @"", @"EndDate": @"", @"ForecastedAmount": @"", @"CurrentAmount": @"", @"Currency": @"", @"AccessedBy": @"", @"AdditionalInformation": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/reversal"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/reversal" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ReversedAmount\": \"\",\n \"ReversalReason\": \"\",\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/reversal",
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([
'SaleData' => [
'OperatorID' => '',
'OperatorLanguage' => '',
'ShiftNumber' => '',
'SaleTransactionID' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'SaleReferenceID' => '',
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TokenRequestedType' => '',
'CustomerOrderID' => '',
'CustomerOrderReq' => [
],
'SaleToPOIData' => '',
'SaleToAcquirerData' => '',
'SaleToIssuerData' => [
'StatementReference' => ''
]
],
'OriginalPOITransaction' => [
'SaleID' => '',
'POIID' => '',
'POITransactionID' => [
],
'ReuseCardDataFlag' => null,
'ApprovalCode' => '',
'AcquirerID' => 0,
'AmountValue' => '',
'HostTransactionID' => [
]
],
'ReversedAmount' => '',
'ReversalReason' => '',
'CustomerOrder' => [
'CustomerOrderID' => '',
'SaleReferenceID' => '',
'OpenOrderState' => null,
'StartDate' => '',
'EndDate' => '',
'ForecastedAmount' => '',
'CurrentAmount' => '',
'Currency' => '',
'AccessedBy' => '',
'AdditionalInformation' => ''
]
]),
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;
}
request('POST', '{{baseUrl}}/reversal', [
'body' => '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"ReversedAmount": "",
"ReversalReason": "",
"CustomerOrder": {
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/reversal');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SaleData' => [
'OperatorID' => '',
'OperatorLanguage' => '',
'ShiftNumber' => '',
'SaleTransactionID' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'SaleReferenceID' => '',
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TokenRequestedType' => '',
'CustomerOrderID' => '',
'CustomerOrderReq' => [
],
'SaleToPOIData' => '',
'SaleToAcquirerData' => '',
'SaleToIssuerData' => [
'StatementReference' => ''
]
],
'OriginalPOITransaction' => [
'SaleID' => '',
'POIID' => '',
'POITransactionID' => [
],
'ReuseCardDataFlag' => null,
'ApprovalCode' => '',
'AcquirerID' => 0,
'AmountValue' => '',
'HostTransactionID' => [
]
],
'ReversedAmount' => '',
'ReversalReason' => '',
'CustomerOrder' => [
'CustomerOrderID' => '',
'SaleReferenceID' => '',
'OpenOrderState' => null,
'StartDate' => '',
'EndDate' => '',
'ForecastedAmount' => '',
'CurrentAmount' => '',
'Currency' => '',
'AccessedBy' => '',
'AdditionalInformation' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SaleData' => [
'OperatorID' => '',
'OperatorLanguage' => '',
'ShiftNumber' => '',
'SaleTransactionID' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'SaleReferenceID' => '',
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TokenRequestedType' => '',
'CustomerOrderID' => '',
'CustomerOrderReq' => [
],
'SaleToPOIData' => '',
'SaleToAcquirerData' => '',
'SaleToIssuerData' => [
'StatementReference' => ''
]
],
'OriginalPOITransaction' => [
'SaleID' => '',
'POIID' => '',
'POITransactionID' => [
],
'ReuseCardDataFlag' => null,
'ApprovalCode' => '',
'AcquirerID' => 0,
'AmountValue' => '',
'HostTransactionID' => [
]
],
'ReversedAmount' => '',
'ReversalReason' => '',
'CustomerOrder' => [
'CustomerOrderID' => '',
'SaleReferenceID' => '',
'OpenOrderState' => null,
'StartDate' => '',
'EndDate' => '',
'ForecastedAmount' => '',
'CurrentAmount' => '',
'Currency' => '',
'AccessedBy' => '',
'AdditionalInformation' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/reversal');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/reversal' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"ReversedAmount": "",
"ReversalReason": "",
"CustomerOrder": {
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/reversal' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"ReversedAmount": "",
"ReversalReason": "",
"CustomerOrder": {
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ReversedAmount\": \"\",\n \"ReversalReason\": \"\",\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/reversal", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/reversal"
payload = {
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": { "TotalsGroupID": "" },
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": { "StatementReference": "" }
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": False,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"ReversedAmount": "",
"ReversalReason": "",
"CustomerOrder": {
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": False,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/reversal"
payload <- "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ReversedAmount\": \"\",\n \"ReversalReason\": \"\",\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/reversal")
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 \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ReversedAmount\": \"\",\n \"ReversalReason\": \"\",\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/reversal') do |req|
req.body = "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ReversedAmount\": \"\",\n \"ReversalReason\": \"\",\n \"CustomerOrder\": {\n \"CustomerOrderID\": \"\",\n \"SaleReferenceID\": \"\",\n \"OpenOrderState\": false,\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"ForecastedAmount\": \"\",\n \"CurrentAmount\": \"\",\n \"Currency\": \"\",\n \"AccessedBy\": \"\",\n \"AdditionalInformation\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/reversal";
let payload = json!({
"SaleData": json!({
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": json!({
"TransactionID": "",
"TimeStamp": ""
}),
"SaleReferenceID": "",
"SaleTerminalData": json!({"TotalsGroupID": ""}),
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": (),
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": json!({"StatementReference": ""})
}),
"OriginalPOITransaction": json!({
"SaleID": "",
"POIID": "",
"POITransactionID": json!({}),
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": json!({})
}),
"ReversedAmount": "",
"ReversalReason": "",
"CustomerOrder": json!({
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/reversal \
--header 'content-type: application/json' \
--data '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"ReversedAmount": "",
"ReversalReason": "",
"CustomerOrder": {
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
}
}'
echo '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"ReversedAmount": "",
"ReversalReason": "",
"CustomerOrder": {
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
}
}' | \
http POST {{baseUrl}}/reversal \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "SaleData": {\n "OperatorID": "",\n "OperatorLanguage": "",\n "ShiftNumber": "",\n "SaleTransactionID": {\n "TransactionID": "",\n "TimeStamp": ""\n },\n "SaleReferenceID": "",\n "SaleTerminalData": {\n "TotalsGroupID": ""\n },\n "TokenRequestedType": "",\n "CustomerOrderID": "",\n "CustomerOrderReq": [],\n "SaleToPOIData": "",\n "SaleToAcquirerData": "",\n "SaleToIssuerData": {\n "StatementReference": ""\n }\n },\n "OriginalPOITransaction": {\n "SaleID": "",\n "POIID": "",\n "POITransactionID": {},\n "ReuseCardDataFlag": false,\n "ApprovalCode": "",\n "AcquirerID": 0,\n "AmountValue": "",\n "HostTransactionID": {}\n },\n "ReversedAmount": "",\n "ReversalReason": "",\n "CustomerOrder": {\n "CustomerOrderID": "",\n "SaleReferenceID": "",\n "OpenOrderState": false,\n "StartDate": "",\n "EndDate": "",\n "ForecastedAmount": "",\n "CurrentAmount": "",\n "Currency": "",\n "AccessedBy": "",\n "AdditionalInformation": ""\n }\n}' \
--output-document \
- {{baseUrl}}/reversal
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"SaleData": [
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": [
"TransactionID": "",
"TimeStamp": ""
],
"SaleReferenceID": "",
"SaleTerminalData": ["TotalsGroupID": ""],
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": ["StatementReference": ""]
],
"OriginalPOITransaction": [
"SaleID": "",
"POIID": "",
"POITransactionID": [],
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": []
],
"ReversedAmount": "",
"ReversalReason": "",
"CustomerOrder": [
"CustomerOrderID": "",
"SaleReferenceID": "",
"OpenOrderState": false,
"StartDate": "",
"EndDate": "",
"ForecastedAmount": "",
"CurrentAmount": "",
"Currency": "",
"AccessedBy": "",
"AdditionalInformation": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/reversal")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
StoredValue Request
{{baseUrl}}/storedvalue
BODY json
{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"StoredValueData": [
{
"StoredValueProvider": "",
"StoredValueTransactionType": "",
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"ProductCode": 0,
"EanUpc": 0,
"ItemAmount": "",
"Currency": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/storedvalue");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"StoredValueData\": [\n {\n \"StoredValueProvider\": \"\",\n \"StoredValueTransactionType\": \"\",\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ItemAmount\": \"\",\n \"Currency\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/storedvalue" {:content-type :json
:form-params {:SaleData {:OperatorID ""
:OperatorLanguage ""
:ShiftNumber ""
:SaleTransactionID {:TransactionID ""
:TimeStamp ""}
:SaleReferenceID ""
:SaleTerminalData {:TotalsGroupID ""}
:TokenRequestedType ""
:CustomerOrderID ""
:CustomerOrderReq []
:SaleToPOIData ""
:SaleToAcquirerData ""
:SaleToIssuerData {:StatementReference ""}}
:StoredValueData [{:StoredValueProvider ""
:StoredValueTransactionType ""
:StoredValueAccountID {:StoredValueAccountType ""
:StoredValueProvider ""
:OwnerName ""
:ExpiryDate 0
:EntryMode []
:IdentificationType ""
:StoredValueID ""}
:OriginalPOITransaction {:SaleID ""
:POIID ""
:POITransactionID {}
:ReuseCardDataFlag false
:ApprovalCode ""
:AcquirerID 0
:AmountValue ""
:HostTransactionID {}}
:ProductCode 0
:EanUpc 0
:ItemAmount ""
:Currency ""}]}})
require "http/client"
url = "{{baseUrl}}/storedvalue"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"StoredValueData\": [\n {\n \"StoredValueProvider\": \"\",\n \"StoredValueTransactionType\": \"\",\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ItemAmount\": \"\",\n \"Currency\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/storedvalue"),
Content = new StringContent("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"StoredValueData\": [\n {\n \"StoredValueProvider\": \"\",\n \"StoredValueTransactionType\": \"\",\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ItemAmount\": \"\",\n \"Currency\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/storedvalue");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"StoredValueData\": [\n {\n \"StoredValueProvider\": \"\",\n \"StoredValueTransactionType\": \"\",\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ItemAmount\": \"\",\n \"Currency\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/storedvalue"
payload := strings.NewReader("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"StoredValueData\": [\n {\n \"StoredValueProvider\": \"\",\n \"StoredValueTransactionType\": \"\",\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ItemAmount\": \"\",\n \"Currency\": \"\"\n }\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(res)
fmt.Println(string(body))
}
POST /baseUrl/storedvalue HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1186
{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"StoredValueData": [
{
"StoredValueProvider": "",
"StoredValueTransactionType": "",
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"ProductCode": 0,
"EanUpc": 0,
"ItemAmount": "",
"Currency": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/storedvalue")
.setHeader("content-type", "application/json")
.setBody("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"StoredValueData\": [\n {\n \"StoredValueProvider\": \"\",\n \"StoredValueTransactionType\": \"\",\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ItemAmount\": \"\",\n \"Currency\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/storedvalue"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"StoredValueData\": [\n {\n \"StoredValueProvider\": \"\",\n \"StoredValueTransactionType\": \"\",\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ItemAmount\": \"\",\n \"Currency\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"StoredValueData\": [\n {\n \"StoredValueProvider\": \"\",\n \"StoredValueTransactionType\": \"\",\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ItemAmount\": \"\",\n \"Currency\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/storedvalue")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/storedvalue")
.header("content-type", "application/json")
.body("{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"StoredValueData\": [\n {\n \"StoredValueProvider\": \"\",\n \"StoredValueTransactionType\": \"\",\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ItemAmount\": \"\",\n \"Currency\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {
TransactionID: '',
TimeStamp: ''
},
SaleReferenceID: '',
SaleTerminalData: {
TotalsGroupID: ''
},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {
StatementReference: ''
}
},
StoredValueData: [
{
StoredValueProvider: '',
StoredValueTransactionType: '',
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
ProductCode: 0,
EanUpc: 0,
ItemAmount: '',
Currency: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/storedvalue');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/storedvalue',
headers: {'content-type': 'application/json'},
data: {
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
StoredValueData: [
{
StoredValueProvider: '',
StoredValueTransactionType: '',
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
ProductCode: 0,
EanUpc: 0,
ItemAmount: '',
Currency: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/storedvalue';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"SaleData":{"OperatorID":"","OperatorLanguage":"","ShiftNumber":"","SaleTransactionID":{"TransactionID":"","TimeStamp":""},"SaleReferenceID":"","SaleTerminalData":{"TotalsGroupID":""},"TokenRequestedType":"","CustomerOrderID":"","CustomerOrderReq":[],"SaleToPOIData":"","SaleToAcquirerData":"","SaleToIssuerData":{"StatementReference":""}},"StoredValueData":[{"StoredValueProvider":"","StoredValueTransactionType":"","StoredValueAccountID":{"StoredValueAccountType":"","StoredValueProvider":"","OwnerName":"","ExpiryDate":0,"EntryMode":[],"IdentificationType":"","StoredValueID":""},"OriginalPOITransaction":{"SaleID":"","POIID":"","POITransactionID":{},"ReuseCardDataFlag":false,"ApprovalCode":"","AcquirerID":0,"AmountValue":"","HostTransactionID":{}},"ProductCode":0,"EanUpc":0,"ItemAmount":"","Currency":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/storedvalue',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "SaleData": {\n "OperatorID": "",\n "OperatorLanguage": "",\n "ShiftNumber": "",\n "SaleTransactionID": {\n "TransactionID": "",\n "TimeStamp": ""\n },\n "SaleReferenceID": "",\n "SaleTerminalData": {\n "TotalsGroupID": ""\n },\n "TokenRequestedType": "",\n "CustomerOrderID": "",\n "CustomerOrderReq": [],\n "SaleToPOIData": "",\n "SaleToAcquirerData": "",\n "SaleToIssuerData": {\n "StatementReference": ""\n }\n },\n "StoredValueData": [\n {\n "StoredValueProvider": "",\n "StoredValueTransactionType": "",\n "StoredValueAccountID": {\n "StoredValueAccountType": "",\n "StoredValueProvider": "",\n "OwnerName": "",\n "ExpiryDate": 0,\n "EntryMode": [],\n "IdentificationType": "",\n "StoredValueID": ""\n },\n "OriginalPOITransaction": {\n "SaleID": "",\n "POIID": "",\n "POITransactionID": {},\n "ReuseCardDataFlag": false,\n "ApprovalCode": "",\n "AcquirerID": 0,\n "AmountValue": "",\n "HostTransactionID": {}\n },\n "ProductCode": 0,\n "EanUpc": 0,\n "ItemAmount": "",\n "Currency": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"StoredValueData\": [\n {\n \"StoredValueProvider\": \"\",\n \"StoredValueTransactionType\": \"\",\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ItemAmount\": \"\",\n \"Currency\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/storedvalue")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/storedvalue',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
StoredValueData: [
{
StoredValueProvider: '',
StoredValueTransactionType: '',
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
ProductCode: 0,
EanUpc: 0,
ItemAmount: '',
Currency: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/storedvalue',
headers: {'content-type': 'application/json'},
body: {
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
StoredValueData: [
{
StoredValueProvider: '',
StoredValueTransactionType: '',
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
ProductCode: 0,
EanUpc: 0,
ItemAmount: '',
Currency: ''
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/storedvalue');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {
TransactionID: '',
TimeStamp: ''
},
SaleReferenceID: '',
SaleTerminalData: {
TotalsGroupID: ''
},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {
StatementReference: ''
}
},
StoredValueData: [
{
StoredValueProvider: '',
StoredValueTransactionType: '',
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
ProductCode: 0,
EanUpc: 0,
ItemAmount: '',
Currency: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/storedvalue',
headers: {'content-type': 'application/json'},
data: {
SaleData: {
OperatorID: '',
OperatorLanguage: '',
ShiftNumber: '',
SaleTransactionID: {TransactionID: '', TimeStamp: ''},
SaleReferenceID: '',
SaleTerminalData: {TotalsGroupID: ''},
TokenRequestedType: '',
CustomerOrderID: '',
CustomerOrderReq: [],
SaleToPOIData: '',
SaleToAcquirerData: '',
SaleToIssuerData: {StatementReference: ''}
},
StoredValueData: [
{
StoredValueProvider: '',
StoredValueTransactionType: '',
StoredValueAccountID: {
StoredValueAccountType: '',
StoredValueProvider: '',
OwnerName: '',
ExpiryDate: 0,
EntryMode: [],
IdentificationType: '',
StoredValueID: ''
},
OriginalPOITransaction: {
SaleID: '',
POIID: '',
POITransactionID: {},
ReuseCardDataFlag: false,
ApprovalCode: '',
AcquirerID: 0,
AmountValue: '',
HostTransactionID: {}
},
ProductCode: 0,
EanUpc: 0,
ItemAmount: '',
Currency: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/storedvalue';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"SaleData":{"OperatorID":"","OperatorLanguage":"","ShiftNumber":"","SaleTransactionID":{"TransactionID":"","TimeStamp":""},"SaleReferenceID":"","SaleTerminalData":{"TotalsGroupID":""},"TokenRequestedType":"","CustomerOrderID":"","CustomerOrderReq":[],"SaleToPOIData":"","SaleToAcquirerData":"","SaleToIssuerData":{"StatementReference":""}},"StoredValueData":[{"StoredValueProvider":"","StoredValueTransactionType":"","StoredValueAccountID":{"StoredValueAccountType":"","StoredValueProvider":"","OwnerName":"","ExpiryDate":0,"EntryMode":[],"IdentificationType":"","StoredValueID":""},"OriginalPOITransaction":{"SaleID":"","POIID":"","POITransactionID":{},"ReuseCardDataFlag":false,"ApprovalCode":"","AcquirerID":0,"AmountValue":"","HostTransactionID":{}},"ProductCode":0,"EanUpc":0,"ItemAmount":"","Currency":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"SaleData": @{ @"OperatorID": @"", @"OperatorLanguage": @"", @"ShiftNumber": @"", @"SaleTransactionID": @{ @"TransactionID": @"", @"TimeStamp": @"" }, @"SaleReferenceID": @"", @"SaleTerminalData": @{ @"TotalsGroupID": @"" }, @"TokenRequestedType": @"", @"CustomerOrderID": @"", @"CustomerOrderReq": @[ ], @"SaleToPOIData": @"", @"SaleToAcquirerData": @"", @"SaleToIssuerData": @{ @"StatementReference": @"" } },
@"StoredValueData": @[ @{ @"StoredValueProvider": @"", @"StoredValueTransactionType": @"", @"StoredValueAccountID": @{ @"StoredValueAccountType": @"", @"StoredValueProvider": @"", @"OwnerName": @"", @"ExpiryDate": @0, @"EntryMode": @[ ], @"IdentificationType": @"", @"StoredValueID": @"" }, @"OriginalPOITransaction": @{ @"SaleID": @"", @"POIID": @"", @"POITransactionID": @{ }, @"ReuseCardDataFlag": @NO, @"ApprovalCode": @"", @"AcquirerID": @0, @"AmountValue": @"", @"HostTransactionID": @{ } }, @"ProductCode": @0, @"EanUpc": @0, @"ItemAmount": @"", @"Currency": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/storedvalue"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/storedvalue" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"StoredValueData\": [\n {\n \"StoredValueProvider\": \"\",\n \"StoredValueTransactionType\": \"\",\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ItemAmount\": \"\",\n \"Currency\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/storedvalue",
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([
'SaleData' => [
'OperatorID' => '',
'OperatorLanguage' => '',
'ShiftNumber' => '',
'SaleTransactionID' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'SaleReferenceID' => '',
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TokenRequestedType' => '',
'CustomerOrderID' => '',
'CustomerOrderReq' => [
],
'SaleToPOIData' => '',
'SaleToAcquirerData' => '',
'SaleToIssuerData' => [
'StatementReference' => ''
]
],
'StoredValueData' => [
[
'StoredValueProvider' => '',
'StoredValueTransactionType' => '',
'StoredValueAccountID' => [
'StoredValueAccountType' => '',
'StoredValueProvider' => '',
'OwnerName' => '',
'ExpiryDate' => 0,
'EntryMode' => [
],
'IdentificationType' => '',
'StoredValueID' => ''
],
'OriginalPOITransaction' => [
'SaleID' => '',
'POIID' => '',
'POITransactionID' => [
],
'ReuseCardDataFlag' => null,
'ApprovalCode' => '',
'AcquirerID' => 0,
'AmountValue' => '',
'HostTransactionID' => [
]
],
'ProductCode' => 0,
'EanUpc' => 0,
'ItemAmount' => '',
'Currency' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/storedvalue', [
'body' => '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"StoredValueData": [
{
"StoredValueProvider": "",
"StoredValueTransactionType": "",
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"ProductCode": 0,
"EanUpc": 0,
"ItemAmount": "",
"Currency": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/storedvalue');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SaleData' => [
'OperatorID' => '',
'OperatorLanguage' => '',
'ShiftNumber' => '',
'SaleTransactionID' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'SaleReferenceID' => '',
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TokenRequestedType' => '',
'CustomerOrderID' => '',
'CustomerOrderReq' => [
],
'SaleToPOIData' => '',
'SaleToAcquirerData' => '',
'SaleToIssuerData' => [
'StatementReference' => ''
]
],
'StoredValueData' => [
[
'StoredValueProvider' => '',
'StoredValueTransactionType' => '',
'StoredValueAccountID' => [
'StoredValueAccountType' => '',
'StoredValueProvider' => '',
'OwnerName' => '',
'ExpiryDate' => 0,
'EntryMode' => [
],
'IdentificationType' => '',
'StoredValueID' => ''
],
'OriginalPOITransaction' => [
'SaleID' => '',
'POIID' => '',
'POITransactionID' => [
],
'ReuseCardDataFlag' => null,
'ApprovalCode' => '',
'AcquirerID' => 0,
'AmountValue' => '',
'HostTransactionID' => [
]
],
'ProductCode' => 0,
'EanUpc' => 0,
'ItemAmount' => '',
'Currency' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SaleData' => [
'OperatorID' => '',
'OperatorLanguage' => '',
'ShiftNumber' => '',
'SaleTransactionID' => [
'TransactionID' => '',
'TimeStamp' => ''
],
'SaleReferenceID' => '',
'SaleTerminalData' => [
'TotalsGroupID' => ''
],
'TokenRequestedType' => '',
'CustomerOrderID' => '',
'CustomerOrderReq' => [
],
'SaleToPOIData' => '',
'SaleToAcquirerData' => '',
'SaleToIssuerData' => [
'StatementReference' => ''
]
],
'StoredValueData' => [
[
'StoredValueProvider' => '',
'StoredValueTransactionType' => '',
'StoredValueAccountID' => [
'StoredValueAccountType' => '',
'StoredValueProvider' => '',
'OwnerName' => '',
'ExpiryDate' => 0,
'EntryMode' => [
],
'IdentificationType' => '',
'StoredValueID' => ''
],
'OriginalPOITransaction' => [
'SaleID' => '',
'POIID' => '',
'POITransactionID' => [
],
'ReuseCardDataFlag' => null,
'ApprovalCode' => '',
'AcquirerID' => 0,
'AmountValue' => '',
'HostTransactionID' => [
]
],
'ProductCode' => 0,
'EanUpc' => 0,
'ItemAmount' => '',
'Currency' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/storedvalue');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/storedvalue' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"StoredValueData": [
{
"StoredValueProvider": "",
"StoredValueTransactionType": "",
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"ProductCode": 0,
"EanUpc": 0,
"ItemAmount": "",
"Currency": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/storedvalue' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"StoredValueData": [
{
"StoredValueProvider": "",
"StoredValueTransactionType": "",
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"ProductCode": 0,
"EanUpc": 0,
"ItemAmount": "",
"Currency": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"StoredValueData\": [\n {\n \"StoredValueProvider\": \"\",\n \"StoredValueTransactionType\": \"\",\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ItemAmount\": \"\",\n \"Currency\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/storedvalue", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/storedvalue"
payload = {
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": { "TotalsGroupID": "" },
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": { "StatementReference": "" }
},
"StoredValueData": [
{
"StoredValueProvider": "",
"StoredValueTransactionType": "",
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": False,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"ProductCode": 0,
"EanUpc": 0,
"ItemAmount": "",
"Currency": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/storedvalue"
payload <- "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"StoredValueData\": [\n {\n \"StoredValueProvider\": \"\",\n \"StoredValueTransactionType\": \"\",\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ItemAmount\": \"\",\n \"Currency\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/storedvalue")
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 \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"StoredValueData\": [\n {\n \"StoredValueProvider\": \"\",\n \"StoredValueTransactionType\": \"\",\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ItemAmount\": \"\",\n \"Currency\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/storedvalue') do |req|
req.body = "{\n \"SaleData\": {\n \"OperatorID\": \"\",\n \"OperatorLanguage\": \"\",\n \"ShiftNumber\": \"\",\n \"SaleTransactionID\": {\n \"TransactionID\": \"\",\n \"TimeStamp\": \"\"\n },\n \"SaleReferenceID\": \"\",\n \"SaleTerminalData\": {\n \"TotalsGroupID\": \"\"\n },\n \"TokenRequestedType\": \"\",\n \"CustomerOrderID\": \"\",\n \"CustomerOrderReq\": [],\n \"SaleToPOIData\": \"\",\n \"SaleToAcquirerData\": \"\",\n \"SaleToIssuerData\": {\n \"StatementReference\": \"\"\n }\n },\n \"StoredValueData\": [\n {\n \"StoredValueProvider\": \"\",\n \"StoredValueTransactionType\": \"\",\n \"StoredValueAccountID\": {\n \"StoredValueAccountType\": \"\",\n \"StoredValueProvider\": \"\",\n \"OwnerName\": \"\",\n \"ExpiryDate\": 0,\n \"EntryMode\": [],\n \"IdentificationType\": \"\",\n \"StoredValueID\": \"\"\n },\n \"OriginalPOITransaction\": {\n \"SaleID\": \"\",\n \"POIID\": \"\",\n \"POITransactionID\": {},\n \"ReuseCardDataFlag\": false,\n \"ApprovalCode\": \"\",\n \"AcquirerID\": 0,\n \"AmountValue\": \"\",\n \"HostTransactionID\": {}\n },\n \"ProductCode\": 0,\n \"EanUpc\": 0,\n \"ItemAmount\": \"\",\n \"Currency\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/storedvalue";
let payload = json!({
"SaleData": json!({
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": json!({
"TransactionID": "",
"TimeStamp": ""
}),
"SaleReferenceID": "",
"SaleTerminalData": json!({"TotalsGroupID": ""}),
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": (),
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": json!({"StatementReference": ""})
}),
"StoredValueData": (
json!({
"StoredValueProvider": "",
"StoredValueTransactionType": "",
"StoredValueAccountID": json!({
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": (),
"IdentificationType": "",
"StoredValueID": ""
}),
"OriginalPOITransaction": json!({
"SaleID": "",
"POIID": "",
"POITransactionID": json!({}),
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": json!({})
}),
"ProductCode": 0,
"EanUpc": 0,
"ItemAmount": "",
"Currency": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/storedvalue \
--header 'content-type: application/json' \
--data '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"StoredValueData": [
{
"StoredValueProvider": "",
"StoredValueTransactionType": "",
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"ProductCode": 0,
"EanUpc": 0,
"ItemAmount": "",
"Currency": ""
}
]
}'
echo '{
"SaleData": {
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": {
"TransactionID": "",
"TimeStamp": ""
},
"SaleReferenceID": "",
"SaleTerminalData": {
"TotalsGroupID": ""
},
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": {
"StatementReference": ""
}
},
"StoredValueData": [
{
"StoredValueProvider": "",
"StoredValueTransactionType": "",
"StoredValueAccountID": {
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
},
"OriginalPOITransaction": {
"SaleID": "",
"POIID": "",
"POITransactionID": {},
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": {}
},
"ProductCode": 0,
"EanUpc": 0,
"ItemAmount": "",
"Currency": ""
}
]
}' | \
http POST {{baseUrl}}/storedvalue \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "SaleData": {\n "OperatorID": "",\n "OperatorLanguage": "",\n "ShiftNumber": "",\n "SaleTransactionID": {\n "TransactionID": "",\n "TimeStamp": ""\n },\n "SaleReferenceID": "",\n "SaleTerminalData": {\n "TotalsGroupID": ""\n },\n "TokenRequestedType": "",\n "CustomerOrderID": "",\n "CustomerOrderReq": [],\n "SaleToPOIData": "",\n "SaleToAcquirerData": "",\n "SaleToIssuerData": {\n "StatementReference": ""\n }\n },\n "StoredValueData": [\n {\n "StoredValueProvider": "",\n "StoredValueTransactionType": "",\n "StoredValueAccountID": {\n "StoredValueAccountType": "",\n "StoredValueProvider": "",\n "OwnerName": "",\n "ExpiryDate": 0,\n "EntryMode": [],\n "IdentificationType": "",\n "StoredValueID": ""\n },\n "OriginalPOITransaction": {\n "SaleID": "",\n "POIID": "",\n "POITransactionID": {},\n "ReuseCardDataFlag": false,\n "ApprovalCode": "",\n "AcquirerID": 0,\n "AmountValue": "",\n "HostTransactionID": {}\n },\n "ProductCode": 0,\n "EanUpc": 0,\n "ItemAmount": "",\n "Currency": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/storedvalue
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"SaleData": [
"OperatorID": "",
"OperatorLanguage": "",
"ShiftNumber": "",
"SaleTransactionID": [
"TransactionID": "",
"TimeStamp": ""
],
"SaleReferenceID": "",
"SaleTerminalData": ["TotalsGroupID": ""],
"TokenRequestedType": "",
"CustomerOrderID": "",
"CustomerOrderReq": [],
"SaleToPOIData": "",
"SaleToAcquirerData": "",
"SaleToIssuerData": ["StatementReference": ""]
],
"StoredValueData": [
[
"StoredValueProvider": "",
"StoredValueTransactionType": "",
"StoredValueAccountID": [
"StoredValueAccountType": "",
"StoredValueProvider": "",
"OwnerName": "",
"ExpiryDate": 0,
"EntryMode": [],
"IdentificationType": "",
"StoredValueID": ""
],
"OriginalPOITransaction": [
"SaleID": "",
"POIID": "",
"POITransactionID": [],
"ReuseCardDataFlag": false,
"ApprovalCode": "",
"AcquirerID": 0,
"AmountValue": "",
"HostTransactionID": []
],
"ProductCode": 0,
"EanUpc": 0,
"ItemAmount": "",
"Currency": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/storedvalue")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
TransactionStatus Request
{{baseUrl}}/transactionstatus
BODY json
{
"MessageReference": {
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
},
"ReceiptReprintFlag": false,
"DocumentQualifier": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/transactionstatus");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"ReceiptReprintFlag\": false,\n \"DocumentQualifier\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/transactionstatus" {:content-type :json
:form-params {:MessageReference {:MessageCategory ""
:ServiceID ""
:DeviceID ""
:SaleID ""
:POIID ""}
:ReceiptReprintFlag false
:DocumentQualifier []}})
require "http/client"
url = "{{baseUrl}}/transactionstatus"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"ReceiptReprintFlag\": false,\n \"DocumentQualifier\": []\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/transactionstatus"),
Content = new StringContent("{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"ReceiptReprintFlag\": false,\n \"DocumentQualifier\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/transactionstatus");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"ReceiptReprintFlag\": false,\n \"DocumentQualifier\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/transactionstatus"
payload := strings.NewReader("{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"ReceiptReprintFlag\": false,\n \"DocumentQualifier\": []\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(res)
fmt.Println(string(body))
}
POST /baseUrl/transactionstatus HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 191
{
"MessageReference": {
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
},
"ReceiptReprintFlag": false,
"DocumentQualifier": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/transactionstatus")
.setHeader("content-type", "application/json")
.setBody("{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"ReceiptReprintFlag\": false,\n \"DocumentQualifier\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/transactionstatus"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"ReceiptReprintFlag\": false,\n \"DocumentQualifier\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"ReceiptReprintFlag\": false,\n \"DocumentQualifier\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/transactionstatus")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/transactionstatus")
.header("content-type", "application/json")
.body("{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"ReceiptReprintFlag\": false,\n \"DocumentQualifier\": []\n}")
.asString();
const data = JSON.stringify({
MessageReference: {
MessageCategory: '',
ServiceID: '',
DeviceID: '',
SaleID: '',
POIID: ''
},
ReceiptReprintFlag: false,
DocumentQualifier: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/transactionstatus');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/transactionstatus',
headers: {'content-type': 'application/json'},
data: {
MessageReference: {MessageCategory: '', ServiceID: '', DeviceID: '', SaleID: '', POIID: ''},
ReceiptReprintFlag: false,
DocumentQualifier: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/transactionstatus';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"MessageReference":{"MessageCategory":"","ServiceID":"","DeviceID":"","SaleID":"","POIID":""},"ReceiptReprintFlag":false,"DocumentQualifier":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/transactionstatus',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "MessageReference": {\n "MessageCategory": "",\n "ServiceID": "",\n "DeviceID": "",\n "SaleID": "",\n "POIID": ""\n },\n "ReceiptReprintFlag": false,\n "DocumentQualifier": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"ReceiptReprintFlag\": false,\n \"DocumentQualifier\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/transactionstatus")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/transactionstatus',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
MessageReference: {MessageCategory: '', ServiceID: '', DeviceID: '', SaleID: '', POIID: ''},
ReceiptReprintFlag: false,
DocumentQualifier: []
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/transactionstatus',
headers: {'content-type': 'application/json'},
body: {
MessageReference: {MessageCategory: '', ServiceID: '', DeviceID: '', SaleID: '', POIID: ''},
ReceiptReprintFlag: false,
DocumentQualifier: []
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/transactionstatus');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
MessageReference: {
MessageCategory: '',
ServiceID: '',
DeviceID: '',
SaleID: '',
POIID: ''
},
ReceiptReprintFlag: false,
DocumentQualifier: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/transactionstatus',
headers: {'content-type': 'application/json'},
data: {
MessageReference: {MessageCategory: '', ServiceID: '', DeviceID: '', SaleID: '', POIID: ''},
ReceiptReprintFlag: false,
DocumentQualifier: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/transactionstatus';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"MessageReference":{"MessageCategory":"","ServiceID":"","DeviceID":"","SaleID":"","POIID":""},"ReceiptReprintFlag":false,"DocumentQualifier":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"MessageReference": @{ @"MessageCategory": @"", @"ServiceID": @"", @"DeviceID": @"", @"SaleID": @"", @"POIID": @"" },
@"ReceiptReprintFlag": @NO,
@"DocumentQualifier": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/transactionstatus"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/transactionstatus" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"ReceiptReprintFlag\": false,\n \"DocumentQualifier\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/transactionstatus",
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([
'MessageReference' => [
'MessageCategory' => '',
'ServiceID' => '',
'DeviceID' => '',
'SaleID' => '',
'POIID' => ''
],
'ReceiptReprintFlag' => null,
'DocumentQualifier' => [
]
]),
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;
}
request('POST', '{{baseUrl}}/transactionstatus', [
'body' => '{
"MessageReference": {
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
},
"ReceiptReprintFlag": false,
"DocumentQualifier": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/transactionstatus');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'MessageReference' => [
'MessageCategory' => '',
'ServiceID' => '',
'DeviceID' => '',
'SaleID' => '',
'POIID' => ''
],
'ReceiptReprintFlag' => null,
'DocumentQualifier' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'MessageReference' => [
'MessageCategory' => '',
'ServiceID' => '',
'DeviceID' => '',
'SaleID' => '',
'POIID' => ''
],
'ReceiptReprintFlag' => null,
'DocumentQualifier' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/transactionstatus');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/transactionstatus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MessageReference": {
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
},
"ReceiptReprintFlag": false,
"DocumentQualifier": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/transactionstatus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MessageReference": {
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
},
"ReceiptReprintFlag": false,
"DocumentQualifier": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"ReceiptReprintFlag\": false,\n \"DocumentQualifier\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/transactionstatus", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/transactionstatus"
payload = {
"MessageReference": {
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
},
"ReceiptReprintFlag": False,
"DocumentQualifier": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/transactionstatus"
payload <- "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"ReceiptReprintFlag\": false,\n \"DocumentQualifier\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/transactionstatus")
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 \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"ReceiptReprintFlag\": false,\n \"DocumentQualifier\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/transactionstatus') do |req|
req.body = "{\n \"MessageReference\": {\n \"MessageCategory\": \"\",\n \"ServiceID\": \"\",\n \"DeviceID\": \"\",\n \"SaleID\": \"\",\n \"POIID\": \"\"\n },\n \"ReceiptReprintFlag\": false,\n \"DocumentQualifier\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/transactionstatus";
let payload = json!({
"MessageReference": json!({
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
}),
"ReceiptReprintFlag": false,
"DocumentQualifier": ()
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/transactionstatus \
--header 'content-type: application/json' \
--data '{
"MessageReference": {
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
},
"ReceiptReprintFlag": false,
"DocumentQualifier": []
}'
echo '{
"MessageReference": {
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
},
"ReceiptReprintFlag": false,
"DocumentQualifier": []
}' | \
http POST {{baseUrl}}/transactionstatus \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "MessageReference": {\n "MessageCategory": "",\n "ServiceID": "",\n "DeviceID": "",\n "SaleID": "",\n "POIID": ""\n },\n "ReceiptReprintFlag": false,\n "DocumentQualifier": []\n}' \
--output-document \
- {{baseUrl}}/transactionstatus
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"MessageReference": [
"MessageCategory": "",
"ServiceID": "",
"DeviceID": "",
"SaleID": "",
"POIID": ""
],
"ReceiptReprintFlag": false,
"DocumentQualifier": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/transactionstatus")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()