Fund API
Fund APIv6
This API is used for the classic integration. If you are just starting your implementation, refer to our new integration guide instead. The Fund API provides endpoints for managing the funds in the accounts on your platform. These management operations include, for example, the transfer of funds from one account to another, the payout of funds to an account holder, and the retrieval of balances in an account. For more information, refer to our documentation. Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an X-API-Key header with…
- Endpoints
- 8 (8 POST)
- Base URL
https://cal-test.adyen.com/cal/services/Fund/v6- Authentication
- API key, Basic auth
- Spec format
- OpenAPI 3.1.0
- API version
- 6
- Provider
- adyen.com
- Categories
- Payments
- Last updated
Use this API in Bruno:
- Download the Bruno collection above and unzip it.
- In Bruno, choose Open Collection and select the unzipped folder.
- Set the
baseUrlvariable (for examplehttps://cal-test.adyen.com/cal/services/Fund/v6) and your API key credentials, then send requests.
POST
Designate a beneficiary account and transfer the benefactor's current balance
{{baseUrl}}/setupBeneficiary
BODY json
{
"destinationAccountCode": "",
"merchantReference": "",
"sourceAccountCode": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/setupBeneficiary");
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 \"destinationAccountCode\": \"128952522\",\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"sourceAccountCode\": \"134498192\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/setupBeneficiary" {:content-type :json
:form-params {:destinationAccountCode "128952522"
:merchantReference "YOUR_REFERENCE_ID"
:sourceAccountCode "134498192"}})
require "http/client"
url = "{{baseUrl}}/setupBeneficiary"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationAccountCode\": \"128952522\",\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"sourceAccountCode\": \"134498192\"\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}}/setupBeneficiary"),
Content = new StringContent("{\n \"destinationAccountCode\": \"128952522\",\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"sourceAccountCode\": \"134498192\"\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}}/setupBeneficiary");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationAccountCode\": \"128952522\",\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"sourceAccountCode\": \"134498192\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/setupBeneficiary"
payload := strings.NewReader("{\n \"destinationAccountCode\": \"128952522\",\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"sourceAccountCode\": \"134498192\"\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/setupBeneficiary HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 123
{
"destinationAccountCode": "128952522",
"merchantReference": "YOUR_REFERENCE_ID",
"sourceAccountCode": "134498192"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/setupBeneficiary")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationAccountCode\": \"128952522\",\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"sourceAccountCode\": \"134498192\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/setupBeneficiary"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationAccountCode\": \"128952522\",\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"sourceAccountCode\": \"134498192\"\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 \"destinationAccountCode\": \"128952522\",\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"sourceAccountCode\": \"134498192\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/setupBeneficiary")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/setupBeneficiary")
.header("content-type", "application/json")
.body("{\n \"destinationAccountCode\": \"128952522\",\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"sourceAccountCode\": \"134498192\"\n}")
.asString();
const data = JSON.stringify({
destinationAccountCode: '128952522',
merchantReference: 'YOUR_REFERENCE_ID',
sourceAccountCode: '134498192'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/setupBeneficiary');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/setupBeneficiary',
headers: {'content-type': 'application/json'},
data: {
destinationAccountCode: '128952522',
merchantReference: 'YOUR_REFERENCE_ID',
sourceAccountCode: '134498192'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/setupBeneficiary';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationAccountCode":"128952522","merchantReference":"YOUR_REFERENCE_ID","sourceAccountCode":"134498192"}'
};
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}}/setupBeneficiary',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationAccountCode": "128952522",\n "merchantReference": "YOUR_REFERENCE_ID",\n "sourceAccountCode": "134498192"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationAccountCode\": \"128952522\",\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"sourceAccountCode\": \"134498192\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/setupBeneficiary")
.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/setupBeneficiary',
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({
destinationAccountCode: '128952522',
merchantReference: 'YOUR_REFERENCE_ID',
sourceAccountCode: '134498192'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/setupBeneficiary',
headers: {'content-type': 'application/json'},
body: {
destinationAccountCode: '128952522',
merchantReference: 'YOUR_REFERENCE_ID',
sourceAccountCode: '134498192'
},
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}}/setupBeneficiary');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationAccountCode: '128952522',
merchantReference: 'YOUR_REFERENCE_ID',
sourceAccountCode: '134498192'
});
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}}/setupBeneficiary',
headers: {'content-type': 'application/json'},
data: {
destinationAccountCode: '128952522',
merchantReference: 'YOUR_REFERENCE_ID',
sourceAccountCode: '134498192'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/setupBeneficiary';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationAccountCode":"128952522","merchantReference":"YOUR_REFERENCE_ID","sourceAccountCode":"134498192"}'
};
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 = @{ @"destinationAccountCode": @"128952522",
@"merchantReference": @"YOUR_REFERENCE_ID",
@"sourceAccountCode": @"134498192" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/setupBeneficiary"]
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}}/setupBeneficiary" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationAccountCode\": \"128952522\",\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"sourceAccountCode\": \"134498192\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/setupBeneficiary",
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([
'destinationAccountCode' => '128952522',
'merchantReference' => 'YOUR_REFERENCE_ID',
'sourceAccountCode' => '134498192'
]),
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}}/setupBeneficiary', [
'body' => '{
"destinationAccountCode": "128952522",
"merchantReference": "YOUR_REFERENCE_ID",
"sourceAccountCode": "134498192"
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/setupBeneficiary');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationAccountCode' => '128952522',
'merchantReference' => 'YOUR_REFERENCE_ID',
'sourceAccountCode' => '134498192'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationAccountCode' => '128952522',
'merchantReference' => 'YOUR_REFERENCE_ID',
'sourceAccountCode' => '134498192'
]));
$request->setRequestUrl('{{baseUrl}}/setupBeneficiary');
$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}}/setupBeneficiary' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationAccountCode": "128952522",
"merchantReference": "YOUR_REFERENCE_ID",
"sourceAccountCode": "134498192"
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/setupBeneficiary' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationAccountCode": "128952522",
"merchantReference": "YOUR_REFERENCE_ID",
"sourceAccountCode": "134498192"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationAccountCode\": \"128952522\",\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"sourceAccountCode\": \"134498192\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/setupBeneficiary", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/setupBeneficiary"
payload = {
"destinationAccountCode": "128952522",
"merchantReference": "YOUR_REFERENCE_ID",
"sourceAccountCode": "134498192"
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/setupBeneficiary"
payload <- "{\n \"destinationAccountCode\": \"128952522\",\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"sourceAccountCode\": \"134498192\"\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}}/setupBeneficiary")
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 \"destinationAccountCode\": \"128952522\",\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"sourceAccountCode\": \"134498192\"\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/setupBeneficiary') do |req|
req.body = "{\n \"destinationAccountCode\": \"128952522\",\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"sourceAccountCode\": \"134498192\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/setupBeneficiary";
let payload = json!({
"destinationAccountCode": "128952522",
"merchantReference": "YOUR_REFERENCE_ID",
"sourceAccountCode": "134498192"
});
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}}/setupBeneficiary \
--header 'content-type: application/json' \
--data '{
"destinationAccountCode": "128952522",
"merchantReference": "YOUR_REFERENCE_ID",
"sourceAccountCode": "134498192"
}'
echo '{
"destinationAccountCode": "128952522",
"merchantReference": "YOUR_REFERENCE_ID",
"sourceAccountCode": "134498192"
}' | \
http POST {{baseUrl}}/setupBeneficiary \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationAccountCode": "128952522",\n "merchantReference": "YOUR_REFERENCE_ID",\n "sourceAccountCode": "134498192"\n}' \
--output-document \
- {{baseUrl}}/setupBeneficiary
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"destinationAccountCode": "128952522",
"merchantReference": "YOUR_REFERENCE_ID",
"sourceAccountCode": "134498192"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/setupBeneficiary")! 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
Get a list of transactions
{{baseUrl}}/accountHolderTransactionList
BODY json
{
"accountHolderCode": "",
"transactionListsPerAccount": [
{
"accountCode": "",
"page": 0
}
],
"transactionStatuses": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accountHolderTransactionList");
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 \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"transactionListsPerAccount\": [\n {\n \"accountCode\": \"195752115\",\n \"page\": 1\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accountHolderTransactionList" {:content-type :json
:form-params {:accountHolderCode "CODE_OF_ACCOUNT_HOLDER"
:transactionListsPerAccount [{:accountCode "195752115"
:page 1}]}})
require "http/client"
url = "{{baseUrl}}/accountHolderTransactionList"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"transactionListsPerAccount\": [\n {\n \"accountCode\": \"195752115\",\n \"page\": 1\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}}/accountHolderTransactionList"),
Content = new StringContent("{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"transactionListsPerAccount\": [\n {\n \"accountCode\": \"195752115\",\n \"page\": 1\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}}/accountHolderTransactionList");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"transactionListsPerAccount\": [\n {\n \"accountCode\": \"195752115\",\n \"page\": 1\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accountHolderTransactionList"
payload := strings.NewReader("{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"transactionListsPerAccount\": [\n {\n \"accountCode\": \"195752115\",\n \"page\": 1\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/accountHolderTransactionList HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 152
{
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"transactionListsPerAccount": [
{
"accountCode": "195752115",
"page": 1
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accountHolderTransactionList")
.setHeader("content-type", "application/json")
.setBody("{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"transactionListsPerAccount\": [\n {\n \"accountCode\": \"195752115\",\n \"page\": 1\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accountHolderTransactionList"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"transactionListsPerAccount\": [\n {\n \"accountCode\": \"195752115\",\n \"page\": 1\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 \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"transactionListsPerAccount\": [\n {\n \"accountCode\": \"195752115\",\n \"page\": 1\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accountHolderTransactionList")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accountHolderTransactionList")
.header("content-type", "application/json")
.body("{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"transactionListsPerAccount\": [\n {\n \"accountCode\": \"195752115\",\n \"page\": 1\n }\n ]\n}")
.asString();
const data = JSON.stringify({
accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER',
transactionListsPerAccount: [
{
accountCode: '195752115',
page: 1
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accountHolderTransactionList');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accountHolderTransactionList',
headers: {'content-type': 'application/json'},
data: {
accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER',
transactionListsPerAccount: [{accountCode: '195752115', page: 1}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accountHolderTransactionList';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountHolderCode":"CODE_OF_ACCOUNT_HOLDER","transactionListsPerAccount":[{"accountCode":"195752115","page":1}]}'
};
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}}/accountHolderTransactionList',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",\n "transactionListsPerAccount": [\n {\n "accountCode": "195752115",\n "page": 1\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 \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"transactionListsPerAccount\": [\n {\n \"accountCode\": \"195752115\",\n \"page\": 1\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accountHolderTransactionList")
.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/accountHolderTransactionList',
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({
accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER',
transactionListsPerAccount: [{accountCode: '195752115', page: 1}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accountHolderTransactionList',
headers: {'content-type': 'application/json'},
body: {
accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER',
transactionListsPerAccount: [{accountCode: '195752115', page: 1}]
},
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}}/accountHolderTransactionList');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER',
transactionListsPerAccount: [
{
accountCode: '195752115',
page: 1
}
]
});
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}}/accountHolderTransactionList',
headers: {'content-type': 'application/json'},
data: {
accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER',
transactionListsPerAccount: [{accountCode: '195752115', page: 1}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accountHolderTransactionList';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountHolderCode":"CODE_OF_ACCOUNT_HOLDER","transactionListsPerAccount":[{"accountCode":"195752115","page":1}]}'
};
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 = @{ @"accountHolderCode": @"CODE_OF_ACCOUNT_HOLDER",
@"transactionListsPerAccount": @[ @{ @"accountCode": @"195752115", @"page": @1 } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accountHolderTransactionList"]
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}}/accountHolderTransactionList" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"transactionListsPerAccount\": [\n {\n \"accountCode\": \"195752115\",\n \"page\": 1\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accountHolderTransactionList",
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([
'accountHolderCode' => 'CODE_OF_ACCOUNT_HOLDER',
'transactionListsPerAccount' => [
[
'accountCode' => '195752115',
'page' => 1
]
]
]),
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}}/accountHolderTransactionList', [
'body' => '{
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"transactionListsPerAccount": [
{
"accountCode": "195752115",
"page": 1
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accountHolderTransactionList');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accountHolderCode' => 'CODE_OF_ACCOUNT_HOLDER',
'transactionListsPerAccount' => [
[
'accountCode' => '195752115',
'page' => 1
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accountHolderCode' => 'CODE_OF_ACCOUNT_HOLDER',
'transactionListsPerAccount' => [
[
'accountCode' => '195752115',
'page' => 1
]
]
]));
$request->setRequestUrl('{{baseUrl}}/accountHolderTransactionList');
$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}}/accountHolderTransactionList' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"transactionListsPerAccount": [
{
"accountCode": "195752115",
"page": 1
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accountHolderTransactionList' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"transactionListsPerAccount": [
{
"accountCode": "195752115",
"page": 1
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"transactionListsPerAccount\": [\n {\n \"accountCode\": \"195752115\",\n \"page\": 1\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/accountHolderTransactionList", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accountHolderTransactionList"
payload = {
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"transactionListsPerAccount": [
{
"accountCode": "195752115",
"page": 1
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accountHolderTransactionList"
payload <- "{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"transactionListsPerAccount\": [\n {\n \"accountCode\": \"195752115\",\n \"page\": 1\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}}/accountHolderTransactionList")
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 \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"transactionListsPerAccount\": [\n {\n \"accountCode\": \"195752115\",\n \"page\": 1\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/accountHolderTransactionList') do |req|
req.body = "{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"transactionListsPerAccount\": [\n {\n \"accountCode\": \"195752115\",\n \"page\": 1\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}}/accountHolderTransactionList";
let payload = json!({
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"transactionListsPerAccount": (
json!({
"accountCode": "195752115",
"page": 1
})
)
});
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}}/accountHolderTransactionList \
--header 'content-type: application/json' \
--data '{
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"transactionListsPerAccount": [
{
"accountCode": "195752115",
"page": 1
}
]
}'
echo '{
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"transactionListsPerAccount": [
{
"accountCode": "195752115",
"page": 1
}
]
}' | \
http POST {{baseUrl}}/accountHolderTransactionList \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",\n "transactionListsPerAccount": [\n {\n "accountCode": "195752115",\n "page": 1\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/accountHolderTransactionList
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"transactionListsPerAccount": [
[
"accountCode": "195752115",
"page": 1
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accountHolderTransactionList")! 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
Get the balances of an account holder
{{baseUrl}}/accountHolderBalance
BODY json
{
"accountHolderCode": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accountHolderBalance");
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 \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accountHolderBalance" {:content-type :json
:form-params {:accountHolderCode "CODE_OF_ACCOUNT_HOLDER"}})
require "http/client"
url = "{{baseUrl}}/accountHolderBalance"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\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}}/accountHolderBalance"),
Content = new StringContent("{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\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}}/accountHolderBalance");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accountHolderBalance"
payload := strings.NewReader("{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\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/accountHolderBalance HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 51
{
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accountHolderBalance")
.setHeader("content-type", "application/json")
.setBody("{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accountHolderBalance"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\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 \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accountHolderBalance")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accountHolderBalance")
.header("content-type", "application/json")
.body("{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}")
.asString();
const data = JSON.stringify({
accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accountHolderBalance');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accountHolderBalance',
headers: {'content-type': 'application/json'},
data: {accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accountHolderBalance';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountHolderCode":"CODE_OF_ACCOUNT_HOLDER"}'
};
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}}/accountHolderBalance',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accountHolderBalance")
.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/accountHolderBalance',
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({accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accountHolderBalance',
headers: {'content-type': 'application/json'},
body: {accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER'},
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}}/accountHolderBalance');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER'
});
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}}/accountHolderBalance',
headers: {'content-type': 'application/json'},
data: {accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accountHolderBalance';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountHolderCode":"CODE_OF_ACCOUNT_HOLDER"}'
};
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 = @{ @"accountHolderCode": @"CODE_OF_ACCOUNT_HOLDER" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accountHolderBalance"]
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}}/accountHolderBalance" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accountHolderBalance",
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([
'accountHolderCode' => 'CODE_OF_ACCOUNT_HOLDER'
]),
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}}/accountHolderBalance', [
'body' => '{
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accountHolderBalance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accountHolderCode' => 'CODE_OF_ACCOUNT_HOLDER'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accountHolderCode' => 'CODE_OF_ACCOUNT_HOLDER'
]));
$request->setRequestUrl('{{baseUrl}}/accountHolderBalance');
$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}}/accountHolderBalance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accountHolderBalance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/accountHolderBalance", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accountHolderBalance"
payload = { "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accountHolderBalance"
payload <- "{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\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}}/accountHolderBalance")
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 \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\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/accountHolderBalance') do |req|
req.body = "{\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accountHolderBalance";
let payload = json!({"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"});
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}}/accountHolderBalance \
--header 'content-type: application/json' \
--data '{
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"
}'
echo '{
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"
}' | \
http POST {{baseUrl}}/accountHolderBalance \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"\n}' \
--output-document \
- {{baseUrl}}/accountHolderBalance
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accountHolderBalance")! 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
Pay out from an account to the account holder
{{baseUrl}}/payoutAccountHolder
BODY json
{
"accountCode": "",
"accountHolderCode": "",
"amount": {
"currency": "",
"value": 0
},
"bankAccountUUID": "",
"description": "",
"merchantReference": "",
"payoutMethodCode": "",
"payoutSpeed": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/payoutAccountHolder");
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 \"accountCode\": \"118731451\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 99792\n },\n \"bankAccountUUID\": \"000b81aa-ae7e-4492-aa7e-72b2129dce0c\",\n \"description\": \"12345 – Test\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/payoutAccountHolder" {:content-type :json
:form-params {:accountCode "118731451"
:accountHolderCode "CODE_OF_ACCOUNT_HOLDER"
:amount {:currency "EUR"
:value 99792}
:bankAccountUUID "000b81aa-ae7e-4492-aa7e-72b2129dce0c"
:description "12345 – Test"}})
require "http/client"
url = "{{baseUrl}}/payoutAccountHolder"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accountCode\": \"118731451\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 99792\n },\n \"bankAccountUUID\": \"000b81aa-ae7e-4492-aa7e-72b2129dce0c\",\n \"description\": \"12345 – Test\"\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}}/payoutAccountHolder"),
Content = new StringContent("{\n \"accountCode\": \"118731451\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 99792\n },\n \"bankAccountUUID\": \"000b81aa-ae7e-4492-aa7e-72b2129dce0c\",\n \"description\": \"12345 – Test\"\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}}/payoutAccountHolder");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accountCode\": \"118731451\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 99792\n },\n \"bankAccountUUID\": \"000b81aa-ae7e-4492-aa7e-72b2129dce0c\",\n \"description\": \"12345 – Test\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/payoutAccountHolder"
payload := strings.NewReader("{\n \"accountCode\": \"118731451\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 99792\n },\n \"bankAccountUUID\": \"000b81aa-ae7e-4492-aa7e-72b2129dce0c\",\n \"description\": \"12345 – Test\"\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/payoutAccountHolder HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 236
{
"accountCode": "118731451",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"amount": {
"currency": "EUR",
"value": 99792
},
"bankAccountUUID": "000b81aa-ae7e-4492-aa7e-72b2129dce0c",
"description": "12345 – Test"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/payoutAccountHolder")
.setHeader("content-type", "application/json")
.setBody("{\n \"accountCode\": \"118731451\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 99792\n },\n \"bankAccountUUID\": \"000b81aa-ae7e-4492-aa7e-72b2129dce0c\",\n \"description\": \"12345 – Test\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/payoutAccountHolder"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"accountCode\": \"118731451\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 99792\n },\n \"bankAccountUUID\": \"000b81aa-ae7e-4492-aa7e-72b2129dce0c\",\n \"description\": \"12345 – Test\"\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 \"accountCode\": \"118731451\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 99792\n },\n \"bankAccountUUID\": \"000b81aa-ae7e-4492-aa7e-72b2129dce0c\",\n \"description\": \"12345 – Test\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/payoutAccountHolder")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/payoutAccountHolder")
.header("content-type", "application/json")
.body("{\n \"accountCode\": \"118731451\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 99792\n },\n \"bankAccountUUID\": \"000b81aa-ae7e-4492-aa7e-72b2129dce0c\",\n \"description\": \"12345 – Test\"\n}")
.asString();
const data = JSON.stringify({
accountCode: '118731451',
accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER',
amount: {
currency: 'EUR',
value: 99792
},
bankAccountUUID: '000b81aa-ae7e-4492-aa7e-72b2129dce0c',
description: '12345 – Test'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/payoutAccountHolder');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/payoutAccountHolder',
headers: {'content-type': 'application/json'},
data: {
accountCode: '118731451',
accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER',
amount: {currency: 'EUR', value: 99792},
bankAccountUUID: '000b81aa-ae7e-4492-aa7e-72b2129dce0c',
description: '12345 – Test'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/payoutAccountHolder';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountCode":"118731451","accountHolderCode":"CODE_OF_ACCOUNT_HOLDER","amount":{"currency":"EUR","value":99792},"bankAccountUUID":"000b81aa-ae7e-4492-aa7e-72b2129dce0c","description":"12345 – Test"}'
};
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}}/payoutAccountHolder',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accountCode": "118731451",\n "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",\n "amount": {\n "currency": "EUR",\n "value": 99792\n },\n "bankAccountUUID": "000b81aa-ae7e-4492-aa7e-72b2129dce0c",\n "description": "12345 – Test"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"accountCode\": \"118731451\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 99792\n },\n \"bankAccountUUID\": \"000b81aa-ae7e-4492-aa7e-72b2129dce0c\",\n \"description\": \"12345 – Test\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/payoutAccountHolder")
.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/payoutAccountHolder',
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({
accountCode: '118731451',
accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER',
amount: {currency: 'EUR', value: 99792},
bankAccountUUID: '000b81aa-ae7e-4492-aa7e-72b2129dce0c',
description: '12345 – Test'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/payoutAccountHolder',
headers: {'content-type': 'application/json'},
body: {
accountCode: '118731451',
accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER',
amount: {currency: 'EUR', value: 99792},
bankAccountUUID: '000b81aa-ae7e-4492-aa7e-72b2129dce0c',
description: '12345 – Test'
},
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}}/payoutAccountHolder');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accountCode: '118731451',
accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER',
amount: {
currency: 'EUR',
value: 99792
},
bankAccountUUID: '000b81aa-ae7e-4492-aa7e-72b2129dce0c',
description: '12345 – Test'
});
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}}/payoutAccountHolder',
headers: {'content-type': 'application/json'},
data: {
accountCode: '118731451',
accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER',
amount: {currency: 'EUR', value: 99792},
bankAccountUUID: '000b81aa-ae7e-4492-aa7e-72b2129dce0c',
description: '12345 – Test'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/payoutAccountHolder';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountCode":"118731451","accountHolderCode":"CODE_OF_ACCOUNT_HOLDER","amount":{"currency":"EUR","value":99792},"bankAccountUUID":"000b81aa-ae7e-4492-aa7e-72b2129dce0c","description":"12345 – Test"}'
};
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 = @{ @"accountCode": @"118731451",
@"accountHolderCode": @"CODE_OF_ACCOUNT_HOLDER",
@"amount": @{ @"currency": @"EUR", @"value": @99792 },
@"bankAccountUUID": @"000b81aa-ae7e-4492-aa7e-72b2129dce0c",
@"description": @"12345 – Test" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/payoutAccountHolder"]
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}}/payoutAccountHolder" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accountCode\": \"118731451\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 99792\n },\n \"bankAccountUUID\": \"000b81aa-ae7e-4492-aa7e-72b2129dce0c\",\n \"description\": \"12345 – Test\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/payoutAccountHolder",
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([
'accountCode' => '118731451',
'accountHolderCode' => 'CODE_OF_ACCOUNT_HOLDER',
'amount' => [
'currency' => 'EUR',
'value' => 99792
],
'bankAccountUUID' => '000b81aa-ae7e-4492-aa7e-72b2129dce0c',
'description' => '12345 – Test'
]),
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}}/payoutAccountHolder', [
'body' => '{
"accountCode": "118731451",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"amount": {
"currency": "EUR",
"value": 99792
},
"bankAccountUUID": "000b81aa-ae7e-4492-aa7e-72b2129dce0c",
"description": "12345 – Test"
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/payoutAccountHolder');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accountCode' => '118731451',
'accountHolderCode' => 'CODE_OF_ACCOUNT_HOLDER',
'amount' => [
'currency' => 'EUR',
'value' => 99792
],
'bankAccountUUID' => '000b81aa-ae7e-4492-aa7e-72b2129dce0c',
'description' => '12345 – Test'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accountCode' => '118731451',
'accountHolderCode' => 'CODE_OF_ACCOUNT_HOLDER',
'amount' => [
'currency' => 'EUR',
'value' => 99792
],
'bankAccountUUID' => '000b81aa-ae7e-4492-aa7e-72b2129dce0c',
'description' => '12345 – Test'
]));
$request->setRequestUrl('{{baseUrl}}/payoutAccountHolder');
$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}}/payoutAccountHolder' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountCode": "118731451",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"amount": {
"currency": "EUR",
"value": 99792
},
"bankAccountUUID": "000b81aa-ae7e-4492-aa7e-72b2129dce0c",
"description": "12345 – Test"
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/payoutAccountHolder' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountCode": "118731451",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"amount": {
"currency": "EUR",
"value": 99792
},
"bankAccountUUID": "000b81aa-ae7e-4492-aa7e-72b2129dce0c",
"description": "12345 – Test"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accountCode\": \"118731451\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 99792\n },\n \"bankAccountUUID\": \"000b81aa-ae7e-4492-aa7e-72b2129dce0c\",\n \"description\": \"12345 – Test\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/payoutAccountHolder", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/payoutAccountHolder"
payload = {
"accountCode": "118731451",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"amount": {
"currency": "EUR",
"value": 99792
},
"bankAccountUUID": "000b81aa-ae7e-4492-aa7e-72b2129dce0c",
"description": "12345 – Test"
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/payoutAccountHolder"
payload <- "{\n \"accountCode\": \"118731451\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 99792\n },\n \"bankAccountUUID\": \"000b81aa-ae7e-4492-aa7e-72b2129dce0c\",\n \"description\": \"12345 – Test\"\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}}/payoutAccountHolder")
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 \"accountCode\": \"118731451\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 99792\n },\n \"bankAccountUUID\": \"000b81aa-ae7e-4492-aa7e-72b2129dce0c\",\n \"description\": \"12345 – Test\"\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/payoutAccountHolder') do |req|
req.body = "{\n \"accountCode\": \"118731451\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\",\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 99792\n },\n \"bankAccountUUID\": \"000b81aa-ae7e-4492-aa7e-72b2129dce0c\",\n \"description\": \"12345 – Test\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/payoutAccountHolder";
let payload = json!({
"accountCode": "118731451",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"amount": json!({
"currency": "EUR",
"value": 99792
}),
"bankAccountUUID": "000b81aa-ae7e-4492-aa7e-72b2129dce0c",
"description": "12345 – Test"
});
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}}/payoutAccountHolder \
--header 'content-type: application/json' \
--data '{
"accountCode": "118731451",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"amount": {
"currency": "EUR",
"value": 99792
},
"bankAccountUUID": "000b81aa-ae7e-4492-aa7e-72b2129dce0c",
"description": "12345 – Test"
}'
echo '{
"accountCode": "118731451",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"amount": {
"currency": "EUR",
"value": 99792
},
"bankAccountUUID": "000b81aa-ae7e-4492-aa7e-72b2129dce0c",
"description": "12345 – Test"
}' | \
http POST {{baseUrl}}/payoutAccountHolder \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "accountCode": "118731451",\n "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",\n "amount": {\n "currency": "EUR",\n "value": 99792\n },\n "bankAccountUUID": "000b81aa-ae7e-4492-aa7e-72b2129dce0c",\n "description": "12345 – Test"\n}' \
--output-document \
- {{baseUrl}}/payoutAccountHolder
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accountCode": "118731451",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER",
"amount": [
"currency": "EUR",
"value": 99792
],
"bankAccountUUID": "000b81aa-ae7e-4492-aa7e-72b2129dce0c",
"description": "12345 – Test"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/payoutAccountHolder")! 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
Refund a funds transfer
{{baseUrl}}/refundFundsTransfer
BODY json
{
"amount": {
"currency": "",
"value": 0
},
"merchantReference": "",
"originalReference": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/refundFundsTransfer");
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 \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 1000\n },\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"originalReference\": \"PSP_REFERENCE_OF_TRANSFER_TO_REFUND\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/refundFundsTransfer" {:content-type :json
:form-params {:amount {:currency "EUR"
:value 1000}
:merchantReference "YOUR_REFERENCE_ID"
:originalReference "PSP_REFERENCE_OF_TRANSFER_TO_REFUND"}})
require "http/client"
url = "{{baseUrl}}/refundFundsTransfer"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 1000\n },\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"originalReference\": \"PSP_REFERENCE_OF_TRANSFER_TO_REFUND\"\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}}/refundFundsTransfer"),
Content = new StringContent("{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 1000\n },\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"originalReference\": \"PSP_REFERENCE_OF_TRANSFER_TO_REFUND\"\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}}/refundFundsTransfer");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 1000\n },\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"originalReference\": \"PSP_REFERENCE_OF_TRANSFER_TO_REFUND\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/refundFundsTransfer"
payload := strings.NewReader("{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 1000\n },\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"originalReference\": \"PSP_REFERENCE_OF_TRANSFER_TO_REFUND\"\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/refundFundsTransfer HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 168
{
"amount": {
"currency": "EUR",
"value": 1000
},
"merchantReference": "YOUR_REFERENCE_ID",
"originalReference": "PSP_REFERENCE_OF_TRANSFER_TO_REFUND"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/refundFundsTransfer")
.setHeader("content-type", "application/json")
.setBody("{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 1000\n },\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"originalReference\": \"PSP_REFERENCE_OF_TRANSFER_TO_REFUND\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/refundFundsTransfer"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 1000\n },\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"originalReference\": \"PSP_REFERENCE_OF_TRANSFER_TO_REFUND\"\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 \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 1000\n },\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"originalReference\": \"PSP_REFERENCE_OF_TRANSFER_TO_REFUND\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/refundFundsTransfer")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/refundFundsTransfer")
.header("content-type", "application/json")
.body("{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 1000\n },\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"originalReference\": \"PSP_REFERENCE_OF_TRANSFER_TO_REFUND\"\n}")
.asString();
const data = JSON.stringify({
amount: {
currency: 'EUR',
value: 1000
},
merchantReference: 'YOUR_REFERENCE_ID',
originalReference: 'PSP_REFERENCE_OF_TRANSFER_TO_REFUND'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/refundFundsTransfer');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/refundFundsTransfer',
headers: {'content-type': 'application/json'},
data: {
amount: {currency: 'EUR', value: 1000},
merchantReference: 'YOUR_REFERENCE_ID',
originalReference: 'PSP_REFERENCE_OF_TRANSFER_TO_REFUND'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/refundFundsTransfer';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"amount":{"currency":"EUR","value":1000},"merchantReference":"YOUR_REFERENCE_ID","originalReference":"PSP_REFERENCE_OF_TRANSFER_TO_REFUND"}'
};
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}}/refundFundsTransfer',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "amount": {\n "currency": "EUR",\n "value": 1000\n },\n "merchantReference": "YOUR_REFERENCE_ID",\n "originalReference": "PSP_REFERENCE_OF_TRANSFER_TO_REFUND"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 1000\n },\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"originalReference\": \"PSP_REFERENCE_OF_TRANSFER_TO_REFUND\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/refundFundsTransfer")
.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/refundFundsTransfer',
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({
amount: {currency: 'EUR', value: 1000},
merchantReference: 'YOUR_REFERENCE_ID',
originalReference: 'PSP_REFERENCE_OF_TRANSFER_TO_REFUND'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/refundFundsTransfer',
headers: {'content-type': 'application/json'},
body: {
amount: {currency: 'EUR', value: 1000},
merchantReference: 'YOUR_REFERENCE_ID',
originalReference: 'PSP_REFERENCE_OF_TRANSFER_TO_REFUND'
},
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}}/refundFundsTransfer');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
amount: {
currency: 'EUR',
value: 1000
},
merchantReference: 'YOUR_REFERENCE_ID',
originalReference: 'PSP_REFERENCE_OF_TRANSFER_TO_REFUND'
});
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}}/refundFundsTransfer',
headers: {'content-type': 'application/json'},
data: {
amount: {currency: 'EUR', value: 1000},
merchantReference: 'YOUR_REFERENCE_ID',
originalReference: 'PSP_REFERENCE_OF_TRANSFER_TO_REFUND'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/refundFundsTransfer';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"amount":{"currency":"EUR","value":1000},"merchantReference":"YOUR_REFERENCE_ID","originalReference":"PSP_REFERENCE_OF_TRANSFER_TO_REFUND"}'
};
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 = @{ @"amount": @{ @"currency": @"EUR", @"value": @1000 },
@"merchantReference": @"YOUR_REFERENCE_ID",
@"originalReference": @"PSP_REFERENCE_OF_TRANSFER_TO_REFUND" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/refundFundsTransfer"]
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}}/refundFundsTransfer" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 1000\n },\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"originalReference\": \"PSP_REFERENCE_OF_TRANSFER_TO_REFUND\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/refundFundsTransfer",
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([
'amount' => [
'currency' => 'EUR',
'value' => 1000
],
'merchantReference' => 'YOUR_REFERENCE_ID',
'originalReference' => 'PSP_REFERENCE_OF_TRANSFER_TO_REFUND'
]),
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}}/refundFundsTransfer', [
'body' => '{
"amount": {
"currency": "EUR",
"value": 1000
},
"merchantReference": "YOUR_REFERENCE_ID",
"originalReference": "PSP_REFERENCE_OF_TRANSFER_TO_REFUND"
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/refundFundsTransfer');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'amount' => [
'currency' => 'EUR',
'value' => 1000
],
'merchantReference' => 'YOUR_REFERENCE_ID',
'originalReference' => 'PSP_REFERENCE_OF_TRANSFER_TO_REFUND'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'amount' => [
'currency' => 'EUR',
'value' => 1000
],
'merchantReference' => 'YOUR_REFERENCE_ID',
'originalReference' => 'PSP_REFERENCE_OF_TRANSFER_TO_REFUND'
]));
$request->setRequestUrl('{{baseUrl}}/refundFundsTransfer');
$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}}/refundFundsTransfer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"amount": {
"currency": "EUR",
"value": 1000
},
"merchantReference": "YOUR_REFERENCE_ID",
"originalReference": "PSP_REFERENCE_OF_TRANSFER_TO_REFUND"
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/refundFundsTransfer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"amount": {
"currency": "EUR",
"value": 1000
},
"merchantReference": "YOUR_REFERENCE_ID",
"originalReference": "PSP_REFERENCE_OF_TRANSFER_TO_REFUND"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 1000\n },\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"originalReference\": \"PSP_REFERENCE_OF_TRANSFER_TO_REFUND\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/refundFundsTransfer", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/refundFundsTransfer"
payload = {
"amount": {
"currency": "EUR",
"value": 1000
},
"merchantReference": "YOUR_REFERENCE_ID",
"originalReference": "PSP_REFERENCE_OF_TRANSFER_TO_REFUND"
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/refundFundsTransfer"
payload <- "{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 1000\n },\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"originalReference\": \"PSP_REFERENCE_OF_TRANSFER_TO_REFUND\"\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}}/refundFundsTransfer")
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 \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 1000\n },\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"originalReference\": \"PSP_REFERENCE_OF_TRANSFER_TO_REFUND\"\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/refundFundsTransfer') do |req|
req.body = "{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 1000\n },\n \"merchantReference\": \"YOUR_REFERENCE_ID\",\n \"originalReference\": \"PSP_REFERENCE_OF_TRANSFER_TO_REFUND\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/refundFundsTransfer";
let payload = json!({
"amount": json!({
"currency": "EUR",
"value": 1000
}),
"merchantReference": "YOUR_REFERENCE_ID",
"originalReference": "PSP_REFERENCE_OF_TRANSFER_TO_REFUND"
});
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}}/refundFundsTransfer \
--header 'content-type: application/json' \
--data '{
"amount": {
"currency": "EUR",
"value": 1000
},
"merchantReference": "YOUR_REFERENCE_ID",
"originalReference": "PSP_REFERENCE_OF_TRANSFER_TO_REFUND"
}'
echo '{
"amount": {
"currency": "EUR",
"value": 1000
},
"merchantReference": "YOUR_REFERENCE_ID",
"originalReference": "PSP_REFERENCE_OF_TRANSFER_TO_REFUND"
}' | \
http POST {{baseUrl}}/refundFundsTransfer \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "amount": {\n "currency": "EUR",\n "value": 1000\n },\n "merchantReference": "YOUR_REFERENCE_ID",\n "originalReference": "PSP_REFERENCE_OF_TRANSFER_TO_REFUND"\n}' \
--output-document \
- {{baseUrl}}/refundFundsTransfer
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"amount": [
"currency": "EUR",
"value": 1000
],
"merchantReference": "YOUR_REFERENCE_ID",
"originalReference": "PSP_REFERENCE_OF_TRANSFER_TO_REFUND"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/refundFundsTransfer")! 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
Refund all transactions of an account since the most recent payout
{{baseUrl}}/refundNotPaidOutTransfers
BODY json
{
"accountCode": "",
"accountHolderCode": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/refundNotPaidOutTransfers");
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 \"accountCode\": \"189184578\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/refundNotPaidOutTransfers" {:content-type :json
:form-params {:accountCode "189184578"
:accountHolderCode "CODE_OF_ACCOUNT_HOLDER"}})
require "http/client"
url = "{{baseUrl}}/refundNotPaidOutTransfers"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accountCode\": \"189184578\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\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}}/refundNotPaidOutTransfers"),
Content = new StringContent("{\n \"accountCode\": \"189184578\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\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}}/refundNotPaidOutTransfers");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accountCode\": \"189184578\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/refundNotPaidOutTransfers"
payload := strings.NewReader("{\n \"accountCode\": \"189184578\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\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/refundNotPaidOutTransfers HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 81
{
"accountCode": "189184578",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/refundNotPaidOutTransfers")
.setHeader("content-type", "application/json")
.setBody("{\n \"accountCode\": \"189184578\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/refundNotPaidOutTransfers"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"accountCode\": \"189184578\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\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 \"accountCode\": \"189184578\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/refundNotPaidOutTransfers")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/refundNotPaidOutTransfers")
.header("content-type", "application/json")
.body("{\n \"accountCode\": \"189184578\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}")
.asString();
const data = JSON.stringify({
accountCode: '189184578',
accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/refundNotPaidOutTransfers');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/refundNotPaidOutTransfers',
headers: {'content-type': 'application/json'},
data: {accountCode: '189184578', accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/refundNotPaidOutTransfers';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountCode":"189184578","accountHolderCode":"CODE_OF_ACCOUNT_HOLDER"}'
};
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}}/refundNotPaidOutTransfers',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accountCode": "189184578",\n "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"accountCode\": \"189184578\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/refundNotPaidOutTransfers")
.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/refundNotPaidOutTransfers',
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({accountCode: '189184578', accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/refundNotPaidOutTransfers',
headers: {'content-type': 'application/json'},
body: {accountCode: '189184578', accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER'},
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}}/refundNotPaidOutTransfers');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accountCode: '189184578',
accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER'
});
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}}/refundNotPaidOutTransfers',
headers: {'content-type': 'application/json'},
data: {accountCode: '189184578', accountHolderCode: 'CODE_OF_ACCOUNT_HOLDER'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/refundNotPaidOutTransfers';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountCode":"189184578","accountHolderCode":"CODE_OF_ACCOUNT_HOLDER"}'
};
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 = @{ @"accountCode": @"189184578",
@"accountHolderCode": @"CODE_OF_ACCOUNT_HOLDER" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/refundNotPaidOutTransfers"]
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}}/refundNotPaidOutTransfers" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accountCode\": \"189184578\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/refundNotPaidOutTransfers",
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([
'accountCode' => '189184578',
'accountHolderCode' => 'CODE_OF_ACCOUNT_HOLDER'
]),
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}}/refundNotPaidOutTransfers', [
'body' => '{
"accountCode": "189184578",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/refundNotPaidOutTransfers');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accountCode' => '189184578',
'accountHolderCode' => 'CODE_OF_ACCOUNT_HOLDER'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accountCode' => '189184578',
'accountHolderCode' => 'CODE_OF_ACCOUNT_HOLDER'
]));
$request->setRequestUrl('{{baseUrl}}/refundNotPaidOutTransfers');
$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}}/refundNotPaidOutTransfers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountCode": "189184578",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/refundNotPaidOutTransfers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountCode": "189184578",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accountCode\": \"189184578\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/refundNotPaidOutTransfers", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/refundNotPaidOutTransfers"
payload = {
"accountCode": "189184578",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/refundNotPaidOutTransfers"
payload <- "{\n \"accountCode\": \"189184578\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\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}}/refundNotPaidOutTransfers")
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 \"accountCode\": \"189184578\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\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/refundNotPaidOutTransfers') do |req|
req.body = "{\n \"accountCode\": \"189184578\",\n \"accountHolderCode\": \"CODE_OF_ACCOUNT_HOLDER\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/refundNotPaidOutTransfers";
let payload = json!({
"accountCode": "189184578",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"
});
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}}/refundNotPaidOutTransfers \
--header 'content-type: application/json' \
--data '{
"accountCode": "189184578",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"
}'
echo '{
"accountCode": "189184578",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"
}' | \
http POST {{baseUrl}}/refundNotPaidOutTransfers \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "accountCode": "189184578",\n "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"\n}' \
--output-document \
- {{baseUrl}}/refundNotPaidOutTransfers
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accountCode": "189184578",
"accountHolderCode": "CODE_OF_ACCOUNT_HOLDER"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/refundNotPaidOutTransfers")! 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
Send a direct debit request
{{baseUrl}}/debitAccountHolder
BODY json
{
"accountHolderCode": "",
"amount": {
"currency": "",
"value": 0
},
"bankAccountUUID": "",
"description": "",
"merchantAccount": "",
"splits": [
{
"account": "",
"amount": {
"currency": "",
"value": 0
},
"description": "",
"reference": "",
"type": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/debitAccountHolder");
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 \"accountHolderCode\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"bankAccountUUID\": \"\",\n \"description\": \"\",\n \"merchantAccount\": \"\",\n \"splits\": [\n {\n \"account\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"description\": \"\",\n \"reference\": \"\",\n \"type\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/debitAccountHolder" {:content-type :json
:form-params {:accountHolderCode ""
:amount {:currency ""
:value 0}
:bankAccountUUID ""
:description ""
:merchantAccount ""
:splits [{:account ""
:amount {:currency ""
:value 0}
:description ""
:reference ""
:type ""}]}})
require "http/client"
url = "{{baseUrl}}/debitAccountHolder"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accountHolderCode\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"bankAccountUUID\": \"\",\n \"description\": \"\",\n \"merchantAccount\": \"\",\n \"splits\": [\n {\n \"account\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"description\": \"\",\n \"reference\": \"\",\n \"type\": \"\"\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}}/debitAccountHolder"),
Content = new StringContent("{\n \"accountHolderCode\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"bankAccountUUID\": \"\",\n \"description\": \"\",\n \"merchantAccount\": \"\",\n \"splits\": [\n {\n \"account\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"description\": \"\",\n \"reference\": \"\",\n \"type\": \"\"\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}}/debitAccountHolder");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accountHolderCode\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"bankAccountUUID\": \"\",\n \"description\": \"\",\n \"merchantAccount\": \"\",\n \"splits\": [\n {\n \"account\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"description\": \"\",\n \"reference\": \"\",\n \"type\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/debitAccountHolder"
payload := strings.NewReader("{\n \"accountHolderCode\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"bankAccountUUID\": \"\",\n \"description\": \"\",\n \"merchantAccount\": \"\",\n \"splits\": [\n {\n \"account\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"description\": \"\",\n \"reference\": \"\",\n \"type\": \"\"\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/debitAccountHolder HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 341
{
"accountHolderCode": "",
"amount": {
"currency": "",
"value": 0
},
"bankAccountUUID": "",
"description": "",
"merchantAccount": "",
"splits": [
{
"account": "",
"amount": {
"currency": "",
"value": 0
},
"description": "",
"reference": "",
"type": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/debitAccountHolder")
.setHeader("content-type", "application/json")
.setBody("{\n \"accountHolderCode\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"bankAccountUUID\": \"\",\n \"description\": \"\",\n \"merchantAccount\": \"\",\n \"splits\": [\n {\n \"account\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"description\": \"\",\n \"reference\": \"\",\n \"type\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/debitAccountHolder"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"accountHolderCode\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"bankAccountUUID\": \"\",\n \"description\": \"\",\n \"merchantAccount\": \"\",\n \"splits\": [\n {\n \"account\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"description\": \"\",\n \"reference\": \"\",\n \"type\": \"\"\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 \"accountHolderCode\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"bankAccountUUID\": \"\",\n \"description\": \"\",\n \"merchantAccount\": \"\",\n \"splits\": [\n {\n \"account\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"description\": \"\",\n \"reference\": \"\",\n \"type\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/debitAccountHolder")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/debitAccountHolder")
.header("content-type", "application/json")
.body("{\n \"accountHolderCode\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"bankAccountUUID\": \"\",\n \"description\": \"\",\n \"merchantAccount\": \"\",\n \"splits\": [\n {\n \"account\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"description\": \"\",\n \"reference\": \"\",\n \"type\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
accountHolderCode: '',
amount: {
currency: '',
value: 0
},
bankAccountUUID: '',
description: '',
merchantAccount: '',
splits: [
{
account: '',
amount: {
currency: '',
value: 0
},
description: '',
reference: '',
type: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/debitAccountHolder');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/debitAccountHolder',
headers: {'content-type': 'application/json'},
data: {
accountHolderCode: '',
amount: {currency: '', value: 0},
bankAccountUUID: '',
description: '',
merchantAccount: '',
splits: [
{
account: '',
amount: {currency: '', value: 0},
description: '',
reference: '',
type: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/debitAccountHolder';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountHolderCode":"","amount":{"currency":"","value":0},"bankAccountUUID":"","description":"","merchantAccount":"","splits":[{"account":"","amount":{"currency":"","value":0},"description":"","reference":"","type":""}]}'
};
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}}/debitAccountHolder',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accountHolderCode": "",\n "amount": {\n "currency": "",\n "value": 0\n },\n "bankAccountUUID": "",\n "description": "",\n "merchantAccount": "",\n "splits": [\n {\n "account": "",\n "amount": {\n "currency": "",\n "value": 0\n },\n "description": "",\n "reference": "",\n "type": ""\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 \"accountHolderCode\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"bankAccountUUID\": \"\",\n \"description\": \"\",\n \"merchantAccount\": \"\",\n \"splits\": [\n {\n \"account\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"description\": \"\",\n \"reference\": \"\",\n \"type\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/debitAccountHolder")
.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/debitAccountHolder',
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({
accountHolderCode: '',
amount: {currency: '', value: 0},
bankAccountUUID: '',
description: '',
merchantAccount: '',
splits: [
{
account: '',
amount: {currency: '', value: 0},
description: '',
reference: '',
type: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/debitAccountHolder',
headers: {'content-type': 'application/json'},
body: {
accountHolderCode: '',
amount: {currency: '', value: 0},
bankAccountUUID: '',
description: '',
merchantAccount: '',
splits: [
{
account: '',
amount: {currency: '', value: 0},
description: '',
reference: '',
type: ''
}
]
},
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}}/debitAccountHolder');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accountHolderCode: '',
amount: {
currency: '',
value: 0
},
bankAccountUUID: '',
description: '',
merchantAccount: '',
splits: [
{
account: '',
amount: {
currency: '',
value: 0
},
description: '',
reference: '',
type: ''
}
]
});
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}}/debitAccountHolder',
headers: {'content-type': 'application/json'},
data: {
accountHolderCode: '',
amount: {currency: '', value: 0},
bankAccountUUID: '',
description: '',
merchantAccount: '',
splits: [
{
account: '',
amount: {currency: '', value: 0},
description: '',
reference: '',
type: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/debitAccountHolder';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountHolderCode":"","amount":{"currency":"","value":0},"bankAccountUUID":"","description":"","merchantAccount":"","splits":[{"account":"","amount":{"currency":"","value":0},"description":"","reference":"","type":""}]}'
};
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 = @{ @"accountHolderCode": @"",
@"amount": @{ @"currency": @"", @"value": @0 },
@"bankAccountUUID": @"",
@"description": @"",
@"merchantAccount": @"",
@"splits": @[ @{ @"account": @"", @"amount": @{ @"currency": @"", @"value": @0 }, @"description": @"", @"reference": @"", @"type": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/debitAccountHolder"]
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}}/debitAccountHolder" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accountHolderCode\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"bankAccountUUID\": \"\",\n \"description\": \"\",\n \"merchantAccount\": \"\",\n \"splits\": [\n {\n \"account\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"description\": \"\",\n \"reference\": \"\",\n \"type\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/debitAccountHolder",
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([
'accountHolderCode' => '',
'amount' => [
'currency' => '',
'value' => 0
],
'bankAccountUUID' => '',
'description' => '',
'merchantAccount' => '',
'splits' => [
[
'account' => '',
'amount' => [
'currency' => '',
'value' => 0
],
'description' => '',
'reference' => '',
'type' => ''
]
]
]),
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}}/debitAccountHolder', [
'body' => '{
"accountHolderCode": "",
"amount": {
"currency": "",
"value": 0
},
"bankAccountUUID": "",
"description": "",
"merchantAccount": "",
"splits": [
{
"account": "",
"amount": {
"currency": "",
"value": 0
},
"description": "",
"reference": "",
"type": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/debitAccountHolder');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accountHolderCode' => '',
'amount' => [
'currency' => '',
'value' => 0
],
'bankAccountUUID' => '',
'description' => '',
'merchantAccount' => '',
'splits' => [
[
'account' => '',
'amount' => [
'currency' => '',
'value' => 0
],
'description' => '',
'reference' => '',
'type' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accountHolderCode' => '',
'amount' => [
'currency' => '',
'value' => 0
],
'bankAccountUUID' => '',
'description' => '',
'merchantAccount' => '',
'splits' => [
[
'account' => '',
'amount' => [
'currency' => '',
'value' => 0
],
'description' => '',
'reference' => '',
'type' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/debitAccountHolder');
$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}}/debitAccountHolder' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountHolderCode": "",
"amount": {
"currency": "",
"value": 0
},
"bankAccountUUID": "",
"description": "",
"merchantAccount": "",
"splits": [
{
"account": "",
"amount": {
"currency": "",
"value": 0
},
"description": "",
"reference": "",
"type": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/debitAccountHolder' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountHolderCode": "",
"amount": {
"currency": "",
"value": 0
},
"bankAccountUUID": "",
"description": "",
"merchantAccount": "",
"splits": [
{
"account": "",
"amount": {
"currency": "",
"value": 0
},
"description": "",
"reference": "",
"type": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accountHolderCode\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"bankAccountUUID\": \"\",\n \"description\": \"\",\n \"merchantAccount\": \"\",\n \"splits\": [\n {\n \"account\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"description\": \"\",\n \"reference\": \"\",\n \"type\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/debitAccountHolder", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/debitAccountHolder"
payload = {
"accountHolderCode": "",
"amount": {
"currency": "",
"value": 0
},
"bankAccountUUID": "",
"description": "",
"merchantAccount": "",
"splits": [
{
"account": "",
"amount": {
"currency": "",
"value": 0
},
"description": "",
"reference": "",
"type": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/debitAccountHolder"
payload <- "{\n \"accountHolderCode\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"bankAccountUUID\": \"\",\n \"description\": \"\",\n \"merchantAccount\": \"\",\n \"splits\": [\n {\n \"account\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"description\": \"\",\n \"reference\": \"\",\n \"type\": \"\"\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}}/debitAccountHolder")
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 \"accountHolderCode\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"bankAccountUUID\": \"\",\n \"description\": \"\",\n \"merchantAccount\": \"\",\n \"splits\": [\n {\n \"account\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"description\": \"\",\n \"reference\": \"\",\n \"type\": \"\"\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/debitAccountHolder') do |req|
req.body = "{\n \"accountHolderCode\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"bankAccountUUID\": \"\",\n \"description\": \"\",\n \"merchantAccount\": \"\",\n \"splits\": [\n {\n \"account\": \"\",\n \"amount\": {\n \"currency\": \"\",\n \"value\": 0\n },\n \"description\": \"\",\n \"reference\": \"\",\n \"type\": \"\"\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}}/debitAccountHolder";
let payload = json!({
"accountHolderCode": "",
"amount": json!({
"currency": "",
"value": 0
}),
"bankAccountUUID": "",
"description": "",
"merchantAccount": "",
"splits": (
json!({
"account": "",
"amount": json!({
"currency": "",
"value": 0
}),
"description": "",
"reference": "",
"type": ""
})
)
});
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}}/debitAccountHolder \
--header 'content-type: application/json' \
--data '{
"accountHolderCode": "",
"amount": {
"currency": "",
"value": 0
},
"bankAccountUUID": "",
"description": "",
"merchantAccount": "",
"splits": [
{
"account": "",
"amount": {
"currency": "",
"value": 0
},
"description": "",
"reference": "",
"type": ""
}
]
}'
echo '{
"accountHolderCode": "",
"amount": {
"currency": "",
"value": 0
},
"bankAccountUUID": "",
"description": "",
"merchantAccount": "",
"splits": [
{
"account": "",
"amount": {
"currency": "",
"value": 0
},
"description": "",
"reference": "",
"type": ""
}
]
}' | \
http POST {{baseUrl}}/debitAccountHolder \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "accountHolderCode": "",\n "amount": {\n "currency": "",\n "value": 0\n },\n "bankAccountUUID": "",\n "description": "",\n "merchantAccount": "",\n "splits": [\n {\n "account": "",\n "amount": {\n "currency": "",\n "value": 0\n },\n "description": "",\n "reference": "",\n "type": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/debitAccountHolder
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accountHolderCode": "",
"amount": [
"currency": "",
"value": 0
],
"bankAccountUUID": "",
"description": "",
"merchantAccount": "",
"splits": [
[
"account": "",
"amount": [
"currency": "",
"value": 0
],
"description": "",
"reference": "",
"type": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/debitAccountHolder")! 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
{
"pspReference": "8816480354727275",
"submittedAsync": "false"
}
POST
Transfer funds between platform accounts
{{baseUrl}}/transferFunds
BODY json
{
"amount": {
"currency": "",
"value": 0
},
"destinationAccountCode": "",
"merchantReference": "",
"sourceAccountCode": "",
"transferCode": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/transferFunds");
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 \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 2000\n },\n \"destinationAccountCode\": \"190324759\",\n \"sourceAccountCode\": \"100000000\",\n \"transferCode\": \"TransferCode_1\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/transferFunds" {:content-type :json
:form-params {:amount {:currency "EUR"
:value 2000}
:destinationAccountCode "190324759"
:sourceAccountCode "100000000"
:transferCode "TransferCode_1"}})
require "http/client"
url = "{{baseUrl}}/transferFunds"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 2000\n },\n \"destinationAccountCode\": \"190324759\",\n \"sourceAccountCode\": \"100000000\",\n \"transferCode\": \"TransferCode_1\"\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}}/transferFunds"),
Content = new StringContent("{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 2000\n },\n \"destinationAccountCode\": \"190324759\",\n \"sourceAccountCode\": \"100000000\",\n \"transferCode\": \"TransferCode_1\"\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}}/transferFunds");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 2000\n },\n \"destinationAccountCode\": \"190324759\",\n \"sourceAccountCode\": \"100000000\",\n \"transferCode\": \"TransferCode_1\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/transferFunds"
payload := strings.NewReader("{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 2000\n },\n \"destinationAccountCode\": \"190324759\",\n \"sourceAccountCode\": \"100000000\",\n \"transferCode\": \"TransferCode_1\"\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/transferFunds HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 175
{
"amount": {
"currency": "EUR",
"value": 2000
},
"destinationAccountCode": "190324759",
"sourceAccountCode": "100000000",
"transferCode": "TransferCode_1"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/transferFunds")
.setHeader("content-type", "application/json")
.setBody("{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 2000\n },\n \"destinationAccountCode\": \"190324759\",\n \"sourceAccountCode\": \"100000000\",\n \"transferCode\": \"TransferCode_1\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/transferFunds"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 2000\n },\n \"destinationAccountCode\": \"190324759\",\n \"sourceAccountCode\": \"100000000\",\n \"transferCode\": \"TransferCode_1\"\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 \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 2000\n },\n \"destinationAccountCode\": \"190324759\",\n \"sourceAccountCode\": \"100000000\",\n \"transferCode\": \"TransferCode_1\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/transferFunds")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/transferFunds")
.header("content-type", "application/json")
.body("{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 2000\n },\n \"destinationAccountCode\": \"190324759\",\n \"sourceAccountCode\": \"100000000\",\n \"transferCode\": \"TransferCode_1\"\n}")
.asString();
const data = JSON.stringify({
amount: {
currency: 'EUR',
value: 2000
},
destinationAccountCode: '190324759',
sourceAccountCode: '100000000',
transferCode: 'TransferCode_1'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/transferFunds');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/transferFunds',
headers: {'content-type': 'application/json'},
data: {
amount: {currency: 'EUR', value: 2000},
destinationAccountCode: '190324759',
sourceAccountCode: '100000000',
transferCode: 'TransferCode_1'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/transferFunds';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"amount":{"currency":"EUR","value":2000},"destinationAccountCode":"190324759","sourceAccountCode":"100000000","transferCode":"TransferCode_1"}'
};
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}}/transferFunds',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "amount": {\n "currency": "EUR",\n "value": 2000\n },\n "destinationAccountCode": "190324759",\n "sourceAccountCode": "100000000",\n "transferCode": "TransferCode_1"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 2000\n },\n \"destinationAccountCode\": \"190324759\",\n \"sourceAccountCode\": \"100000000\",\n \"transferCode\": \"TransferCode_1\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/transferFunds")
.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/transferFunds',
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({
amount: {currency: 'EUR', value: 2000},
destinationAccountCode: '190324759',
sourceAccountCode: '100000000',
transferCode: 'TransferCode_1'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/transferFunds',
headers: {'content-type': 'application/json'},
body: {
amount: {currency: 'EUR', value: 2000},
destinationAccountCode: '190324759',
sourceAccountCode: '100000000',
transferCode: 'TransferCode_1'
},
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}}/transferFunds');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
amount: {
currency: 'EUR',
value: 2000
},
destinationAccountCode: '190324759',
sourceAccountCode: '100000000',
transferCode: 'TransferCode_1'
});
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}}/transferFunds',
headers: {'content-type': 'application/json'},
data: {
amount: {currency: 'EUR', value: 2000},
destinationAccountCode: '190324759',
sourceAccountCode: '100000000',
transferCode: 'TransferCode_1'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/transferFunds';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"amount":{"currency":"EUR","value":2000},"destinationAccountCode":"190324759","sourceAccountCode":"100000000","transferCode":"TransferCode_1"}'
};
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 = @{ @"amount": @{ @"currency": @"EUR", @"value": @2000 },
@"destinationAccountCode": @"190324759",
@"sourceAccountCode": @"100000000",
@"transferCode": @"TransferCode_1" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/transferFunds"]
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}}/transferFunds" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 2000\n },\n \"destinationAccountCode\": \"190324759\",\n \"sourceAccountCode\": \"100000000\",\n \"transferCode\": \"TransferCode_1\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/transferFunds",
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([
'amount' => [
'currency' => 'EUR',
'value' => 2000
],
'destinationAccountCode' => '190324759',
'sourceAccountCode' => '100000000',
'transferCode' => 'TransferCode_1'
]),
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}}/transferFunds', [
'body' => '{
"amount": {
"currency": "EUR",
"value": 2000
},
"destinationAccountCode": "190324759",
"sourceAccountCode": "100000000",
"transferCode": "TransferCode_1"
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/transferFunds');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'amount' => [
'currency' => 'EUR',
'value' => 2000
],
'destinationAccountCode' => '190324759',
'sourceAccountCode' => '100000000',
'transferCode' => 'TransferCode_1'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'amount' => [
'currency' => 'EUR',
'value' => 2000
],
'destinationAccountCode' => '190324759',
'sourceAccountCode' => '100000000',
'transferCode' => 'TransferCode_1'
]));
$request->setRequestUrl('{{baseUrl}}/transferFunds');
$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}}/transferFunds' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"amount": {
"currency": "EUR",
"value": 2000
},
"destinationAccountCode": "190324759",
"sourceAccountCode": "100000000",
"transferCode": "TransferCode_1"
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/transferFunds' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"amount": {
"currency": "EUR",
"value": 2000
},
"destinationAccountCode": "190324759",
"sourceAccountCode": "100000000",
"transferCode": "TransferCode_1"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 2000\n },\n \"destinationAccountCode\": \"190324759\",\n \"sourceAccountCode\": \"100000000\",\n \"transferCode\": \"TransferCode_1\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/transferFunds", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/transferFunds"
payload = {
"amount": {
"currency": "EUR",
"value": 2000
},
"destinationAccountCode": "190324759",
"sourceAccountCode": "100000000",
"transferCode": "TransferCode_1"
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/transferFunds"
payload <- "{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 2000\n },\n \"destinationAccountCode\": \"190324759\",\n \"sourceAccountCode\": \"100000000\",\n \"transferCode\": \"TransferCode_1\"\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}}/transferFunds")
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 \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 2000\n },\n \"destinationAccountCode\": \"190324759\",\n \"sourceAccountCode\": \"100000000\",\n \"transferCode\": \"TransferCode_1\"\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/transferFunds') do |req|
req.body = "{\n \"amount\": {\n \"currency\": \"EUR\",\n \"value\": 2000\n },\n \"destinationAccountCode\": \"190324759\",\n \"sourceAccountCode\": \"100000000\",\n \"transferCode\": \"TransferCode_1\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/transferFunds";
let payload = json!({
"amount": json!({
"currency": "EUR",
"value": 2000
}),
"destinationAccountCode": "190324759",
"sourceAccountCode": "100000000",
"transferCode": "TransferCode_1"
});
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}}/transferFunds \
--header 'content-type: application/json' \
--data '{
"amount": {
"currency": "EUR",
"value": 2000
},
"destinationAccountCode": "190324759",
"sourceAccountCode": "100000000",
"transferCode": "TransferCode_1"
}'
echo '{
"amount": {
"currency": "EUR",
"value": 2000
},
"destinationAccountCode": "190324759",
"sourceAccountCode": "100000000",
"transferCode": "TransferCode_1"
}' | \
http POST {{baseUrl}}/transferFunds \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "amount": {\n "currency": "EUR",\n "value": 2000\n },\n "destinationAccountCode": "190324759",\n "sourceAccountCode": "100000000",\n "transferCode": "TransferCode_1"\n}' \
--output-document \
- {{baseUrl}}/transferFunds
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"amount": [
"currency": "EUR",
"value": 2000
],
"destinationAccountCode": "190324759",
"sourceAccountCode": "100000000",
"transferCode": "TransferCode_1"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/transferFunds")! 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()