POS Terminal Management API
POST
Assign terminals
{{baseUrl}}/assignTerminals
HEADERS
X-API-Key
{{apiKey}}
BODY json
{
"companyAccount": "",
"merchantAccount": "",
"merchantInventory": false,
"store": "",
"terminals": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/assignTerminals");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"merchantInventory\": false,\n \"store\": \"\",\n \"terminals\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/assignTerminals" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:companyAccount ""
:merchantAccount ""
:merchantInventory false
:store ""
:terminals []}})
require "http/client"
url = "{{baseUrl}}/assignTerminals"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"merchantInventory\": false,\n \"store\": \"\",\n \"terminals\": []\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}}/assignTerminals"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"merchantInventory\": false,\n \"store\": \"\",\n \"terminals\": []\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}}/assignTerminals");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"merchantInventory\": false,\n \"store\": \"\",\n \"terminals\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/assignTerminals"
payload := strings.NewReader("{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"merchantInventory\": false,\n \"store\": \"\",\n \"terminals\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
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/assignTerminals HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 115
{
"companyAccount": "",
"merchantAccount": "",
"merchantInventory": false,
"store": "",
"terminals": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/assignTerminals")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"merchantInventory\": false,\n \"store\": \"\",\n \"terminals\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/assignTerminals"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"merchantInventory\": false,\n \"store\": \"\",\n \"terminals\": []\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 \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"merchantInventory\": false,\n \"store\": \"\",\n \"terminals\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/assignTerminals")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/assignTerminals")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"merchantInventory\": false,\n \"store\": \"\",\n \"terminals\": []\n}")
.asString();
const data = JSON.stringify({
companyAccount: '',
merchantAccount: '',
merchantInventory: false,
store: '',
terminals: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/assignTerminals');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/assignTerminals',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
companyAccount: '',
merchantAccount: '',
merchantInventory: false,
store: '',
terminals: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/assignTerminals';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"companyAccount":"","merchantAccount":"","merchantInventory":false,"store":"","terminals":[]}'
};
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}}/assignTerminals',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "companyAccount": "",\n "merchantAccount": "",\n "merchantInventory": false,\n "store": "",\n "terminals": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"merchantInventory\": false,\n \"store\": \"\",\n \"terminals\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/assignTerminals")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.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/assignTerminals',
headers: {
'x-api-key': '{{apiKey}}',
'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({
companyAccount: '',
merchantAccount: '',
merchantInventory: false,
store: '',
terminals: []
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/assignTerminals',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
companyAccount: '',
merchantAccount: '',
merchantInventory: false,
store: '',
terminals: []
},
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}}/assignTerminals');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
companyAccount: '',
merchantAccount: '',
merchantInventory: false,
store: '',
terminals: []
});
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}}/assignTerminals',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
companyAccount: '',
merchantAccount: '',
merchantInventory: false,
store: '',
terminals: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/assignTerminals';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"companyAccount":"","merchantAccount":"","merchantInventory":false,"store":"","terminals":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"companyAccount": @"",
@"merchantAccount": @"",
@"merchantInventory": @NO,
@"store": @"",
@"terminals": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/assignTerminals"]
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}}/assignTerminals" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"merchantInventory\": false,\n \"store\": \"\",\n \"terminals\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/assignTerminals",
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([
'companyAccount' => '',
'merchantAccount' => '',
'merchantInventory' => null,
'store' => '',
'terminals' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/assignTerminals', [
'body' => '{
"companyAccount": "",
"merchantAccount": "",
"merchantInventory": false,
"store": "",
"terminals": []
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/assignTerminals');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'companyAccount' => '',
'merchantAccount' => '',
'merchantInventory' => null,
'store' => '',
'terminals' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'companyAccount' => '',
'merchantAccount' => '',
'merchantInventory' => null,
'store' => '',
'terminals' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/assignTerminals');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/assignTerminals' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"companyAccount": "",
"merchantAccount": "",
"merchantInventory": false,
"store": "",
"terminals": []
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/assignTerminals' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"companyAccount": "",
"merchantAccount": "",
"merchantInventory": false,
"store": "",
"terminals": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"merchantInventory\": false,\n \"store\": \"\",\n \"terminals\": []\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/assignTerminals", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/assignTerminals"
payload = {
"companyAccount": "",
"merchantAccount": "",
"merchantInventory": False,
"store": "",
"terminals": []
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/assignTerminals"
payload <- "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"merchantInventory\": false,\n \"store\": \"\",\n \"terminals\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/assignTerminals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"merchantInventory\": false,\n \"store\": \"\",\n \"terminals\": []\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/assignTerminals') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"merchantInventory\": false,\n \"store\": \"\",\n \"terminals\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/assignTerminals";
let payload = json!({
"companyAccount": "",
"merchantAccount": "",
"merchantInventory": false,
"store": "",
"terminals": ()
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
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}}/assignTerminals \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"companyAccount": "",
"merchantAccount": "",
"merchantInventory": false,
"store": "",
"terminals": []
}'
echo '{
"companyAccount": "",
"merchantAccount": "",
"merchantInventory": false,
"store": "",
"terminals": []
}' | \
http POST {{baseUrl}}/assignTerminals \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "companyAccount": "",\n "merchantAccount": "",\n "merchantInventory": false,\n "store": "",\n "terminals": []\n}' \
--output-document \
- {{baseUrl}}/assignTerminals
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"companyAccount": "",
"merchantAccount": "",
"merchantInventory": false,
"store": "",
"terminals": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/assignTerminals")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"results": {
"P400Plus-275479597": "RemoveConfigScheduled"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"results": {
"P400Plus-275479597": "RemoveConfigScheduled"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"results": {
"P400Plus-275479597": "RemoveConfigScheduled"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "702",
"errorType": "validation",
"message": "Problem reading or understanding the request.",
"status": 400
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "010",
"errorType": "security",
"message": "Insufficient permissions to process the request.",
"status": 403
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "901",
"errorType": "validation",
"message": "Request validation error.",
"status": 422
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "000",
"errorType": "internal",
"message": "The server could not process the request.",
"status": 500
}
POST
Get the account or store of a terminal
{{baseUrl}}/findTerminal
HEADERS
X-API-Key
{{apiKey}}
BODY json
{
"terminal": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/findTerminal");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"terminal\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/findTerminal" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:terminal ""}})
require "http/client"
url = "{{baseUrl}}/findTerminal"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"terminal\": \"\"\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}}/findTerminal"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"terminal\": \"\"\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}}/findTerminal");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"terminal\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/findTerminal"
payload := strings.NewReader("{\n \"terminal\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
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/findTerminal HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"terminal": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/findTerminal")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"terminal\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/findTerminal"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"terminal\": \"\"\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 \"terminal\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/findTerminal")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/findTerminal")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"terminal\": \"\"\n}")
.asString();
const data = JSON.stringify({
terminal: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/findTerminal');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/findTerminal',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {terminal: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/findTerminal';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"terminal":""}'
};
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}}/findTerminal',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "terminal": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"terminal\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/findTerminal")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.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/findTerminal',
headers: {
'x-api-key': '{{apiKey}}',
'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({terminal: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/findTerminal',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {terminal: ''},
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}}/findTerminal');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
terminal: ''
});
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}}/findTerminal',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {terminal: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/findTerminal';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"terminal":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"terminal": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/findTerminal"]
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}}/findTerminal" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"terminal\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/findTerminal",
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([
'terminal' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/findTerminal', [
'body' => '{
"terminal": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/findTerminal');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'terminal' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'terminal' => ''
]));
$request->setRequestUrl('{{baseUrl}}/findTerminal');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/findTerminal' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"terminal": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/findTerminal' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"terminal": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"terminal\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/findTerminal", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/findTerminal"
payload = { "terminal": "" }
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/findTerminal"
payload <- "{\n \"terminal\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/findTerminal")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"terminal\": \"\"\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/findTerminal') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"terminal\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/findTerminal";
let payload = json!({"terminal": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
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}}/findTerminal \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"terminal": ""
}'
echo '{
"terminal": ""
}' | \
http POST {{baseUrl}}/findTerminal \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "terminal": ""\n}' \
--output-document \
- {{baseUrl}}/findTerminal
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["terminal": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/findTerminal")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"companyAccount": "YOUR_COMPANY_ACCOUNT",
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"merchantInventory": false,
"store": "YOUR_STORE",
"terminal": "M400-401972715"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "702",
"errorType": "validation",
"message": "Problem reading or understanding the request.",
"status": 400
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "010",
"errorType": "security",
"message": "Insufficient permissions to process the request.",
"status": 403
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "901",
"errorType": "validation",
"message": "Request validation error.",
"status": 422
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "000",
"errorType": "internal",
"message": "The server could not process the request.",
"status": 500
}
POST
Get the details of a terminal
{{baseUrl}}/getTerminalDetails
HEADERS
X-API-Key
{{apiKey}}
BODY json
{
"terminal": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/getTerminalDetails");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"terminal\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/getTerminalDetails" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:terminal ""}})
require "http/client"
url = "{{baseUrl}}/getTerminalDetails"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"terminal\": \"\"\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}}/getTerminalDetails"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"terminal\": \"\"\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}}/getTerminalDetails");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"terminal\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/getTerminalDetails"
payload := strings.NewReader("{\n \"terminal\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
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/getTerminalDetails HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"terminal": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/getTerminalDetails")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"terminal\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/getTerminalDetails"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"terminal\": \"\"\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 \"terminal\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/getTerminalDetails")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/getTerminalDetails")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"terminal\": \"\"\n}")
.asString();
const data = JSON.stringify({
terminal: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/getTerminalDetails');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/getTerminalDetails',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {terminal: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/getTerminalDetails';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"terminal":""}'
};
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}}/getTerminalDetails',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "terminal": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"terminal\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/getTerminalDetails")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.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/getTerminalDetails',
headers: {
'x-api-key': '{{apiKey}}',
'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({terminal: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/getTerminalDetails',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {terminal: ''},
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}}/getTerminalDetails');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
terminal: ''
});
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}}/getTerminalDetails',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {terminal: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/getTerminalDetails';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"terminal":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"terminal": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/getTerminalDetails"]
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}}/getTerminalDetails" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"terminal\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/getTerminalDetails",
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([
'terminal' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/getTerminalDetails', [
'body' => '{
"terminal": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/getTerminalDetails');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'terminal' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'terminal' => ''
]));
$request->setRequestUrl('{{baseUrl}}/getTerminalDetails');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/getTerminalDetails' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"terminal": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/getTerminalDetails' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"terminal": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"terminal\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/getTerminalDetails", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/getTerminalDetails"
payload = { "terminal": "" }
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/getTerminalDetails"
payload <- "{\n \"terminal\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/getTerminalDetails")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"terminal\": \"\"\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/getTerminalDetails') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"terminal\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/getTerminalDetails";
let payload = json!({"terminal": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
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}}/getTerminalDetails \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"terminal": ""
}'
echo '{
"terminal": ""
}' | \
http POST {{baseUrl}}/getTerminalDetails \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "terminal": ""\n}' \
--output-document \
- {{baseUrl}}/getTerminalDetails
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["terminal": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/getTerminalDetails")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"companyAccount": "YOUR_COMPANY_ACCOUNT",
"country": "NETHERLANDS",
"deviceModel": "M400",
"dhcpEnabled": false,
"ethernetIp": "192.168.2.11",
"ethernetMac": "60:c7:98:5a:69:cd",
"firmwareVersion": "Verifone_VOS 1.57.6",
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"merchantInventory": false,
"permanentTerminalId": "88912016",
"serialNumber": "401-972-715",
"store": "YOUR_STORE",
"storeDetails": {
"address": {
"city": "The City",
"countryCode": "NL",
"postalCode": "1234",
"streetAddress": "The Street"
},
"description": "TestStore",
"store": "YOUR_STORE"
},
"terminal": "M400-401972715",
"terminalStatus": "SwitchedOff",
"wifiIp": "192.168.2.12",
"wifiMac": "c4:ac:59:47:f3:71"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "702",
"errorType": "validation",
"message": "Problem reading or understanding the request.",
"status": 400
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "010",
"errorType": "security",
"message": "Insufficient permissions to process the request.",
"status": 403
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "901",
"errorType": "validation",
"message": "Request validation error.",
"status": 422
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "000",
"errorType": "internal",
"message": "The server could not process the request.",
"status": 500
}
POST
Get the list of terminals
{{baseUrl}}/getTerminalsUnderAccount
HEADERS
X-API-Key
{{apiKey}}
BODY json
{
"companyAccount": "",
"merchantAccount": "",
"store": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/getTerminalsUnderAccount");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"store\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/getTerminalsUnderAccount" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:companyAccount ""
:merchantAccount ""
:store ""}})
require "http/client"
url = "{{baseUrl}}/getTerminalsUnderAccount"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"store\": \"\"\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}}/getTerminalsUnderAccount"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"store\": \"\"\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}}/getTerminalsUnderAccount");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"store\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/getTerminalsUnderAccount"
payload := strings.NewReader("{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"store\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
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/getTerminalsUnderAccount HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 66
{
"companyAccount": "",
"merchantAccount": "",
"store": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/getTerminalsUnderAccount")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"store\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/getTerminalsUnderAccount"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"store\": \"\"\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 \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"store\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/getTerminalsUnderAccount")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/getTerminalsUnderAccount")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"store\": \"\"\n}")
.asString();
const data = JSON.stringify({
companyAccount: '',
merchantAccount: '',
store: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/getTerminalsUnderAccount');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/getTerminalsUnderAccount',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {companyAccount: '', merchantAccount: '', store: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/getTerminalsUnderAccount';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"companyAccount":"","merchantAccount":"","store":""}'
};
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}}/getTerminalsUnderAccount',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "companyAccount": "",\n "merchantAccount": "",\n "store": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"store\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/getTerminalsUnderAccount")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.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/getTerminalsUnderAccount',
headers: {
'x-api-key': '{{apiKey}}',
'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({companyAccount: '', merchantAccount: '', store: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/getTerminalsUnderAccount',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {companyAccount: '', merchantAccount: '', store: ''},
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}}/getTerminalsUnderAccount');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
companyAccount: '',
merchantAccount: '',
store: ''
});
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}}/getTerminalsUnderAccount',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {companyAccount: '', merchantAccount: '', store: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/getTerminalsUnderAccount';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"companyAccount":"","merchantAccount":"","store":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"companyAccount": @"",
@"merchantAccount": @"",
@"store": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/getTerminalsUnderAccount"]
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}}/getTerminalsUnderAccount" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"store\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/getTerminalsUnderAccount",
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([
'companyAccount' => '',
'merchantAccount' => '',
'store' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/getTerminalsUnderAccount', [
'body' => '{
"companyAccount": "",
"merchantAccount": "",
"store": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/getTerminalsUnderAccount');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'companyAccount' => '',
'merchantAccount' => '',
'store' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'companyAccount' => '',
'merchantAccount' => '',
'store' => ''
]));
$request->setRequestUrl('{{baseUrl}}/getTerminalsUnderAccount');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/getTerminalsUnderAccount' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"companyAccount": "",
"merchantAccount": "",
"store": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/getTerminalsUnderAccount' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"companyAccount": "",
"merchantAccount": "",
"store": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"store\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/getTerminalsUnderAccount", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/getTerminalsUnderAccount"
payload = {
"companyAccount": "",
"merchantAccount": "",
"store": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/getTerminalsUnderAccount"
payload <- "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"store\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/getTerminalsUnderAccount")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"store\": \"\"\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/getTerminalsUnderAccount') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\",\n \"store\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/getTerminalsUnderAccount";
let payload = json!({
"companyAccount": "",
"merchantAccount": "",
"store": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
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}}/getTerminalsUnderAccount \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"companyAccount": "",
"merchantAccount": "",
"store": ""
}'
echo '{
"companyAccount": "",
"merchantAccount": "",
"store": ""
}' | \
http POST {{baseUrl}}/getTerminalsUnderAccount \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "companyAccount": "",\n "merchantAccount": "",\n "store": ""\n}' \
--output-document \
- {{baseUrl}}/getTerminalsUnderAccount
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"companyAccount": "",
"merchantAccount": "",
"store": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/getTerminalsUnderAccount")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"companyAccount": "YOUR_COMPANY_ACCOUNT",
"merchantAccounts": [
{
"inStoreTerminals": [
"P400Plus-275479597"
],
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"stores": [
{
"inStoreTerminals": [
"M400-401972715"
],
"store": "YOUR_STORE"
}
]
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"companyAccount": "YOUR_COMPANY_ACCOUNT",
"merchantAccounts": [
{
"inStoreTerminals": [
"P400Plus-275479597"
],
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"stores": [
{
"inStoreTerminals": [
"M400-401972715"
],
"store": "YOUR_STORE"
}
]
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"companyAccount": "YOUR_COMPANY_ACCOUNT",
"merchantAccounts": [
{
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"stores": [
{
"inStoreTerminals": [
"M400-401972715"
],
"store": "YOUR_STORE"
}
]
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "702",
"errorType": "validation",
"message": "Problem reading or understanding the request.",
"status": 400
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "010",
"errorType": "security",
"message": "Insufficient permissions to process the request.",
"status": 403
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "901",
"errorType": "validation",
"message": "Request validation error.",
"status": 422
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "000",
"errorType": "internal",
"message": "The server could not process the request.",
"status": 500
}
POST
Get the stores of an account
{{baseUrl}}/getStoresUnderAccount
HEADERS
X-API-Key
{{apiKey}}
BODY json
{
"companyAccount": "",
"merchantAccount": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/getStoresUnderAccount");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/getStoresUnderAccount" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:companyAccount ""
:merchantAccount ""}})
require "http/client"
url = "{{baseUrl}}/getStoresUnderAccount"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\"\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}}/getStoresUnderAccount"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\"\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}}/getStoresUnderAccount");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/getStoresUnderAccount"
payload := strings.NewReader("{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
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/getStoresUnderAccount HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 51
{
"companyAccount": "",
"merchantAccount": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/getStoresUnderAccount")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/getStoresUnderAccount"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\"\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 \"companyAccount\": \"\",\n \"merchantAccount\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/getStoresUnderAccount")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/getStoresUnderAccount")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\"\n}")
.asString();
const data = JSON.stringify({
companyAccount: '',
merchantAccount: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/getStoresUnderAccount');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/getStoresUnderAccount',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {companyAccount: '', merchantAccount: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/getStoresUnderAccount';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"companyAccount":"","merchantAccount":""}'
};
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}}/getStoresUnderAccount',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "companyAccount": "",\n "merchantAccount": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/getStoresUnderAccount")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.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/getStoresUnderAccount',
headers: {
'x-api-key': '{{apiKey}}',
'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({companyAccount: '', merchantAccount: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/getStoresUnderAccount',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {companyAccount: '', merchantAccount: ''},
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}}/getStoresUnderAccount');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
companyAccount: '',
merchantAccount: ''
});
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}}/getStoresUnderAccount',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {companyAccount: '', merchantAccount: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/getStoresUnderAccount';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"companyAccount":"","merchantAccount":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"companyAccount": @"",
@"merchantAccount": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/getStoresUnderAccount"]
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}}/getStoresUnderAccount" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/getStoresUnderAccount",
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([
'companyAccount' => '',
'merchantAccount' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/getStoresUnderAccount', [
'body' => '{
"companyAccount": "",
"merchantAccount": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/getStoresUnderAccount');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'companyAccount' => '',
'merchantAccount' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'companyAccount' => '',
'merchantAccount' => ''
]));
$request->setRequestUrl('{{baseUrl}}/getStoresUnderAccount');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/getStoresUnderAccount' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"companyAccount": "",
"merchantAccount": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/getStoresUnderAccount' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"companyAccount": "",
"merchantAccount": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/getStoresUnderAccount", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/getStoresUnderAccount"
payload = {
"companyAccount": "",
"merchantAccount": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/getStoresUnderAccount"
payload <- "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/getStoresUnderAccount")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\"\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/getStoresUnderAccount') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"companyAccount\": \"\",\n \"merchantAccount\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/getStoresUnderAccount";
let payload = json!({
"companyAccount": "",
"merchantAccount": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
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}}/getStoresUnderAccount \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"companyAccount": "",
"merchantAccount": ""
}'
echo '{
"companyAccount": "",
"merchantAccount": ""
}' | \
http POST {{baseUrl}}/getStoresUnderAccount \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "companyAccount": "",\n "merchantAccount": ""\n}' \
--output-document \
- {{baseUrl}}/getStoresUnderAccount
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"companyAccount": "",
"merchantAccount": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/getStoresUnderAccount")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"stores": [
{
"address": {
"city": "The City",
"countryCode": "NL",
"postalCode": "1234",
"streetAddress": "The Street"
},
"description": "YOUR_STORE",
"merchantAccountCode": "YOUR_MERCHANT_ACCOUNT",
"status": "Active",
"store": "YOUR_STORE"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"stores": [
{
"address": {
"city": "The City",
"countryCode": "NL",
"postalCode": "1234",
"streetAddress": "The Street"
},
"description": "YOUR_STORE",
"merchantAccountCode": "YOUR_MERCHANT_ACCOUNT",
"status": "Active",
"store": "YOUR_STORE"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "702",
"errorType": "validation",
"message": "Problem reading or understanding the request.",
"status": 400
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "010",
"errorType": "security",
"message": "Insufficient permissions to process the request.",
"status": 403
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "901",
"errorType": "validation",
"message": "Request validation error.",
"status": 422
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"errorCode": "000",
"errorType": "internal",
"message": "The server could not process the request.",
"status": 500
}