Server-to-Server
Last updated: 2026-03-25
This guide walks you through the entire payment journey, from start to finish. As a merchant, you are in full control, collecting all card and, payment details directly. This behind-the-scenes process ensures a seamless experience for shoppers.
- PCI-DSS Compliance: To collect card data, you must be PCI-DSS compliant. To reduce compliance requirements, use COPYandPAY.
- HTTP POST Requests: All parameters must be in the message body, not in the URL.
- Refer to the API reference for a detailed list of available parameters.
You can use Server-to-Server with two different flows:
Known limitations
If FNB is your acquirer, you cannot use special characters in the merchantTransactionId or merchantInvoiceId parameters and must only use letters and numbers.
Synchronous payment
The synchronous payment flow allows you o process the payment in near real-time. You collect card data from the customer and initiate the synchronous payment flow.
Pre-authorisation and capture
1. Pre-authorise payment
Send a server-to-server POST request with the required payment data. The system verifies the payment details and reserves the funds. The response includes an id, which you must store for subsequent operations.
Sample request:
curl https://sandbox-card.peachpayments.com/v1/payments \
-d "entityId=8a8294174e735d0c014e78cf26461790" \
-d "amount=92.00" \
-d "currency=EUR" \
-d "paymentBrand=VISA" \
-d "paymentType=PA" \
-d "card.number=4200000000000000" \
-d "card.holder=Jane Jones" \
-d "card.expiryMonth=05" \
-d "card.expiryYear=2034" \
-d "card.cvv=123" \
-H "Authorization: Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ="using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
using System.Web.Script.Serialization;
public class PaymentProcessor
{
public Dictionary<string, dynamic> Request()
{
Dictionary<string, dynamic> responseData;
string data = "entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"¤cy=EUR" +
"&paymentBrand=VISA" +
"&paymentType=DB" +
"&card.number=4200000000000000" +
"&card.holder=Jane Jones" +
"&card.expiryMonth=05" +
"&card.expiryYear=2034" +
"&card.cvv=123";
string url = "https://sandbox-card.peachpayments.com/v1/payments";
byte[] buffer = Encoding.ASCII.GetBytes(data);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
request.Headers["Authorization"] = "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=";
request.ContentType = "application/x-www-form-urlencoded";
Stream postData = request.GetRequestStream();
postData.Write(buffer, 0, buffer.Length);
postData.Close();
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
var serializer = new JavaScriptSerializer();
responseData = serializer.Deserialize<Dictionary<string, dynamic>>(reader.ReadToEnd());
reader.Close();
dataStream.Close();
}
return responseData;
}
}import groovy.json.JsonSlurper
public static String request() {
def data = "entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"¤cy=EUR" +
"&paymentBrand=VISA" +
"&paymentType=DB" +
"&card.number=4200000000000000" +
"&card.holder=Jane Jones" +
"&card.expiryMonth=05" +
"&card.expiryYear=2034" +
"&card.cvv=123"
def url = "https://sandbox-card.peachpayments.com/v1/payments".toURL()
def connection = url.openConnection()
connection.setRequestMethod("POST")
connection.setRequestProperty("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
connection.doOutput = true
connection.outputStream << data
def json = new JsonSlurper().parseText(connection.inputStream.text)
json
}
println request()import javax.net.ssl.HttpsURLConnection;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import org.apache.commons.io.IOUtils;
private String request() throws IOException {
URL url = new URL("https://sandbox-card.peachpayments.com/v1/payments");
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=");
conn.setDoInput(true);
conn.setDoOutput(true);
String data = "entityId=8a8294174e735d0c014e78cf26461790"
+ "&amount=92.00"
+ "¤cy=EUR"
+ "&paymentBrand=VISA"
+ "&paymentType=DB"
+ "&card.number=4200000000000000"
+ "&card.holder=Jane Jones"
+ "&card.expiryMonth=05"
+ "&card.expiryYear=2034"
+ "&card.cvv=123";
DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
wr.writeBytes(data);
wr.flush();
wr.close();
InputStream is = (conn.getResponseCode() >= 400) ? conn.getErrorStream() : conn.getInputStream();
return IOUtils.toString(is);
}const https = require('https');
const querystring = require('querystring');
const request = async () => {
const path = '/v1/payments';
const data = querystring.stringify({
'entityId': '8a8294174e735d0c014e78cf26461790',
'amount': '92.00',
'currency': 'EUR',
'paymentBrand': 'VISA',
'paymentType': 'DB',
'card.number': '4200000000000000',
'card.holder': 'Jane Jones',
'card.expiryMonth': '05',
'card.expiryYear': '2034',
'card.cvv': '123'
});
const options = {
port: 443,
host: 'sandbox-card.peachpayments.com',
path: path,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': data.length,
'Authorization': 'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ='
}
};
return new Promise((resolve, reject) => {
const postRequest = https.request(options, (res) => {
const buf = [];
res.on('data', (chunk) => buf.push(Buffer.from(chunk)));
res.on('end', () => {
try {
resolve(JSON.parse(Buffer.concat(buf).toString('utf8')));
} catch (error) {
reject(error);
}
});
});
postRequest.on('error', reject);
postRequest.write(data);
postRequest.end();
});
};
request().then(console.log).catch(console.error);function request() {
$url = "https://sandbox-card.peachpayments.com/v1/payments";
$data = "entityId=8a8294174e735d0c014e78cf26461790" .
"&amount=92.00" .
"¤cy=EUR" .
"&paymentBrand=VISA" .
"&paymentType=DB" .
"&card.number=4200000000000000" .
"&card.holder=Jane Jones" .
"&card.expiryMonth=05" .
"&card.expiryYear=2034" .
"&card.cvv=123";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ='
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Set to true in production
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$responseData = curl_exec($ch);
if (curl_errno($ch)) {
return curl_error($ch);
}
curl_close($ch);
return $responseData;
}
$responseData = request();try:
from urllib.parse import urlencode
from urllib.request import build_opener, Request, HTTPHandler
from urllib.error import HTTPError, URLError
except ImportError:
from urllib import urlencode
from urllib2 import build_opener, Request, HTTPHandler, HTTPError, URLError
import json
def request():
url = "https://sandbox-card.peachpayments.com/v1/payments"
data = {
'entityId': '8a8294174e735d0c014e78cf26461790',
'amount': '92.00',
'currency': 'EUR',
'paymentBrand': 'VISA',
'paymentType': 'DB',
'card.number': '4200000000000000',
'card.holder': 'Jane Jones',
'card.expiryMonth': '05',
'card.expiryYear': '2034',
'card.cvv': '123'
}
try:
opener = build_opener(HTTPHandler)
request = Request(url, data=urlencode(data).encode('utf-8'))
request.add_header('Authorization', 'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=')
request.get_method = lambda: 'POST'
response = opener.open(request)
return json.loads(response.read())
except HTTPError as e:
return json.loads(e.read())
except URLError as e:
return e.reason
responseData = request()
print(responseData)require 'net/https'
require 'uri'
require 'json'
def request()
uri = URI('https://sandbox-card.peachpayments.com/v1/payments')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
req = Net::HTTP::Post.new(uri.path)
req.set_form_data({
'entityId' => '8a8294174e735d0c014e78cf26461790',
'amount' => '92.00',
'currency' => 'EUR',
'paymentBrand' => 'VISA',
'paymentType' => 'DB',
'card.number' => '4200000000000000',
'card.holder' => 'Jane Jones',
'card.expiryMonth' => '05',
'card.expiryYear' => '2034',
'card.cvv' => '123'
})
res = http.request(req)
return JSON.parse(res.body)
end
puts request()def initialPayment: String = {
val url = "https://sandbox-card.peachpayments.com/v1/payments"
val data = ("" +
"entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"¤cy=EUR" +
"&paymentBrand=VISA" +
"&paymentType=DB" +
"&card.number=4200000000000000" +
"&card.holder=Jane Jones" +
"&card.expiryMonth=05" +
"&card.expiryYear=2034" +
"&card.cvv=123"
)
val conn = new URL(url).openConnection()
conn match {
case secureConn: HttpsURLConnection => secureConn.setRequestMethod("POST")
case _ => throw new ClassCastException
}
conn.setDoInput(true)
conn.setDoOutput(true)
IOUtils.write(data, conn.getOutputStream())
conn.setRequestProperty("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
conn.connect()
if (conn.getResponseCode() >= 400) {
IOUtils.toString(conn.getErrorStream())
} else {
IOUtils.toString(conn.getInputStream())
}
}Public Function Request() As Dictionary(Of String, Object)
Dim url As String = "https://sandbox-card.peachpayments.com/v1/payments"
Dim data As String = "" +
"entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"¤cy=EUR" +
"&paymentBrand=VISA" +
"&paymentType=DB" +
"&card.number=4200000000000000" +
"&card.holder=Jane Jones" +
"&card.expiryMonth=05" +
"&card.expiryYear=2034" +
"&card.cvv=123"
Dim req As WebRequest = WebRequest.Create(url)
req.Method = "POST"
req.Headers.Add("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
req.ContentType = "application/x-www-form-urlencoded"
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(data)
req.ContentLength = byteArray.Length
Dim dataStream As Stream = req.GetRequestStream()
dataStream.Write(byteArray, 0, byteArray.Length)
dataStream.Close()
Dim res As WebResponse = req.GetResponse()
Dim resStream As Stream = res.GetResponseStream()
Dim reader As New StreamReader(resStream)
Dim response As String = reader.ReadToEnd()
reader.Close()
resStream.Close()
res.Close()
Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer()
Dim dict As Dictionary(Of String, Object) = jss.Deserialize(Of Dictionary(Of String, Object))(response)
Return dict
End Function
responseData = Request()("result")("description"){
"id":"8ac7a4a29d21e3c1019d2621802c7bc6",
"paymentType":"PA",
"paymentBrand":"VISA",
"amount":"92.00",
"currency":"EUR",
"descriptor":"4582.6498.4100 MAC_Channel ",
"result":{
"code":"000.100.110",
"description":"Request successfully processed in 'Merchant in Integrator Test Mode'"
},
"resultDetails":{
"Payment Status":"CLO",
"ConnectorTxID1":"payment_55cd30eb3b5a499b3a3a2f5b6cf3f11a",
"Cvv Check":"unchecked",
"Transaction Status":"SUCCESS",
"ConnectorTxID3":"123456",
"Amount":"0.0",
"Operation Id":"64403c94-0978-4d5f-abd7-28a4e5d99556",
"Payment Method Category":"card",
"CardholderInitiatedTransactionID":"123456",
"ExtendedDescription":"Transaction succeeded",
"Customer Token":"cus_4d184daa989cac82224b856bac739b60",
"Paid Amount":"0.0",
"Payment Account Reference":"V001NPX3IQC6OFS2TAWCVD2WTXRWY",
"Sender Details":"{\"address\":\"null\",\"firstName\":\"null\",\"lastName\":\"null\",\"postcode\":\"null\",\"city\":\"AE\",\"state\":\"null\",\"country\":\"null\",\"companyName\":\"null\"}",
"AcquirerResponse":"SUCCESS",
"Beneficiary Details":"{\"firstName\":\"null\",\"lastName\":\"null\",\"address\":\"null\",\"dob\":\"null\",\"gender\":\"null\",\"email\":\"null\",\"state\":\"null\",\"cardNumber\":\"null\",\"cardExpirationMonth\":\"null\",\"cardExpirationYear\":\"null\",\"nationality\":\"null\",\"city\":\"NY\",\"postcode\":\"null\",\"identificationType\":\"null\",\"identificationValue\":\"null\"\"category\":\"null\"}",
"Statement Descriptor":"044153838562 Rapyd Nat"
},
"card":{
"bin":"420000",
"last4Digits":"0000",
"holder":"Jane Jones",
"expiryMonth":"05",
"expiryYear":"2034"
},
"customParameters":{
"PAYMENT_INHOUSE_FACADE":"true"
},
"risk":{
"score":"100"
},
"buildNumber":"9092e7a6af8301accda2f9a3a38f743f907dadd5@2026-03-23 16:50:06 +0000",
"timestamp":"2026-03-25 17:53:43+0000",
"ndc":"8a8294174e735d0c014e78cf26461790_6cf66bdce6854c7d9968cfb76224ef5a"
}2. Capture payment
Send a server-to-server POST request to complete the transaction. The system transfers the reserved funds from the customer to your account.
Sample request:
https://sandbox-card.peachpayments.com/v1/payments/8ac7a4a19d2f2c6e019d2fd17785277f
curl https://sandbox-card.peachpayments.com/v1/payments/{id} \
-d "entityId=8a8294174e735d0c014e78cf26461790" \
-d "amount=92.00" \
-d "paymentType=CP" \
-d "currency=EUR" \
-H "Authorization: Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ="public Dictionary<string, dynamic> Request() {
Dictionary<string, dynamic> responseData;
string data = "entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"&paymentType=CP" +
"¤cy=EUR";
string url = "https://sandbox-card.peachpayments.com/v1/payments/{id}";
byte[] buffer = Encoding.ASCII.GetBytes(data);
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
request.Method = "POST";
request.Headers["Authorization"] = "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=";
request.ContentType = "application/x-www-form-urlencoded";
Stream postData = request.GetRequestStream();
postData.Write(buffer, 0, buffer.Length);
postData.Close();
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
var s = new JavaScriptSerializer();
responseData = s.Deserialize<Dictionary<string, dynamic>>(reader.ReadToEnd());
reader.Close();
dataStream.Close();
}
return responseData;
}import groovy.json.JsonSlurper
public static String request() {
def data = "entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"&paymentType=CP" +
"¤cy=EUR"
def url = "https://sandbox-card.peachpayments.com/v1/payments/{id}".toURL()
def connection = url.openConnection()
connection.setRequestMethod("POST")
connection.setRequestProperty("Authorization","Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
connection.doOutput = true
connection.outputStream << data
def json = new JsonSlurper().parseText(connection.inputStream.text)
json
}
println request()private String request() throws IOException {
URL url = new URL("https://sandbox-card.peachpayments.com/v1/payments/{id}");
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=");
conn.setDoInput(true);
conn.setDoOutput(true);
String data = "entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"&paymentType=CP" +
"¤cy=EUR";
DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
wr.writeBytes(data);
wr.flush();
wr.close();
int responseCode = conn.getResponseCode();
InputStream is = responseCode >= 400 ? conn.getErrorStream() : conn.getInputStream();
return IOUtils.toString(is);
}const https = require('https');
const querystring = require('querystring');
const request = async () => {
const path='/v1/payments/{id}';
const data = querystring.stringify({
'entityId':'8a8294174e735d0c014e78cf26461790',
'amount':'92.00',
'paymentType':'CP',
'currency':'EUR'
});
const options = {
port: 443,
host: 'sandbox-card.peachpayments.com',
path: path,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': data.length,
'Authorization':'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ='
}
};
return new Promise((resolve, reject) => {
const postRequest = https.request(options, function(res) {
const buf = [];
res.on('data', chunk => buf.push(Buffer.from(chunk)));
res.on('end', () => {
const jsonString = Buffer.concat(buf).toString('utf8');
try {
resolve(JSON.parse(jsonString));
} catch (error) {
reject(error);
}
});
});
postRequest.on('error', reject);
postRequest.write(data);
postRequest.end();
});
};
request().then(console.log).catch(console.error);import json
from urllib.parse import urlencode
from urllib.request import build_opener, Request, HTTPHandler
from urllib.error import HTTPError, URLError
def request():
url = "https://sandbox-card.peachpayments.com/v1/payments/{id}"
data = {
'entityId': '8a8294174e735d0c014e78cf26461790',
'amount': '92.00',
'paymentType': 'CP',
'currency': 'EUR'
}
try:
opener = build_opener(HTTPHandler)
request = Request(url, data=urlencode(data).encode('utf-8'))
request.add_header('Authorization', 'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=')
request.get_method = lambda: 'POST'
response = opener.open(request)
return json.loads(response.read())
except HTTPError as e:
return json.loads(e.read())
except URLError as e:
return e.reason
responseData = request()
print(responseData)function request() {
$url = "https://sandbox-card.peachpayments.com/v1/payments/{id}";
$data = "entityId=8a8294174e735d0c014e78cf26461790" .
"&amount=92.00" .
"&paymentType=CP" .
"¤cy=EUR";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization:Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=']);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$responseData = curl_exec($ch);
curl_close($ch);
return $responseData;
}
$responseData = request();try:
from urllib.parse import urlencode
from urllib.request import build_opener, Request, HTTPHandler
from urllib.error import HTTPError, URLError
except ImportError:
from urllib import urlencode
from urllib2 import build_opener, Request, HTTPHandler, HTTPError, URLError
import json
def request():
url = "https://sandbox-card.peachpayments.com/v1/payments/{id}"
data = {
'entityId': '8a8294174e735d0c014e78cf26461790',
'amount': '92.00',
'paymentType': 'CP',
'currency': 'EUR'
}
try:
opener = build_opener(HTTPHandler)
request = Request(url, data=urlencode(data).encode('utf-8'))
request.add_header('Authorization', 'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=')
request.get_method = lambda: 'POST'
response = opener.open(request)
return json.loads(response.read())
except HTTPError as e:
return json.loads(e.read())
except URLError as e:
return e.reason
responseData = request()
print(responseData)require 'net/https'
require 'uri'
require 'json'
def request()
uri = URI('https://sandbox-card.peachpayments.com/v1/payments/{id}')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
req = Net::HTTP::Post.new(uri.path)
req.set_form_data({
'entityId' => '8a8294174e735d0c014e78cf26461790',
'amount' => '92.00',
'paymentType' => 'CP',
'currency' => 'EUR'
})
res = http.request(req)
JSON.parse(res.body)
end
puts request()def initialPayment: String = {
val url = "https://sandbox-card.peachpayments.com/v1/payments/{id}"
val data = (
"entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"&paymentType=CP" +
"¤cy=EUR"
)
val conn = new URL(url).openConnection()
conn match {
case secureConn: HttpsURLConnection => secureConn.setRequestMethod("POST")
case _ => throw new ClassCastException
}
conn.setDoInput(true)
conn.setDoOutput(true)
IOUtils.write(data, conn.getOutputStream())
conn.setRequestProperty("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
conn.connect()
if (conn.getResponseCode() >= 400) {
IOUtils.toString(conn.getErrorStream())
} else {
IOUtils.toString(conn.getInputStream())
}
}def initialPayment: String = {
val url = "https://sandbox-card.peachpayments.com/v1/payments/{id}"
val data = (
"entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"&paymentType=CP" +
"¤cy=EUR"
)
val conn = new URL(url).openConnection()
conn match {
case secureConn: HttpsURLConnection => secureConn.setRequestMethod("POST")
case _ => throw new ClassCastException
}
conn.setDoInput(true)
conn.setDoOutput(true)
IOUtils.write(data, conn.getOutputStream())
conn.setRequestProperty(
"Authorization",
"Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ="
)
conn.connect()
if (conn.getResponseCode() >= 400) {
IOUtils.toString(conn.getErrorStream())
} else {
IOUtils.toString(conn.getInputStream())
}
}{
"id":"8ac7a4a19d21da51019d2624735d21f5",
"referencedId":"8ac7a4a29d21e3c1019d2621802c7bc6",
"paymentType":"CP",
"amount":"92.00",
"currency":"EUR",
"descriptor":"4295.4000.2340 MAC_Channel",
"result":{
"code":"000.100.110",
"description":"Request successfully processed in 'Merchant in Integrator Test Mode'"
},
"resultDetails":{
"Payment Status":"CLO",
"ConnectorTxID1":"payment_55cd30eb3b5a499b3a3a2f5b6cf3f11a",
"Cvv Check":"unchecked",
"Transaction Status":"SUCCESS",
"ConnectorTxID3":"123456",
"Amount":"0.0",
"Operation Id":"64403c94-0978-4d5f-abd7-28a4e5d99556",
"Payment Method Category":"card",
"CardholderInitiatedTransactionID":"123456",
"ExtendedDescription":"Transaction succeeded",
"Customer Token":"cus_4d184daa989cac82224b856bac739b60",
"Paid Amount":"0.0",
"Payment Account Reference":"V001NPX3IQC6OFS2TAWCVD2WTXRWY",
"Sender Details":"{\"address\":\"null\",\"firstName\":\"null\",\"lastName\":\"null\",\"postcode\":\"null\",\"city\":\"AE\",\"state\":\"null\",\"country\":\"null\",\"companyName\":\"null\"}",
"AcquirerResponse":"SUCCESS",
"Beneficiary Details":"{\"firstName\":\"null\",\"lastName\":\"null\",\"address\":\"null\",\"dob\":\"null\",\"gender\":\"null\",\"email\":\"null\",\"state\":\"null\",\"cardNumber\":\"null\",\"cardExpirationMonth\":\"null\",\"cardExpirationYear\":\"null\",\"nationality\":\"null\",\"city\":\"NY\",\"postcode\":\"null\",\"identificationType\":\"null\",\"identificationValue\":\"null\"\"category\":\"null\"}",
"Statement Descriptor":"044153838562 Rapyd Nat"
},
"customParameters":{
"PAYMENT_INHOUSE_FACADE":"true"
},
"risk":{
"score":"0"
},
"buildNumber":"9092e7a6af8301accda2f9a3a38f743f907dadd5@2026-03-23 16:50:06 +0000",
"timestamp":"2026-03-25 17:56:56+0000",
"ndc":"8a8294174e735d0c014e78cf26461790_b2436176c37146d3b6a06e5ca1f504d3"
}3. Manage the payment
Send a back-office server-to-server POST request for further actions:
- Refund: Full or partial refund of a captured amount.
- Rebill: Charge the customer for extra products.
- Chargeback: Reflect a chargeback processed by the bank.
- Chargeback reversal: Reverse a chargeback.
Debit
1. Perform debit payment
Initiate a server-to-server POST request with the required payment data. The payment details are verified with the issuer, and the funds are captured. The response to a successful request is an ID that you should store and use in subsequent back-office operations.
curl https://sandbox-card.peachpayments.com/v1/payments \
-d "entityId=8a8294174e735d0c014e78cf26461790" \
-d "amount=92.00" \
-d "currency=EUR" \
-d "paymentBrand=VISA" \
-d "paymentType=DB" \
-d "card.number=4200000000000000" \
-d "card.holder=Jane Jones" \
-d "card.expiryMonth=05" \
-d "card.expiryYear=2034" \
-d "card.cvv=123" \
-H "Authorization: Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ="public Dictionary<string, dynamic> Request() {
Dictionary<string, dynamic> responseData;
string data="entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"¤cy=EUR" +
"&paymentBrand=VISA" +
"&paymentType=DB" +
"&card.number=4200000000000000" +
"&card.holder=Jane Jones" +
"&card.expiryMonth=05" +
"&card.expiryYear=2034" +
"&card.cvv=123";
string url = "https://sandbox-card.peachpayments.com/v1/payments";
byte[] buffer = Encoding.ASCII.GetBytes(data);
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
request.Method = "POST";
request.Headers["Authorization"] = "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=";
request.ContentType = "application/x-www-form-urlencoded";
Stream PostData = request.GetRequestStream();
PostData.Write(buffer, 0, buffer.Length);
PostData.Close();
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
var s = new JavaScriptSerializer();
responseData = s.Deserialize<Dictionary<string, dynamic>>(reader.ReadToEnd());
reader.Close();
dataStream.Close();
}
return responseData;
}
responseData = Request()["result"]["description"];import groovy.json.JsonSlurper
public static String request() {
def data = "entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"¤cy=EUR" +
"&paymentBrand=VISA" +
"&paymentType=DB" +
"&card.number=4200000000000000" +
"&card.holder=Jane Jones" +
"&card.expiryMonth=05" +
"&card.expiryYear=2034" +
"&card.cvv=123"
def url = "https://sandbox-card.peachpayments.com/v1/payments".toURL()
def connection = url.openConnection()
connection.setRequestMethod("POST")
connection.setRequestProperty("Authorization","Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
connection.doOutput = true
connection.outputStream << data
def json = new JsonSlurper().parseText(connection.inputStream.text)
json
}
println request()private String request() throws IOException {
URL url = new URL("https://sandbox-card.peachpayments.com/v1/payments");
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=");
conn.setDoInput(true);
conn.setDoOutput(true);
String data = ""
+ "entityId=8a8294174e735d0c014e78cf26461790"
+ "&amount=92.00"
+ "¤cy=EUR"
+ "&paymentBrand=VISA"
+ "&paymentType=DB"
+ "&card.number=4200000000000000"
+ "&card.holder=Jane Jones"
+ "&card.expiryMonth=05"
+ "&card.expiryYear=2034"
+ "&card.cvv=123";
DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
wr.writeBytes(data);
wr.flush();
wr.close();
int responseCode = conn.getResponseCode();
InputStream is;
if (responseCode >= 400) is = conn.getErrorStream();
else is = conn.getInputStream();
return IOUtils.toString(is);
}const https = require('https');
const querystring = require('querystring');
const request = async () => {
const path='/v1/payments';
const data = querystring.stringify({
'entityId':'8a8294174e735d0c014e78cf26461790',
'amount':'92.00',
'currency':'EUR',
'paymentBrand':'VISA',
'paymentType':'DB',
'card.number':'4200000000000000',
'card.holder':'Jane Jones',
'card.expiryMonth':'05',
'card.expiryYear':'2034',
'card.cvv':'123'
});
const options = {
port: 443,
host: 'sandbox-card.peachpayments.com',
path: path,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': data.length,
'Authorization':'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ='
}
};
return new Promise((resolve, reject) => {
const postRequest = https.request(options, function(res) {
const buf = [];
res.on('data', chunk => {
buf.push(Buffer.from(chunk));
});
res.on('end', () => {
const jsonString = Buffer.concat(buf).toString('utf8');
try {
resolve(JSON.parse(jsonString));
} catch (error) {
reject(error);
}
});
});
postRequest.on('error', reject);
postRequest.write(data);
postRequest.end();
});
};
request().then(console.log).catch(console.error);function request() {
$url = "https://sandbox-card.peachpayments.com/v1/payments";
$data = "entityId=8a8294174e735d0c014e78cf26461790" .
"&amount=92.00" .
"¤cy=EUR" .
"&paymentBrand=VISA" .
"&paymentType=DB" .
"&card.number=4200000000000000" .
"&card.holder=Jane Jones" .
"&card.expiryMonth=05" .
"&card.expiryYear=2034" .
"&card.cvv=123";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization:Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ='));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);// this should be set to true in production
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$responseData = curl_exec($ch);
if(curl_errno($ch)) {
return curl_error($ch);
}
curl_close($ch);
return $responseData;
}
$responseData = request();try:
from urllib.parse import urlencode
from urllib.request import build_opener, Request, HTTPHandler
from urllib.error import HTTPError, URLError
except ImportError:
from urllib import urlencode
from urllib2 import build_opener, Request, HTTPHandler, HTTPError, URLError
import json
def request():
url = "https://sandbox-card.peachpayments.com/v1/payments"
data = {
'entityId' : '8a8294174e735d0c014e78cf26461790',
'amount' : '92.00',
'currency' : 'EUR',
'paymentBrand' : 'VISA',
'paymentType' : 'DB',
'card.number' : '4200000000000000',
'card.holder' : 'Jane Jones',
'card.expiryMonth' : '05',
'card.expiryYear' : '2034',
'card.cvv' : '123'
}
try:
opener = build_opener(HTTPHandler)
request = Request(url, data=urlencode(data).encode('utf-8'))
request.add_header('Authorization', 'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=')
request.get_method = lambda: 'POST'
response = opener.open(request)
return json.loads(response.read())
except HTTPError as e:
return json.loads(e.read())
except URLError as e:
return e.reason
responseData = request()
print(responseData)require 'net/https'
require 'uri'
require 'json'
def request()
uri = URI('https://sandbox-card.peachpayments.com/v1/payments')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
req = Net::HTTP::Post.new(uri.path)
req.set_form_data({
'entityId' => '8a8294174e735d0c014e78cf26461790',
'amount' => '92.00',
'currency' => 'EUR',
'paymentBrand' => 'VISA',
'paymentType' => 'DB',
'card.number' => '4200000000000000',
'card.holder' => 'Jane Jones',
'card.expiryMonth' => '05',
'card.expiryYear' => '2034',
'card.cvv' => '123'
})
res = http.request(req)
return JSON.parse(res.body)
end
puts request()def initialPayment : String = {
val url = "https://sandbox-card.peachpayments.com/v1/payments"
val data = (""
+ "entityId=8a8294174e735d0c014e78cf26461790"
+ "&amount=92.00"
+ "¤cy=EUR"
+ "&paymentBrand=VISA"
+ "&paymentType=DB"
+ "&card.number=4200000000000000"
+ "&card.holder=Jane Jones"
+ "&card.expiryMonth=05"
+ "&card.expiryYear=2034"
+ "&card.cvv=123"
)
val conn = new URL(url).openConnection()
conn match {
case secureConn: HttpsURLConnection => secureConn.setRequestMethod("POST")
case _ => throw new ClassCastException
}
conn.setDoInput(true)
conn.setDoOutput(true)
IOUtils.write(data, conn.getOutputStream())
conn.setRequestProperty("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
conn.connect()
if (conn.getResponseCode() >= 400) {
return IOUtils.toString(conn.getErrorStream())
}
else {
return IOUtils.toString(conn.getInputStream())
}
}Public Function Request() As Dictionary(Of String, Object)
Dim url As String = "https://sandbox-card.peachpayments.com/v1/payments"
Dim data As String = "" +
"entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"¤cy=EUR" +
"&paymentBrand=VISA" +
"&paymentType=DB" +
"&card.number=4200000000000000" +
"&card.holder=Jane Jones" +
"&card.expiryMonth=05" +
"&card.expiryYear=2034" +
"&card.cvv=123"
Dim req As WebRequest = WebRequest.Create(url)
req.Method = "POST"
req.Headers.Add("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
req.ContentType = "application/x-www-form-urlencoded"
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(data)
req.ContentLength = byteArray.Length
Dim dataStream As Stream = req.GetRequestStream()
dataStream.Write(byteArray, 0, byteArray.Length)
dataStream.Close()
Dim res As WebResponse = req.GetResponse()
Dim resStream = res.GetResponseStream()
Dim reader As New StreamReader(resStream)
Dim response As String = reader.ReadToEnd()
reader.Close()
resStream.Close()
res.Close()
Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer()
Dim dict As Dictionary(Of String, Object) = jss.Deserialize(Of Dictionary(Of String, Object))(response)
Return dict
End Function
responseData = Request()("result")("description"){
"id":"8ac7a49f9d21da8e019d269763a7086d",
"paymentType":"DB",
"paymentBrand":"VISA",
"amount":"92.00",
"currency":"EUR",
"descriptor":"1091.6291.2292 MAC_Channel ",
"result":{
"code":"000.100.110",
"description":"Request successfully processed in 'Merchant in Integrator Test Mode'"
},
"resultDetails":{
"Payment Status":"CLO",
"ConnectorTxID1":"payment_55cd30eb3b5a499b3a3a2f5b6cf3f11a",
"Cvv Check":"unchecked",
"Transaction Status":"SUCCESS",
"ConnectorTxID3":"123456",
"Amount":"0.0",
"Operation Id":"64403c94-0978-4d5f-abd7-28a4e5d99556",
"Payment Method Category":"card",
"CardholderInitiatedTransactionID":"123456",
"ExtendedDescription":"Transaction succeeded",
"Customer Token":"cus_4d184daa989cac82224b856bac739b60",
"Paid Amount":"0.0",
"Payment Account Reference":"V001NPX3IQC6OFS2TAWCVD2WTXRWY",
"Sender Details":"{\"address\":\"null\",\"firstName\":\"null\",\"lastName\":\"null\",\"postcode\":\"null\",\"city\":\"AE\",\"state\":\"null\",\"country\":\"null\",\"companyName\":\"null\"}",
"AcquirerResponse":"SUCCESS",
"Beneficiary Details":"{\"firstName\":\"null\",\"lastName\":\"null\",\"address\":\"null\",\"dob\":\"null\",\"gender\":\"null\",\"email\":\"null\",\"state\":\"null\",\"cardNumber\":\"null\",\"cardExpirationMonth\":\"null\",\"cardExpirationYear\":\"null\",\"nationality\":\"null\",\"city\":\"NY\",\"postcode\":\"null\",\"identificationType\":\"null\",\"identificationValue\":\"null\"\"category\":\"null\"}",
"Statement Descriptor":"044153838562 Rapyd Nat"
},
"card":{
"bin":"420000",
"last4Digits":"0000",
"holder":"Jane Jones",
"expiryMonth":"05",
"expiryYear":"2034"
},
"customParameters":{
"PAYMENT_INHOUSE_FACADE":"true"
},
"risk":{
"score":"100"
},
"buildNumber":"9092e7a6af8301accda2f9a3a38f743f907dadd5@2026-03-23 16:50:06 +0000",
"timestamp":"2026-03-25 20:02:29+0000",
"ndc":"8a8294174e735d0c014e78cf26461790_7ca74c941062431f9410277becf72b4f"
}2. Manage the payment
Send a back-office server-to-server POST request over the debit to:
- Refund: Full or partial refund of a captured amount.
- Rebill: Charge the customer for extra products.
- Chargeback: Reflect a chargeback processed by the bank.
- Chargeback reversal: Reverse a chargeback.
Asynchronous payment
Pre-authorisation and capture
Collect card data from the customer and initiate the asynchronous payment flow.
1. Pre-authorise payment
Start a server-to-server POST request with the required payment data and the URL-encoded shopperResultUrl. The system verifies the payment details with the issuer and reserves the funds. A successful request returns an id that you should store and use for subsequent back-office operations.
Sample request:
curl https://sandbox-card.peachpayments.com/v1/payments \
-d "entityId=8a8294174e735d0c014e78cf26461790" \
-d "amount=92.00" \
-d "currency=EUR" \
-d "paymentBrand=VISA" \
-d "paymentType=PA" \
-d "card.number=4200000000000000" \
-d "card.holder=Jane Jones" \
-d "card.expiryMonth=05" \
-d "card.expiryYear=2034" \
-d "card.cvv=123" \
-d "customParameters[3DS2_enrolled]=true" \
-d "customParameters[3DS2_flow]=challenge" \
-d "shopperResultUrl=https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server" \
-H "Authorization: Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ="public Dictionary<string, dynamic> Request() {
Dictionary<string, dynamic> responseData;
string data="entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"¤cy=EUR" +
"&paymentBrand=VISA" +
"&paymentType=PA" +
"&card.number=4200000000000000" +
"&card.holder=Jane Jones" +
"&card.expiryMonth=05" +
"&card.expiryYear=2034" +
"&card.cvv=123" +
"&customParameters[3DS2_enrolled]=true" +
"&customParameters[3DS2_flow]=challenge" +
"&shopperResultUrl=https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server";
string url = "https://sandbox-card.peachpayments.com/v1/payments";
byte[] buffer = Encoding.ASCII.GetBytes(data);
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
request.Method = "POST";
request.Headers["Authorization"] = "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=";
request.ContentType = "application/x-www-form-urlencoded";
Stream PostData = request.GetRequestStream();
PostData.Write(buffer, 0, buffer.Length);
PostData.Close();
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
var s = new JavaScriptSerializer();
responseData = s.Deserialize<Dictionary<string, dynamic>>(reader.ReadToEnd());
reader.Close();
dataStream.Close();
}
return responseData;
}
responseData = Request()["result"]["description"];import groovy.json.JsonSlurper
public static String request() {
def data = "entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"¤cy=EUR" +
"&paymentBrand=VISA" +
"&paymentType=PA" +
"&card.number=4200000000000000" +
"&card.holder=Jane Jones" +
"&card.expiryMonth=05" +
"&card.expiryYear=2034" +
"&card.cvv=123" +
"&customParameters[3DS2_enrolled]=true" +
"&customParameters[3DS2_flow]=challenge" +
"&shopperResultUrl=https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server"
def url = "https://sandbox-card.peachpayments.com/v1/payments".toURL()
def connection = url.openConnection()
connection.setRequestMethod("POST")
connection.setRequestProperty("Authorization","Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
connection.doOutput = true
connection.outputStream << data
def json = new JsonSlurper().parseText(connection.inputStream.text)
json
}
println request()private String request() throws IOException {
URL url = new URL("https://sandbox-card.peachpayments.com/v1/payments");
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=");
conn.setDoInput(true);
conn.setDoOutput(true);
String data = ""
+ "entityId=8a8294174e735d0c014e78cf26461790"
+ "&amount=92.00"
+ "¤cy=EUR"
+ "&paymentBrand=VISA"
+ "&paymentType=PA"
+ "&card.number=4200000000000000"
+ "&card.holder=Jane Jones"
+ "&card.expiryMonth=05"
+ "&card.expiryYear=2034"
+ "&card.cvv=123"
+ "&customParameters[3DS2_enrolled]=true"
+ "&customParameters[3DS2_flow]=challenge"
+ "&shopperResultUrl=https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server";
DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
wr.writeBytes(data);
wr.flush();
wr.close();
int responseCode = conn.getResponseCode();
InputStream is;
if (responseCode >= 400) is = conn.getErrorStream();
else is = conn.getInputStream();
return IOUtils.toString(is);
}const https = require('https');
const querystring = require('querystring');
const request = async () => {
const path='/v1/payments';
const data = querystring.stringify({
'entityId':'8a8294174e735d0c014e78cf26461790',
'amount':'92.00',
'currency':'ZAR',
'paymentBrand':'VISA',
'paymentType':'PA',
'card.number':'4200000000000000',
'card.holder':'Jane Jones',
'card.expiryMonth':'05',
'card.expiryYear':'2034',
'card.cvv':'123',
'customParameters[3DS2_enrolled]':'true',
'customParameters[3DS2_flow]':'challenge',
'shopperResultUrl':'https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server'
});
const options = {
port: 443,
host: 'sandbox-card.peachpayments.com',
path: path,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': data.length,
'Authorization':'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ='
}
};
return new Promise((resolve, reject) => {
const postRequest = https.request(options, function(res) {
const buf = [];
res.on('data', chunk => {
buf.push(Buffer.from(chunk));
});
res.on('end', () => {
const jsonString = Buffer.concat(buf).toString('utf8');
try {
resolve(JSON.parse(jsonString));
} catch (error) {
reject(error);
}
});
});
postRequest.on('error', reject);
postRequest.write(data);
postRequest.end();
});
};
request().then(console.log).catch(console.error);function request() {
$url = "https://sandbox-card.peachpayments.com/v1/payments";
$data = "entityId=8a8294174e735d0c014e78cf26461790" .
"&amount=92.00" .
"¤cy=EUR" .
"&paymentBrand=VISA" .
"&paymentType=PA" .
"&card.number=4200000000000000" .
"&card.holder=Jane Jones" .
"&card.expiryMonth=05" .
"&card.expiryYear=2034" .
"&card.cvv=123" .
"&customParameters[3DS2_enrolled]=true" .
"&customParameters[3DS2_flow]=challenge" .
"&shopperResultUrl=https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization:Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ='));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);// this should be set to true in production
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$responseData = curl_exec($ch);
if(curl_errno($ch)) {
return curl_error($ch);
}
curl_close($ch);
return $responseData;
}
$responseData = request();try:
from urllib.parse import urlencode
from urllib.request import build_opener, Request, HTTPHandler
from urllib.error import HTTPError, URLError
except ImportError:
from urllib import urlencode
from urllib2 import build_opener, Request, HTTPHandler, HTTPError, URLError
import json
def request():
url = "https://sandbox-card.peachpayments.com/v1/payments"
data = {
'entityId' : '8a8294174e735d0c014e78cf26461790',
'amount' : '92.00',
'currency' : 'ZAR',
'paymentBrand' : 'VISA',
'paymentType' : 'PA',
'card.number' : '4200000000000000',
'card.holder' : 'Jane Jones',
'card.expiryMonth' : '05',
'card.expiryYear' : '2034',
'card.cvv' : '123',
'customParameters[3DS2_enrolled]' : 'true',
'customParameters[3DS2_flow]' : 'challenge',
'shopperResultUrl' : 'https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server'
}
try:
opener = build_opener(HTTPHandler)
request = Request(url, data=urlencode(data).encode('utf-8'))
request.add_header('Authorization', 'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=')
request.get_method = lambda: 'POST'
response = opener.open(request)
return json.loads(response.read());
except HTTPError as e:
return json.loads(e.read());
except URLError as e:
return e.reason;
responseData = request();
print(responseData);require 'net/https'
require 'uri'
require 'json'
def request()
uri = URI('https://sandbox-card.peachpayments.com/v1/payments')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
req = Net::HTTP::Post.new(uri.path)
req.set_form_data({
'entityId' => '8a8294174e735d0c014e78cf26461790',
'amount' => '92.00',
'currency' => 'ZAR',
'paymentBrand' => 'VISA',
'paymentType' => 'PA',
'card.number' => '4200000000000000',
'card.holder' => 'Jane Jones',
'card.expiryMonth' => '05',
'card.expiryYear' => '2034',
'card.cvv' => '123',
'customParameters[3DS2_enrolled]' => 'true',
'customParameters[3DS2_flow]' => 'challenge',
'shopperResultUrl' => 'https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server'
})
res = http.request(req)
return JSON.parse(res.body)
end
puts request()def initialPayment : String = {
val url = "https://sandbox-card.peachpayments.com/v1/payments"
val data = (""
+ "entityId=8a8294174e735d0c014e78cf26461790"
+ "&amount=92.00"
+ "¤cy=EUR"
+ "&paymentBrand=VISA"
+ "&paymentType=PA"
+ "&card.number=4200000000000000"
+ "&card.holder=Jane Jones"
+ "&card.expiryMonth=05"
+ "&card.expiryYear=2034"
+ "&card.cvv=123"
+ "&customParameters[3DS2_enrolled]=true"
+ "&customParameters[3DS2_flow]=challenge"
+ "&shopperResultUrl=https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server"
)
val conn = new URL(url).openConnection()
conn match {
case secureConn: HttpsURLConnection => secureConn.setRequestMethod("POST")
case _ => throw new ClassCastException
}
conn.setDoInput(true)
conn.setDoOutput(true)
IOUtils.write(data, conn.getOutputStream())
conn.setRequestProperty("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
conn.connect()
if (conn.getResponseCode() >= 400) {
return IOUtils.toString(conn.getErrorStream())
}
else {
return IOUtils.toString(conn.getInputStream())
}
}Public Function Request() As Dictionary(Of String, Object)
Dim url As String = "https://sandbox-card.peachpayments.com/v1/payments"
Dim data As String = "" +
"entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"¤cy=EUR" +
"&paymentBrand=VISA" +
"&paymentType=PA" +
"&card.number=4200000000000000" +
"&card.holder=Jane Jones" +
"&card.expiryMonth=05" +
"&card.expiryYear=2034" +
"&card.cvv=123" +
"&customParameters[3DS2_enrolled]=true" +
"&customParameters[3DS2_flow]=challenge" +
"&shopperResultUrl=https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server"
Dim req As WebRequest = WebRequest.Create(url)
req.Method = "POST"
req.Headers.Add("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
req.ContentType = "application/x-www-form-urlencoded"
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(data)
req.ContentLength = byteArray.Length
Dim dataStream As Stream = req.GetRequestStream()
dataStream.Write(byteArray, 0, byteArray.Length)
dataStream.Close()
Dim res As WebResponse = req.GetResponse()
Dim resStream = res.GetResponseStream()
Dim reader As New StreamReader(resStream)
Dim response As String = reader.ReadToEnd()
reader.Close()
resStream.Close()
res.Close()
Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer()
Dim dict As Dictionary(Of String, Object) = jss.Deserialize(Of Dictionary(Of String, Object))(response)
Return dict
End Function
responseData = Request()("result")("description"){
"id":"8ac7a4a29d21e3c1019d26a8952111ac",
"paymentType":"PA",
"paymentBrand":"VISA",
"amount":"92.00",
"currency":"EUR",
"descriptor":"8550.0895.9012 MAC_Channel ",
"result":{
"code":"000.100.110",
"description":"Request successfully processed in 'Merchant in Integrator Test Mode'"
},
"resultDetails":{
"Payment Status":"CLO",
"ConnectorTxID1":"payment_55cd30eb3b5a499b3a3a2f5b6cf3f11a",
"Cvv Check":"unchecked",
"Transaction Status":"SUCCESS",
"ConnectorTxID3":"123456",
"Amount":"0.0",
"Operation Id":"64403c94-0978-4d5f-abd7-28a4e5d99556",
"Payment Method Category":"card",
"CardholderInitiatedTransactionID":"123456",
"ExtendedDescription":"Transaction succeeded",
"Customer Token":"cus_4d184daa989cac82224b856bac739b60",
"Paid Amount":"0.0",
"Payment Account Reference":"V001NPX3IQC6OFS2TAWCVD2WTXRWY",
"Sender Details":"{\"address\":\"null\",\"firstName\":\"null\",\"lastName\":\"null\",\"postcode\":\"null\",\"city\":\"AE\",\"state\":\"null\",\"country\":\"null\",\"companyName\":\"null\"}",
"AcquirerResponse":"SUCCESS",
"Beneficiary Details":"{\"firstName\":\"null\",\"lastName\":\"null\",\"address\":\"null\",\"dob\":\"null\",\"gender\":\"null\",\"email\":\"null\",\"state\":\"null\",\"cardNumber\":\"null\",\"cardExpirationMonth\":\"null\",\"cardExpirationYear\":\"null\",\"nationality\":\"null\",\"city\":\"NY\",\"postcode\":\"null\",\"identificationType\":\"null\",\"identificationValue\":\"null\"\"category\":\"null\"}",
"Statement Descriptor":"044153838562 Rapyd Nat"
},
"card":{
"bin":"420000",
"last4Digits":"0000",
"holder":"Jane Jones",
"expiryMonth":"05",
"expiryYear":"2034"
},
"customParameters":{
"3DS2_enrolled":"true",
"3DS2_flow":"challenge",
"PAYMENT_INHOUSE_FACADE":"true"
},
"risk":{
"score":"100"
},
"buildNumber":"9092e7a6af8301accda2f9a3a38f743f907dadd5@2026-03-23 16:50:06 +0000",
"timestamp":"2026-03-25 20:21:15+0000",
"ndc":"8a8294174e735d0c014e78cf26461790_c26c90a7e68845dc929dd7869b2228cc"
}2. Redirect shopper
Begin a server-to-server request to guide the account holder through validation and payment completion.
Interpret the JSON redirect
Extract the redirect information from the response of the initial authorisation payment.
| Parameter | Description |
|---|---|
url | The HTTPS URL of redirection (used as the form's action attribute). |
method | The form submission method (defaults to HTTPS POST). |
parameters | Appended to the URL of HTTPS GET or included in the body for HTTPS POST. |
Redirect response parameters
Use these parameters with an HTML form to perform the shopper's redirect.
<form action="{redirectUrl}" class="paymentWidgets">
<input type="text" name="{name-1}" value="{value-1}">
<input type="text" name="{name-2}" value="{value-2}">
</form>3. Get the payment status
After processing the payment request, the system redirects the customer to shopperResultUrl with a GET parameter resourcePath: /v1/payments/{id}
Sample request:
https://sandbox-card.peachpayments.com/v1/payments/8ac7a4a29d21e3c1019d26a8952111ac
curl -G https://sandbox-card.peachpayments.com/v1/payments/{id} \
-d "entityId=8a8294174e735d0c014e78cf26461790" \
-H "Authorization: Bearer OGE4Mjk0MTc0ZTc.....Pz9OWVQ="public Dictionary<string, dynamic> Request() {
Dictionary<string, dynamic> responseData;
string data = "entityId=8a8294174e735d0c014e78cf26461790";
string url = "https://sandbox-card.peachpayments.com/v1/payments/{id}?" + data;
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
request.Method = "GET";
request.Headers["Authorization"] = "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=";
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
var s = new JavaScriptSerializer();
responseData = s.Deserialize<Dictionary<string, dynamic>>(reader.ReadToEnd());
reader.Close();
dataStream.Close();
}
return responseData;
}
responseData = Request()["result"]["description"];import groovy.json.JsonSlurper
public static String request() {
def data = "entityId=8a8294174e735d0c014e78cf26461790"
def url = ("https://sandbox-card.peachpayments.com/v1/payments/{id}?" + data).toURL()
def connection = url.openConnection()
connection.setRequestMethod("GET")
connection.setRequestProperty("Authorization",
"Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
def json = new JsonSlurper().parseText(connection.inputStream.text)
json
}
println request()private String request() throws IOException {
URL url = new URL("https://sandbox-card.peachpayments.com/v1/payments/{id}?entityId=8a8294174e735d0c014e78cf26461790");
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Authorization",
"Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=");
int responseCode = conn.getResponseCode();
InputStream is;
if (responseCode >= 400) is = conn.getErrorStream();
else is = conn.getInputStream();
return IOUtils.toString(is);
}const https = require('https');
const querystring = require('querystring');
const request = async () => {
var path = '/v1/payments/{id}';
path += '?entityId=8a8294174e735d0c014e78cf26461790';
const options = {
port: 443,
host: 'sandbox-card.peachpayments.com',
path: path,
method: 'GET',
headers: {
'Authorization': 'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ='
}
};
return new Promise((resolve, reject) => {
const postRequest = https.request(options, function(res) {
const buf = [];
res.on('data', chunk => {
buf.push(Buffer.from(chunk));
});
res.on('end', () => {
const jsonString = Buffer.concat(buf).toString('utf8');
try {
resolve(JSON.parse(jsonString));
} catch (error) {
reject(error);
}
});
});
postRequest.on('error', reject);
postRequest.end();
});
};
request().then(console.log).catch(console.error);function request() {
$url = "https://sandbox-card.peachpayments.com/v1/payments/{id}";
$url .= "?entityId=8a8294174e735d0c014e78cf26461790";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization:Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ='
));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // this should be set to true in production
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$responseData = curl_exec($ch);
if (curl_errno($ch)) {
return curl_error($ch);
}
curl_close($ch);
return $responseData;
}
$responseData = request();try:
from urllib.parse import urlencode
from urllib.request import build_opener, Request, HTTPHandler
from urllib.error import HTTPError, URLError
except ImportError:
from urllib import urlencode
from urllib2 import build_opener, Request, HTTPHandler, HTTPError, URLError
import json
def request():
url = "https://sandbox-card.peachpayments.com/v1/payments/{id}"
url += '?entityId=8a8294174e735d0c014e78cf26461790'
try:
opener = build_opener(HTTPHandler)
request = Request(url, data=b'')
request.add_header('Authorization',
'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=')
request.get_method = lambda: 'GET'
response = opener.open(request)
return json.loads(response.read())
except HTTPError as e:
return json.loads(e.read())
except URLError as e:
return e.reason
responseData = request()
print(responseData)require 'net/https'
require 'uri'
require 'json'
def request()
path = "?entityId=8a8294174e735d0c014e78cf26461790"
uri = URI.parse('https://sandbox-card.peachpayments.com/v1/payments/{id}' + path)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ='
res = http.request(req)
return JSON.parse(res.body)
end
puts request()def initialPayment: String = {
val url = "https://sandbox-card.peachpayments.com/v1/payments/{id}"
val fullUrl = url + "?entityId=8a8294174e735d0c014e78cf26461790"
val conn = new URL(fullUrl).openConnection()
conn match {
case secureConn: HttpsURLConnection => secureConn.setRequestMethod("GET")
case _ => throw new ClassCastException
}
conn.setRequestProperty("Authorization",
"Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
conn.connect()
if (conn.getResponseCode() >= 400) {
IOUtils.toString(conn.getErrorStream())
} else {
IOUtils.toString(conn.getInputStream())
}
}Public Function Request() As Dictionary(Of String, Object)
Dim url As String = "https://sandbox-card.peachpayments.com/v1/payments/{id}" +
"?entityId=8a8294174e735d0c014e78cf26461790"
Dim req As WebRequest = WebRequest.Create(url)
req.Method = "GET"
req.Headers.Add("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
req.ContentType = "application/x-www-form-urlencoded"
Dim res As WebResponse = req.GetResponse()
Dim resStream = res.GetResponseStream()
Dim reader As New StreamReader(resStream)
Dim response As String = reader.ReadToEnd()
reader.Close()
resStream.Close()
res.Close()
Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer()
Dim dict As Dictionary(Of String, Object) = jss.Deserialize(Of Dictionary(Of String, Object))(response)
Return dict
End Function
responseData = Request()("result")("description"){
"id":"8ac7a4a29d21e3c1019d26a8952111ac",
"paymentType":"PA",
"paymentBrand":"VISA",
"amount":"92.00",
"currency":"EUR",
"descriptor":"8550.0895.9012 MAC_Channel",
"result":{
"code":"000.100.110",
"description":"Request successfully processed in 'Merchant in Integrator Test Mode'"
},
"resultDetails":{
"Payment Status":"CLO",
"Cvv Check":"unchecked",
"ConnectorTxID1":"payment_55cd30eb3b5a499b3a3a2f5b6cf3f11a",
"Transaction Status":"SUCCESS",
"ConnectorTxID3":"123456",
"Amount":"0.0",
"Operation Id":"64403c94-0978-4d5f-abd7-28a4e5d99556",
"Payment Method Category":"card",
"CardholderInitiatedTransactionID":"123456",
"ExtendedDescription":"Transaction succeeded",
"Customer Token":"cus_4d184daa989cac82224b856bac739b60",
"Paid Amount":"0.0",
"Sender Details":"{\"address\":\"null\",\"firstName\":\"null\",\"lastName\":\"null\",\"postcode\":\"null\",\"city\":\"AE\",\"state\":\"null\",\"country\":\"null\",\"companyName\":\"null\"}",
"Payment Account Reference":"V001NPX3IQC6OFS2TAWCVD2WTXRWY",
"AcquirerResponse":"SUCCESS",
"Beneficiary Details":"{\"firstName\":\"null\",\"lastName\":\"null\",\"address\":\"null\",\"dob\":\"null\",\"gender\":\"null\",\"email\":\"null\",\"state\":\"null\",\"cardNumber\":\"null\",\"cardExpirationMonth\":\"null\",\"cardExpirationYear\":\"null\",\"nationality\":\"null\",\"city\":\"NY\",\"postcode\":\"null\",\"identificationType\":\"null\",\"identificationValue\":\"null\"\"category\":\"null\"}",
"Statement Descriptor":"044153838562 Rapyd Nat"
},
"card":{
"bin":"420000",
"binCountry":"US",
"last4Digits":"0000",
"holder":"Jane Jones",
"expiryMonth":"05",
"expiryYear":"2034"
},
"customParameters":{
"CTPE_DESCRIPTOR_TEMPLATE":"",
"3DS2_flow":"challenge",
"PAYMENT_INHOUSE_FACADE":"true",
"3DS2_enrolled":"true"
},
"risk":{
"score":"100"
},
"buildNumber":"9092e7a6af8301accda2f9a3a38f743f907dadd5@2026-03-23 16:50:06 +0000",
"timestamp":"2026-03-25 20:21:15+0000",
"ndc":"8a8294174e735d0c014e78cf26461790_6f5d682077a1497bbd06253018d5c553"
}
- You can make two payment status requests per minute per transaction.
- The query endpoint provides payment status without such restrictions.
4. Capture the payment
Start a server-to-server POST request over the pre-authorised payment. The system transfers the reserved funds from the customer's account to your account.
Sample request:
https://sandbox-card.peachpayments.com/v1/payments/8ac7a4a29d21e3c1019d26a8952111ac
curl https://sandbox-card.peachpayments.com/v1/payments/{id} \
-d "entityId=8a8294174e735d0c014e78cf26461790" \
-d "amount=1220" \
-d "paymentType=CP" \
-d "currency=USD" \
-H "Authorization: Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ="public Dictionary<string, dynamic> Request() {
Dictionary<string, dynamic> responseData;
string data = "entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=1220" +
"&paymentType=CP" +
"¤cy=USD";
string url = "https://sandbox-card.peachpayments.com/v1/payments/{id}";
byte[] buffer = Encoding.ASCII.GetBytes(data);
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
request.Method = "POST";
request.Headers["Authorization"] = "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=";
request.ContentType = "application/x-www-form-urlencoded";
Stream postData = request.GetRequestStream();
postData.Write(buffer, 0, buffer.Length);
postData.Close();
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
var s = new JavaScriptSerializer();
responseData = s.Deserialize<Dictionary<string, dynamic>>(reader.ReadToEnd());
reader.Close();
dataStream.Close();
}
return responseData;
}
responseData = Request()["result"]["description"];import groovy.json.JsonSlurper
public static String request() {
def data = "entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=1220" +
"&paymentType=CP" +
"¤cy=USD"
def url = "https://sandbox-card.peachpayments.com/v1/payments/{id}".toURL()
def connection = url.openConnection()
connection.setRequestMethod("POST")
connection.setRequestProperty("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
connection.doOutput = true
connection.outputStream << data
def json = new JsonSlurper().parseText(connection.inputStream.text)
json
}
println request()private String request() throws IOException {
URL url = new URL("https://sandbox-card.peachpayments.com/v1/payments/{id}");
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=");
conn.setDoInput(true);
conn.setDoOutput(true);
String data = ""
+ "entityId=8a8294174e735d0c014e78cf26461790"
+ "&amount=1220"
+ "&paymentType=CP"
+ "¤cy=USD";
DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
wr.writeBytes(data);
wr.flush();
wr.close();
int responseCode = conn.getResponseCode();
InputStream is;
if (responseCode >= 400) {
is = conn.getErrorStream();
} else {
is = conn.getInputStream();
}
return IOUtils.toString(is);
}const https = require('https');
const querystring = require('querystring');
const request = async () => {
const path = '/v1/payments/{id}';
const data = querystring.stringify({
'entityId': '8a8294174e735d0c014e78cf26461790',
'amount': '1220',
'paymentType': 'CP',
'currency': 'USD'
});
const options = {
port: 443,
host: 'sandbox-card.peachpayments.com',
path: path,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': data.length,
'Authorization': 'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ='
}
};
return new Promise((resolve, reject) => {
const postRequest = https.request(options, (res) => {
const buf = [];
res.on('data', (chunk) => {
buf.push(Buffer.from(chunk));
});
res.on('end', () => {
const jsonString = Buffer.concat(buf).toString('utf8');
try {
resolve(JSON.parse(jsonString));
} catch (error) {
reject(error);
}
});
});
postRequest.on('error', reject);
postRequest.write(data);
postRequest.end();
});
};
request()
.then(console.log)
.catch(console.error);function request() {
$url = "https://sandbox-card.peachpayments.com/v1/payments/{id}";
$data = http_build_query([
"entityId" => "8a8294174e735d0c014e78cf26461790",
"amount" => "1220",
"paymentType" => "CP",
"currency" => "USD"
]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=',
'Content-Type: application/x-www-form-urlencoded'
]);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Set to true in production
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$responseData = curl_exec($ch);
if (curl_errno($ch)) {
return curl_error($ch);
}
curl_close($ch);
return $responseData;
}
$responseData = request();
echo $responseData;try:
from urllib.parse import urlencode
from urllib.request import build_opener, Request, HTTPHandler
from urllib.error import HTTPError, URLError
except ImportError:
from urllib import urlencode
from urllib2 import build_opener, Request, HTTPHandler, HTTPError, URLError
import json
def request():
url = "https://sandbox-card.peachpayments.com/v1/payments/{id}"
data = {
'entityId': '8a8294174e735d0c014e78cf26461790',
'amount': '1220',
'paymentType': 'CP',
'currency': 'USD'
}
try:
opener = build_opener(HTTPHandler)
request = Request(url, data=urlencode(data).encode('utf-8'))
request.add_header('Authorization', 'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=')
request.get_method = lambda: 'POST'
response = opener.open(request)
return json.loads(response.read())
except HTTPError as e:
return json.loads(e.read())
except URLError as e:
return e.reason
responseData = request()
print(responseData)require 'net/https'
require 'uri'
require 'json'
def request()
uri = URI('https://sandbox-card.peachpayments.com/v1/payments/{id}')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
req = Net::HTTP::Post.new(uri.path)
req.set_form_data({
'entityId' => '8a8294174e735d0c014e78cf26461790',
'amount' => '1220',
'paymentType' => 'CP',
'currency' => 'USD'
})
res = http.request(req)
return JSON.parse(res.body)
end
puts request()def initialPayment: String = {
val url = "https://sandbox-card.peachpayments.com/v1/payments/{id}"
val data = (
"entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=1220" +
"&paymentType=CP" +
"¤cy=USD"
)
val conn = new URL(url).openConnection()
conn match {
case secureConn: HttpsURLConnection => secureConn.setRequestMethod("POST")
case _ => throw new ClassCastException
}
conn.setDoInput(true)
conn.setDoOutput(true)
IOUtils.write(data, conn.getOutputStream())
conn.setRequestProperty("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
conn.connect()
if (conn.getResponseCode() >= 400) {
return IOUtils.toString(conn.getErrorStream())
} else {
return IOUtils.toString(conn.getInputStream())
}
}Public Function Request() As Dictionary(Of String, Object)
Dim url As String = "https://sandbox-card.peachpayments.com/v1/payments/{id}"
Dim data As String = "" +
"entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=1220" +
"&paymentType=CP" +
"¤cy=USD"
Dim req As WebRequest = WebRequest.Create(url)
req.Method = "POST"
req.Headers.Add("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
req.ContentType = "application/x-www-form-urlencoded"
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(data)
req.ContentLength = byteArray.Length
Dim dataStream As Stream = req.GetRequestStream()
dataStream.Write(byteArray, 0, byteArray.Length)
dataStream.Close()
Dim res As WebResponse = req.GetResponse()
Dim resStream As Stream = res.GetResponseStream()
Dim reader As New StreamReader(resStream)
Dim response As String = reader.ReadToEnd()
reader.Close()
resStream.Close()
res.Close()
Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer()
Dim dict As Dictionary(Of String, Object) = jss.Deserialize(Of Dictionary(Of String, Object))(response)
Return dict
End Function
responseData = Request()("result")("description"){
"id":"8ac7a4a19d21da51019d26aecabb3cb1",
"referencedId":"8ac7a4a29d21e3c1019d26a8952111ac",
"paymentType":"CP",
"amount":"92.00",
"currency":"EUR",
"descriptor":"8219.9574.1732 MAC_Channel",
"result":{
"code":"000.100.110",
"description":"Request successfully processed in 'Merchant in Integrator Test Mode'"
},
"resultDetails":{
"Payment Status":"CLO",
"ConnectorTxID1":"payment_55cd30eb3b5a499b3a3a2f5b6cf3f11a",
"Cvv Check":"unchecked",
"Transaction Status":"SUCCESS",
"ConnectorTxID3":"123456",
"Amount":"0.0",
"Operation Id":"64403c94-0978-4d5f-abd7-28a4e5d99556",
"Payment Method Category":"card",
"CardholderInitiatedTransactionID":"123456",
"ExtendedDescription":"Transaction succeeded",
"Customer Token":"cus_4d184daa989cac82224b856bac739b60",
"Paid Amount":"0.0",
"Payment Account Reference":"V001NPX3IQC6OFS2TAWCVD2WTXRWY",
"Sender Details":"{\"address\":\"null\",\"firstName\":\"null\",\"lastName\":\"null\",\"postcode\":\"null\",\"city\":\"AE\",\"state\":\"null\",\"country\":\"null\",\"companyName\":\"null\"}",
"AcquirerResponse":"SUCCESS",
"Beneficiary Details":"{\"firstName\":\"null\",\"lastName\":\"null\",\"address\":\"null\",\"dob\":\"null\",\"gender\":\"null\",\"email\":\"null\",\"state\":\"null\",\"cardNumber\":\"null\",\"cardExpirationMonth\":\"null\",\"cardExpirationYear\":\"null\",\"nationality\":\"null\",\"city\":\"NY\",\"postcode\":\"null\",\"identificationType\":\"null\",\"identificationValue\":\"null\"\"category\":\"null\"}",
"Statement Descriptor":"044153838562 Rapyd Nat"
},
"customParameters":{
"PAYMENT_INHOUSE_FACADE":"true"
},
"risk":{
"score":"0"
},
"buildNumber":"9092e7a6af8301accda2f9a3a38f743f907dadd5@2026-03-23 16:50:06 +0000",
"timestamp":"2026-03-25 20:28:02+0000",
"ndc":"8a8294174e735d0c014e78cf26461790_5397ca827a8c48ca922a42664ef271b4"
}5. Manage the payment
Start a back-office POST request over the captured payment to:
- Refund: Full or partial refund of a captured amount.
- Rebill: Charge the customer for extra products.
- Chargeback: Reflect a chargeback processed by the bank.
- Chargeback reversal: Reverse a chargeback.
Debit
1. Perform debit payment
Initiate a server-to-server POST request with the required payment data and the URL-encoded shopperResultUrl. The system verifies the payment details with the issuer and captures the funds. A successful request returns an id that you should store and use for subsequent back-office operations.
Sample request:
curl https://sandbox-card.peachpayments.com/v1/payments \
-d "entityId=8a8294174e735d0c014e78cf26461790" \
-d "amount=92.00" \
-d "currency=EUR" \
-d "paymentType=DB" \
-d "paymentBrand=VISA" \
-d "card.number=4200000000000000" \
-d "card.holder=Jane Jones" \
-d "card.expiryMonth=05" \
-d "card.expiryYear=2034" \
-d "card.cvv=123" \
-d "shopperResultUrl=https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server" \
-H "Authorization: Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ="public Dictionary<string, dynamic> Request() {
Dictionary<string, dynamic> responseData;
string data = "entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"¤cy=EUR" +
"&paymentType=DB" +
"&paymentBrand=VISA" +
"&card.number=4200000000000000" +
"&card.holder=Jane Jones" +
"&card.expiryMonth=05" +
"&card.expiryYear=2034" +
"&card.cvv=123" +
"&shopperResultUrl=https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server";
string url = "https://sandbox-card.peachpayments.com/v1/payments";
byte[] buffer = Encoding.ASCII.GetBytes(data);
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
request.Method = "POST";
request.Headers["Authorization"] = "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=";
request.ContentType = "application/x-www-form-urlencoded";
Stream PostData = request.GetRequestStream();
PostData.Write(buffer, 0, buffer.Length);
PostData.Close();
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
var s = new JavaScriptSerializer();
responseData = s.Deserialize<Dictionary<string, dynamic>>(reader.ReadToEnd());
reader.Close();
dataStream.Close();
}
return responseData;
}
responseData = Request()["result"]["description"];import groovy.json.JsonSlurper
public static String request() {
def data = "entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"¤cy=EUR" +
"&paymentType=DB" +
"&paymentBrand=VISA" +
"&card.number=4200000000000000" +
"&card.holder=Jane Jones" +
"&card.expiryMonth=05" +
"&card.expiryYear=2034" +
"&card.cvv=123" +
"&shopperResultUrl=https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server"
def url = "https://sandbox-card.peachpayments.com/v1/payments".toURL()
def connection = url.openConnection()
connection.setRequestMethod("POST")
connection.setRequestProperty("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
connection.doOutput = true
connection.outputStream << data
def json = new JsonSlurper().parseText(connection.inputStream.text)
json
}
println request()import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import org.apache.commons.io.IOUtils;
private String request() throws IOException {
URL url = new URL("https://sandbox-card.peachpayments.com/v1/payments");
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Authorization",
"Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=");
conn.setDoInput(true);
conn.setDoOutput(true);
String data = ""
+ "entityId=8a8294174e735d0c014e78cf26461790"
+ "&amount=92.00"
+ "¤cy=EUR"
+ "&paymentType=DB"
+ "&paymentBrand=VISA"
+ "&card.number=4200000000000000"
+ "&card.holder=Jane Jones"
+ "&card.expiryMonth=05"
+ "&card.expiryYear=2034"
+ "&card.cvv=123"
+ "&shopperResultUrl=https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server";
DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
wr.writeBytes(data);
wr.flush();
wr.close();
int responseCode = conn.getResponseCode();
InputStream is = (responseCode >= 400) ? conn.getErrorStream() : conn.getInputStream();
return IOUtils.toString(is);
}const https = require('https');
const querystring = require('querystring');
const request = async () => {
const path = '/v1/payments';
const data = querystring.stringify({
'entityId': '8a8294174e735d0c014e78cf26461790',
'amount': '92.00',
'currency': 'EUR',
'paymentType': 'DB',
'paymentBrand': 'VISA',
'card.number': '4200000000000000',
'card.holder': 'Jane Jones',
'card.expiryMonth': '05',
'card.expiryYear': '2034',
'card.cvv': '123',
'shopperResultUrl': 'https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server'
});
const options = {
port: 443,
host: 'sandbox-card.peachpayments.com',
path: path,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': data.length,
'Authorization': 'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ='
}
};
return new Promise((resolve, reject) => {
const postRequest = https.request(options, function(res) {
const buf = [];
res.on('data', chunk => {
buf.push(Buffer.from(chunk));
});
res.on('end', () => {
const jsonString = Buffer.concat(buf).toString('utf8');
try {
resolve(JSON.parse(jsonString));
} catch (error) {
reject(error);
}
});
});
postRequest.on('error', reject);
postRequest.write(data);
postRequest.end();
});
};
request().then(console.log).catch(console.error);function request() {
$url = "https://sandbox-card.peachpayments.com/v1/payments";
$data = [
'entityId' => '8a8294174e735d0c014e78cf26461790',
'amount' => '92.00',
'currency' => 'EUR',
'paymentType' => 'DB',
'paymentBrand' => 'VISA',
'card.number' => '4200000000000000',
'card.holder' => 'Jane Jones',
'card.expiryMonth' => '05',
'card.expiryYear' => '2034',
'card.cvv' => '123',
'shopperResultUrl' => 'https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server'
];
$postData = http_build_query($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=',
'Content-Type: application/x-www-form-urlencoded'
]);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$responseData = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if (curl_errno($ch)) {
$error = curl_error($ch);
curl_close($ch);
return "cURL error: " . $error;
}
curl_close($ch);
if ($httpCode >= 400) {
return "HTTP error ($httpCode): " . $responseData;
}
return json_decode($responseData, true);
}
$response = request();
print_r($response);import json
from urllib.parse import urlencode
from urllib.request import build_opener, Request, HTTPHandler
from urllib.error import HTTPError, URLError
def request():
url = "https://sandbox-card.peachpayments.com/v1/payments"
data = {
'entityId': '8a8294174e735d0c014e78cf26461790',
'amount': '92.00',
'currency': 'EUR',
'paymentType': 'DB',
'paymentBrand': 'VISA',
'card.number': '4200000000000000',
'card.holder': 'Jane Jones',
'card.expiryMonth': '05',
'card.expiryYear': '2034',
'card.cvv': '123',
'shopperResultUrl': 'https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server'
}
headers = {
'Authorization': 'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=',
'Content-Type': 'application/x-www-form-urlencoded'
}
try:
opener = build_opener(HTTPHandler)
request = Request(url, data=urlencode(data).encode('utf-8'), headers=headers, method='POST')
response = opener.open(request)
return json.loads(response.read().decode('utf-8'))
except HTTPError as e:
return json.loads(e.read().decode('utf-8'))
except URLError as e:
return {'error': str(e.reason)}
response_data = request()
print(response_data)require 'net/https'
require 'uri'
require 'json'
def request
uri = URI('https://sandbox-card.peachpayments.com/v1/payments')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
req = Net::HTTP::Post.new(uri.path, {
'Authorization' => 'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=',
'Content-Type' => 'application/x-www-form-urlencoded'
})
req.set_form_data(
'entityId' => '8a8294174e735d0c014e78cf26461790',
'amount' => '92.00',
'currency' => 'EUR',
'paymentType' => 'DB',
'paymentBrand' => 'VISA',
'card.number' => '4200000000000000',
'card.holder' => 'Jane Jones',
'card.expiryMonth' => '05',
'card.expiryYear' => '2034',
'card.cvv' => '123',
'shopperResultUrl' => 'https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server'
)
res = http.request(req)
JSON.parse(res.body)
rescue JSON::ParserError
{ error: 'Invalid JSON response' }
rescue StandardError => e
{ error: e.message }
end
puts requestimport java.net.{HttpsURLConnection, URL}
import org.apache.commons.io.IOUtils
def initialPayment: String = {
val url = "https://sandbox-card.peachpayments.com/v1/payments"
val data = Seq(
"entityId=8a8294174e735d0c014e78cf26461790",
"amount=92.00",
"currency=EUR",
"paymentType=DB",
"paymentBrand=VISA",
"card.number=4200000000000000",
"card.holder=Jane Jones",
"card.expiryMonth=05",
"card.expiryYear=2034",
"card.cvv=123",
"shopperResultUrl=https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server"
).mkString("&")
val conn = new URL(url).openConnection() match {
case secureConn: HttpsURLConnection =>
secureConn.setRequestMethod("POST")
secureConn.setRequestProperty("Authorization",
"Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
secureConn.setDoOutput(true)
secureConn
}
conn.setDoInput(true)
IOUtils.write(data, conn.getOutputStream, "UTF-8")
conn.connect()
val responseStream = if (conn.getResponseCode >= 400) conn.getErrorStream else conn.getInputStream
IOUtils.toString(responseStream, "UTF-8")
}Imports System.Net
Imports System.IO
Imports System.Text
Imports System.Web.Script.Serialization
Public Function Request() As Dictionary(Of String, Object)
Dim url As String = "https://sandbox-card.peachpayments.com/v1/payments"
Dim data As String = "" +
"entityId=8a8294174e735d0c014e78cf26461790" +
"&amount=92.00" +
"¤cy=EUR" +
"&paymentType=DB" +
"&paymentBrand=VISA" +
"&card.number=4200000000000000" +
"&card.holder=Jane Jones" +
"&card.expiryMonth=05" +
"&card.expiryYear=2034" +
"&card.cvv=123" +
"&shopperResultUrl=https://developer.peachpayments.com/docs/oppwa-integrations-server-to-server"
Dim req As WebRequest = WebRequest.Create(url)
req.Method = "POST"
req.Headers.Add("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
req.ContentType = "application/x-www-form-urlencoded"
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(data)
req.ContentLength = byteArray.Length
Dim dataStream As Stream = req.GetRequestStream()
dataStream.Write(byteArray, 0, byteArray.Length)
dataStream.Close()
Dim res As WebResponse = req.GetResponse()
Dim resStream As Stream = res.GetResponseStream()
Dim reader As New StreamReader(resStream)
Dim response As String = reader.ReadToEnd()
reader.Close()
resStream.Close()
res.Close()
Dim jss As New JavaScriptSerializer()
Dim dict As Dictionary(Of String, Object) = jss.Deserialize(Of Dictionary(Of String, Object))(response)
Return dict
End Function
Dim responseData As String = Request()("result")("description"){
"id":"8ac7a4a19d21da51019d2929ae4a2a54",
"paymentType":"DB",
"paymentBrand":"VISA",
"amount":"92.00",
"currency":"EUR",
"descriptor":"3479.3997.6740 MAC_Channel ",
"result":{
"code":"000.100.110",
"description":"Request successfully processed in 'Merchant in Integrator Test Mode'"
},
"resultDetails":{
"Payment Status":"CLO",
"ConnectorTxID1":"payment_55cd30eb3b5a499b3a3a2f5b6cf3f11a",
"Cvv Check":"unchecked",
"Transaction Status":"SUCCESS",
"ConnectorTxID3":"123456",
"Amount":"0.0",
"Operation Id":"64403c94-0978-4d5f-abd7-28a4e5d99556",
"Payment Method Category":"card",
"CardholderInitiatedTransactionID":"123456",
"ExtendedDescription":"Transaction succeeded",
"Customer Token":"cus_4d184daa989cac82224b856bac739b60",
"Paid Amount":"0.0",
"Payment Account Reference":"V001NPX3IQC6OFS2TAWCVD2WTXRWY",
"Sender Details":"{\"address\":\"null\",\"firstName\":\"null\",\"lastName\":\"null\",\"postcode\":\"null\",\"city\":\"AE\",\"state\":\"null\",\"country\":\"null\",\"companyName\":\"null\"}",
"AcquirerResponse":"SUCCESS",
"Beneficiary Details":"{\"firstName\":\"null\",\"lastName\":\"null\",\"address\":\"null\",\"dob\":\"null\",\"gender\":\"null\",\"email\":\"null\",\"state\":\"null\",\"cardNumber\":\"null\",\"cardExpirationMonth\":\"null\",\"cardExpirationYear\":\"null\",\"nationality\":\"null\",\"city\":\"NY\",\"postcode\":\"null\",\"identificationType\":\"null\",\"identificationValue\":\"null\"\"category\":\"null\"}",
"Statement Descriptor":"044153838562 Rapyd Nat"
},
"card":{
"bin":"420000",
"last4Digits":"0000",
"holder":"Jane Jones",
"expiryMonth":"05",
"expiryYear":"2034"
},
"customParameters":{
"3DS2_enrolled":"true",
"3DS2_flow":"challenge",
"PAYMENT_INHOUSE_FACADE":"true"
},
"risk":{
"score":"100"
},
"buildNumber":"9092e7a6af8301accda2f9a3a38f743f907dadd5@2026-03-23 16:50:06 +0000",
"timestamp":"2026-03-26 08:01:30+0000",
"ndc":"8a8294174e735d0c014e78cf26461790_038737bfbd774644a1a2a8e8f1102cab"
}2. Redirect shopper
Begin a server-to-server request to guide the account holder through validation and payment completion.
Interpret the JSON redirect
Extract the redirect information from the response of the initial authorisation payment.
| Parameter | Description |
|---|---|
url | The HTTPS URL of redirection (used as the form's action attribute). |
method | The form submission method (defaults to HTTPS POST). |
parameters | Appended to the URL of HTTPS GET or included in the body for HTTPS POST. |
Redirect response parameters
Use these parameters with an HTML form to perform the shopper's redirect.
<form action="{redirectUrl}" class="paymentWidgets">
<input type="text" name="{name-1}" value="{value-1}">
<input type="text" name="{name-2}" value="{value-2}">
</form>3. Get the payment status
After processing the payment request, the system redirects the customer to shopperResultUrl with a GET parameter resourcePath: /v1/payments/{id}
Sample request:
https://sandbox-card.peachpayments.com/v1/payments/8ac7a4a19d21da51019d2929ae4a2a54
curl -G https://sandbox-card.peachpayments.com/v1/payments/{id} \
-d "entityId=8a8294174e735d0c014e78cf26461790" \
-H "Authorization: Bearer OGE4Mjk0MTc0ZTc.....Pz9OWVQ="public Dictionary<string, dynamic> Request() {
Dictionary<string, dynamic> responseData;
string data = "entityId=8a8294174e735d0c014e78cf26461790";
string url = "https://sandbox-card.peachpayments.com/v1/payments/{id}?" + data;
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
request.Method = "GET";
request.Headers["Authorization"] = "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=";
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
var s = new JavaScriptSerializer();
responseData = s.Deserialize<Dictionary<string, dynamic>>(reader.ReadToEnd());
reader.Close();
dataStream.Close();
}
return responseData;
}
responseData = Request()["result"]["description"];import groovy.json.JsonSlurper
public static String request() {
def data = "entityId=8a8294174e735d0c014e78cf26461790"
def url = ("https://sandbox-card.peachpayments.com/v1/payments/{id}?" + data).toURL()
def connection = url.openConnection()
connection.setRequestMethod("GET")
connection.setRequestProperty("Authorization",
"Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
def json = new JsonSlurper().parseText(connection.inputStream.text)
json
}
println request()private String request() throws IOException {
URL url = new URL("https://sandbox-card.peachpayments.com/v1/payments/{id}?entityId=8a8294174e735d0c014e78cf26461790");
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Authorization",
"Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=");
int responseCode = conn.getResponseCode();
InputStream is;
if (responseCode >= 400) is = conn.getErrorStream();
else is = conn.getInputStream();
return IOUtils.toString(is);
}const https = require('https');
const querystring = require('querystring');
const request = async () => {
var path = '/v1/payments/{id}';
path += '?entityId=8a8294174e735d0c014e78cf26461790';
const options = {
port: 443,
host: 'sandbox-card.peachpayments.com',
path: path,
method: 'GET',
headers: {
'Authorization': 'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ='
}
};
return new Promise((resolve, reject) => {
const postRequest = https.request(options, function(res) {
const buf = [];
res.on('data', chunk => {
buf.push(Buffer.from(chunk));
});
res.on('end', () => {
const jsonString = Buffer.concat(buf).toString('utf8');
try {
resolve(JSON.parse(jsonString));
} catch (error) {
reject(error);
}
});
});
postRequest.on('error', reject);
postRequest.end();
});
};
request().then(console.log).catch(console.error);function request() {
$url = "https://sandbox-card.peachpayments.com/v1/payments/{id}";
$url .= "?entityId=8a8294174e735d0c014e78cf26461790";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization:Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ='
));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // this should be set to true in production
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$responseData = curl_exec($ch);
if (curl_errno($ch)) {
return curl_error($ch);
}
curl_close($ch);
return $responseData;
}
$responseData = request();try:
from urllib.parse import urlencode
from urllib.request import build_opener, Request, HTTPHandler
from urllib.error import HTTPError, URLError
except ImportError:
from urllib import urlencode
from urllib2 import build_opener, Request, HTTPHandler, HTTPError, URLError
import json
def request():
url = "https://sandbox-card.peachpayments.com/v1/payments/{id}"
url += '?entityId=8a8294174e735d0c014e78cf26461790'
try:
opener = build_opener(HTTPHandler)
request = Request(url, data=b'')
request.add_header('Authorization',
'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=')
request.get_method = lambda: 'GET'
response = opener.open(request)
return json.loads(response.read())
except HTTPError as e:
return json.loads(e.read())
except URLError as e:
return e.reason
responseData = request()
print(responseData)require 'net/https'
require 'uri'
require 'json'
def request()
path = "?entityId=8a8294174e735d0c014e78cf26461790"
uri = URI.parse('https://sandbox-card.peachpayments.com/v1/payments/{id}' + path)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ='
res = http.request(req)
return JSON.parse(res.body)
end
puts request()def initialPayment: String = {
val url = "https://sandbox-card.peachpayments.com/v1/payments/{id}"
val fullUrl = url + "?entityId=8a8294174e735d0c014e78cf26461790"
val conn = new URL(fullUrl).openConnection()
conn match {
case secureConn: HttpsURLConnection => secureConn.setRequestMethod("GET")
case _ => throw new ClassCastException
}
conn.setRequestProperty("Authorization",
"Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
conn.connect()
if (conn.getResponseCode() >= 400) {
IOUtils.toString(conn.getErrorStream())
} else {
IOUtils.toString(conn.getInputStream())
}
}Public Function Request() As Dictionary(Of String, Object)
Dim url As String = "https://sandbox-card.peachpayments.com/v1/payments/{id}" +
"?entityId=8a8294174e735d0c014e78cf26461790"
Dim req As WebRequest = WebRequest.Create(url)
req.Method = "GET"
req.Headers.Add("Authorization", "Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8SFV3I3JGQTQ9bWpxaWYrPz9OWVQ=")
req.ContentType = "application/x-www-form-urlencoded"
Dim res As WebResponse = req.GetResponse()
Dim resStream = res.GetResponseStream()
Dim reader As New StreamReader(resStream)
Dim response As String = reader.ReadToEnd()
reader.Close()
resStream.Close()
res.Close()
Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer()
Dim dict As Dictionary(Of String, Object) = jss.Deserialize(Of Dictionary(Of String, Object))(response)
Return dict
End Function
responseData = Request()("result")("description"){
"id":"8ac7a4a19d21da51019d2929ae4a2a54",
"paymentType":"DB",
"paymentBrand":"VISA",
"amount":"92.00",
"currency":"EUR",
"descriptor":"3479.3997.6740 MAC_Channel",
"result":{
"code":"000.100.110",
"description":"Request successfully processed in 'Merchant in Integrator Test Mode'"
},
"resultDetails":{
"Payment Status":"CLO",
"Cvv Check":"unchecked",
"ConnectorTxID1":"payment_55cd30eb3b5a499b3a3a2f5b6cf3f11a",
"Transaction Status":"SUCCESS",
"ConnectorTxID3":"123456",
"Amount":"0.0",
"Operation Id":"64403c94-0978-4d5f-abd7-28a4e5d99556",
"Payment Method Category":"card",
"CardholderInitiatedTransactionID":"123456",
"ExtendedDescription":"Transaction succeeded",
"Customer Token":"cus_4d184daa989cac82224b856bac739b60",
"Paid Amount":"0.0",
"Sender Details":"{\"address\":\"null\",\"firstName\":\"null\",\"lastName\":\"null\",\"postcode\":\"null\",\"city\":\"AE\",\"state\":\"null\",\"country\":\"null\",\"companyName\":\"null\"}",
"Payment Account Reference":"V001NPX3IQC6OFS2TAWCVD2WTXRWY",
"AcquirerResponse":"SUCCESS",
"Beneficiary Details":"{\"firstName\":\"null\",\"lastName\":\"null\",\"address\":\"null\",\"dob\":\"null\",\"gender\":\"null\",\"email\":\"null\",\"state\":\"null\",\"cardNumber\":\"null\",\"cardExpirationMonth\":\"null\",\"cardExpirationYear\":\"null\",\"nationality\":\"null\",\"city\":\"NY\",\"postcode\":\"null\",\"identificationType\":\"null\",\"identificationValue\":\"null\"\"category\":\"null\"}",
"Statement Descriptor":"044153838562 Rapyd Nat"
},
"card":{
"bin":"420000",
"binCountry":"US",
"last4Digits":"0000",
"holder":"Jane Jones",
"expiryMonth":"05",
"expiryYear":"2034"
},
"customParameters":{
"CTPE_DESCRIPTOR_TEMPLATE":"",
"3DS2_flow":"challenge",
"PAYMENT_INHOUSE_FACADE":"true",
"3DS2_enrolled":"true"
},
"risk":{
"score":"100"
},
"buildNumber":"9092e7a6af8301accda2f9a3a38f743f907dadd5@2026-03-23 16:50:06 +0000",
"timestamp":"2026-03-26 08:01:30+0000",
"ndc":"8a8294174e735d0c014e78cf26461790_1177044527ce4cfeb31fb06d2e13ac02"
}
- You can make two payment status requests per minute per transaction.
- The query endpoint provides payment status without such restrictions.
4. Manage the payment
Start a back-office POST request over the debit payment to:
- Refund: Full or partial refund of a captured amount.
- Rebill: Charge the customer for extra products.
- Chargeback: Reflect a chargeback processed by the bank.
- Chargeback reversal: Reverse a chargeback.
Updated about 4 hours ago