curl --request POST \
--url https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"refunds": [
{
"id": "12345"
},
{
"id": "67890",
"amount": 5
}
]
}
'import requests
url = "https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/refunds"
payload = { "refunds": [
{ "id": "12345" },
{
"id": "67890",
"amount": 5
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({refunds: [{id: '12345'}, {id: '67890', amount: 5}]})
};
fetch('https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/refunds', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/refunds",
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([
'refunds' => [
[
'id' => '12345'
],
[
'id' => '67890',
'amount' => 5
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/refunds"
payload := strings.NewReader("{\n \"refunds\": [\n {\n \"id\": \"12345\"\n },\n {\n \"id\": \"67890\",\n \"amount\": 5\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/refunds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"refunds\": [\n {\n \"id\": \"12345\"\n },\n {\n \"id\": \"67890\",\n \"amount\": 5\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/refunds")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"refunds\": [\n {\n \"id\": \"12345\"\n },\n {\n \"id\": \"67890\",\n \"amount\": 5\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "<count> refunds received for processing"
}{
"error_count": 2,
"rejected": [
{
"id": "TX_ID_1",
"errors": [
{
"code": "RET027",
"message": "Unable to refund this transaction as requested amount exceeds refundable amount"
}
]
},
{
"id": "TX_ID_2",
"errors": [
{
"code": "RET015",
"message": "The transaction has been cancelled and is no longer in the retry phase for capture. Hence, we cannot proceed with Refund."
}
]
}
]
}{
"code": "RET400",
"message": "Invalid parameter: <bad_parm>"
}{
"code": "RET0404",
"message": "No matching results found"
}Refund Retain Transactions
Directs Vindicia Retain to refund a captured Transaction or to discontinue further retry attempts to capture a Transaction.
This call can be used in different scenarios such as when a customer has cancelled a subscription, or has paid the bill independent of Retain processing.
This call also supports partial refunds by adding the amount attribute to the refund request. Partial Refunds are allowed up to the original captured amount (or a sum of previous partial refunds up to the captured amount)
If a requested refund fails Retain input validation it is returned in the response array, along with information indicating the issue.
After Retain processes the refund API call, Push Notifications for each refund processed are sent. You can call GET retain/refunds for the datetime range in which the refund(s) were performed, or use GET retain/refunds/{id}, to get details of the refund operation(s) for a specific Transaction.
curl --request POST \
--url https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"refunds": [
{
"id": "12345"
},
{
"id": "67890",
"amount": 5
}
]
}
'import requests
url = "https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/refunds"
payload = { "refunds": [
{ "id": "12345" },
{
"id": "67890",
"amount": 5
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({refunds: [{id: '12345'}, {id: '67890', amount: 5}]})
};
fetch('https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/refunds', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/refunds",
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([
'refunds' => [
[
'id' => '12345'
],
[
'id' => '67890',
'amount' => 5
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/refunds"
payload := strings.NewReader("{\n \"refunds\": [\n {\n \"id\": \"12345\"\n },\n {\n \"id\": \"67890\",\n \"amount\": 5\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/refunds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"refunds\": [\n {\n \"id\": \"12345\"\n },\n {\n \"id\": \"67890\",\n \"amount\": 5\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/refunds")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"refunds\": [\n {\n \"id\": \"12345\"\n },\n {\n \"id\": \"67890\",\n \"amount\": 5\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "<count> refunds received for processing"
}{
"error_count": 2,
"rejected": [
{
"id": "TX_ID_1",
"errors": [
{
"code": "RET027",
"message": "Unable to refund this transaction as requested amount exceeds refundable amount"
}
]
},
{
"id": "TX_ID_2",
"errors": [
{
"code": "RET015",
"message": "The transaction has been cancelled and is no longer in the retry phase for capture. Hence, we cannot proceed with Refund."
}
]
}
]
}{
"code": "RET400",
"message": "Invalid parameter: <bad_parm>"
}{
"code": "RET0404",
"message": "No matching results found"
}Query Parameters
Indicates if the refunds are being submitted only for primary data validation, without formal commit of the actual data to Retain for processing.
0 <= x <= 1Body
Array of Transaction identifiers to refund or terminate reprocessing.
1Show child attributes
Show child attributes
Callbacks
POSThttps://webhook.merchant.com/path4Refund status
Response
All submitted refunds accepted for processing.
"<count> refunds received for processing"
