cURL
curl --request POST \
--url https://api-sandbox.paychoice.com.au/api/v5/Reverse \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"reference": "<string>",
"charge_id": "<string>",
"merchant_guid": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({reference: '<string>', charge_id: '<string>', merchant_guid: '<string>'})
};
fetch('https://api-sandbox.paychoice.com.au/api/v5/Reverse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-sandbox.paychoice.com.au/api/v5/Reverse"
payload = {
"reference": "<string>",
"charge_id": "<string>",
"merchant_guid": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api-sandbox.paychoice.com.au/api/v5/Reverse");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Basic <encoded-value>");
request.AddJsonBody("{\n \"reference\": \"<string>\",\n \"charge_id\": \"<string>\",\n \"merchant_guid\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.paychoice.com.au/api/v5/Reverse",
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([
'reference' => '<string>',
'charge_id' => '<string>',
'merchant_guid' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"is_successful": true,
"reference": "BOOKING-7781",
"object_type": "reversal_response",
"from_item": 0,
"to_item": 0,
"total_count": 0
}
Refunds and pre-authorisations
Reverse a pre-authorisation
POST
/
api
/
v5
/
Reverse
cURL
curl --request POST \
--url https://api-sandbox.paychoice.com.au/api/v5/Reverse \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"reference": "<string>",
"charge_id": "<string>",
"merchant_guid": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({reference: '<string>', charge_id: '<string>', merchant_guid: '<string>'})
};
fetch('https://api-sandbox.paychoice.com.au/api/v5/Reverse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-sandbox.paychoice.com.au/api/v5/Reverse"
payload = {
"reference": "<string>",
"charge_id": "<string>",
"merchant_guid": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api-sandbox.paychoice.com.au/api/v5/Reverse");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Basic <encoded-value>");
request.AddJsonBody("{\n \"reference\": \"<string>\",\n \"charge_id\": \"<string>\",\n \"merchant_guid\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.paychoice.com.au/api/v5/Reverse",
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([
'reference' => '<string>',
'charge_id' => '<string>',
'merchant_guid' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"is_successful": true,
"reference": "BOOKING-7781",
"object_type": "reversal_response",
"from_item": 0,
"to_item": 0,
"total_count": 0
}
Reverses a pre-authorisation and releases the held funds. Pass the pre-authorisation’s
reference. Returns a flat object rather than an envelope.
{
"is_successful": true,
"reference": "BOOKING-7781",
"object_type": "reversal_response",
"from_item": 0,
"to_item": 0,
"total_count": 0
}
boolean
true if the reversal was approved by the processor.
