curl --request POST \
--url https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transactions": [
{
"account": {
"id": "Your-Customer1-ID"
},
"amount": 21.64,
"auth_code": "530",
"currency": "USD",
"division_number": "349641",
"id": "Your-Failed-TX-ID1",
"payment_method": {
"credit_card": {
"account": "4111111111111111",
"expiration_date": "202301"
},
"id": "Your-PayMethod1-ID",
"account_holder": "Lily Munster",
"billing_address": {
"city": "Mockingbird Heights",
"country": "US",
"district": "CA",
"line1": "1313 Mockingbird Ln.",
"postal_code": "92415",
"line2": "Floor 13",
"line3": "Suite 13",
"county": "San Bernardino"
},
"is_tokenized": false
},
"subscription": {
"id": "Your-Subscription1-ID",
"starts": "2022-08-27T21:47:45.000Z"
},
"timestamp": "2023-02-25T21:47:45.000Z",
"metadata": {
"metadata1": "clicks-and-mortar",
"metadata2": "metrics"
},
"avs_code": "Y",
"cvn_code": "M",
"payment_network_transaction_id": "CIT-TX-ID1"
},
{
"account": {
"id": "Your-Customer2-ID"
},
"amount": 21.64,
"auth_code": "500",
"currency": "USD",
"division_number": "349641",
"id": "Your-Failed-TX-ID2",
"payment_method": {
"credit_card": {
"account": "4012888888881881",
"expiration_date": "202212"
},
"id": "Your-PayMethod2-ID",
"account_holder": "Cousin It",
"billing_address": {
"city": "Mockingbird Heights",
"country": "US",
"district": "CA",
"line1": "1313 Mockingbird Ln.",
"postal_code": "92415",
"line2": "Floor 13",
"line3": "Suite 13",
"county": "San Bernardino"
},
"is_tokenized": false
},
"subscription": {
"id": "Your-Subscription2-ID",
"starts": "2022-08-27T21:47:45.000Z"
},
"timestamp": "2023-02-25T21:47:45.000Z",
"avs_code": "Y",
"cvn_code": "M",
"payment_network_transaction_id": "CIT-TX-ID2"
}
]
}
'import requests
url = "https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/transactions"
payload = { "transactions": [
{
"account": { "id": "Your-Customer1-ID" },
"amount": 21.64,
"auth_code": "530",
"currency": "USD",
"division_number": "349641",
"id": "Your-Failed-TX-ID1",
"payment_method": {
"credit_card": {
"account": "4111111111111111",
"expiration_date": "202301"
},
"id": "Your-PayMethod1-ID",
"account_holder": "Lily Munster",
"billing_address": {
"city": "Mockingbird Heights",
"country": "US",
"district": "CA",
"line1": "1313 Mockingbird Ln.",
"postal_code": "92415",
"line2": "Floor 13",
"line3": "Suite 13",
"county": "San Bernardino"
},
"is_tokenized": False
},
"subscription": {
"id": "Your-Subscription1-ID",
"starts": "2022-08-27T21:47:45.000Z"
},
"timestamp": "2023-02-25T21:47:45.000Z",
"metadata": {
"metadata1": "clicks-and-mortar",
"metadata2": "metrics"
},
"avs_code": "Y",
"cvn_code": "M",
"payment_network_transaction_id": "CIT-TX-ID1"
},
{
"account": { "id": "Your-Customer2-ID" },
"amount": 21.64,
"auth_code": "500",
"currency": "USD",
"division_number": "349641",
"id": "Your-Failed-TX-ID2",
"payment_method": {
"credit_card": {
"account": "4012888888881881",
"expiration_date": "202212"
},
"id": "Your-PayMethod2-ID",
"account_holder": "Cousin It",
"billing_address": {
"city": "Mockingbird Heights",
"country": "US",
"district": "CA",
"line1": "1313 Mockingbird Ln.",
"postal_code": "92415",
"line2": "Floor 13",
"line3": "Suite 13",
"county": "San Bernardino"
},
"is_tokenized": False
},
"subscription": {
"id": "Your-Subscription2-ID",
"starts": "2022-08-27T21:47:45.000Z"
},
"timestamp": "2023-02-25T21:47:45.000Z",
"avs_code": "Y",
"cvn_code": "M",
"payment_network_transaction_id": "CIT-TX-ID2"
}
] }
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({
transactions: [
{
account: {id: 'Your-Customer1-ID'},
amount: 21.64,
auth_code: '530',
currency: 'USD',
division_number: '349641',
id: 'Your-Failed-TX-ID1',
payment_method: {
credit_card: {account: '4111111111111111', expiration_date: '202301'},
id: 'Your-PayMethod1-ID',
account_holder: 'Lily Munster',
billing_address: {
city: 'Mockingbird Heights',
country: 'US',
district: 'CA',
line1: '1313 Mockingbird Ln.',
postal_code: '92415',
line2: 'Floor 13',
line3: 'Suite 13',
county: 'San Bernardino'
},
is_tokenized: false
},
subscription: {id: 'Your-Subscription1-ID', starts: '2022-08-27T21:47:45.000Z'},
timestamp: '2023-02-25T21:47:45.000Z',
metadata: {metadata1: 'clicks-and-mortar', metadata2: 'metrics'},
avs_code: 'Y',
cvn_code: 'M',
payment_network_transaction_id: 'CIT-TX-ID1'
},
{
account: {id: 'Your-Customer2-ID'},
amount: 21.64,
auth_code: '500',
currency: 'USD',
division_number: '349641',
id: 'Your-Failed-TX-ID2',
payment_method: {
credit_card: {account: '4012888888881881', expiration_date: '202212'},
id: 'Your-PayMethod2-ID',
account_holder: 'Cousin It',
billing_address: {
city: 'Mockingbird Heights',
country: 'US',
district: 'CA',
line1: '1313 Mockingbird Ln.',
postal_code: '92415',
line2: 'Floor 13',
line3: 'Suite 13',
county: 'San Bernardino'
},
is_tokenized: false
},
subscription: {id: 'Your-Subscription2-ID', starts: '2022-08-27T21:47:45.000Z'},
timestamp: '2023-02-25T21:47:45.000Z',
avs_code: 'Y',
cvn_code: 'M',
payment_network_transaction_id: 'CIT-TX-ID2'
}
]
})
};
fetch('https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/transactions', 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/transactions",
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([
'transactions' => [
[
'account' => [
'id' => 'Your-Customer1-ID'
],
'amount' => 21.64,
'auth_code' => '530',
'currency' => 'USD',
'division_number' => '349641',
'id' => 'Your-Failed-TX-ID1',
'payment_method' => [
'credit_card' => [
'account' => '4111111111111111',
'expiration_date' => '202301'
],
'id' => 'Your-PayMethod1-ID',
'account_holder' => 'Lily Munster',
'billing_address' => [
'city' => 'Mockingbird Heights',
'country' => 'US',
'district' => 'CA',
'line1' => '1313 Mockingbird Ln.',
'postal_code' => '92415',
'line2' => 'Floor 13',
'line3' => 'Suite 13',
'county' => 'San Bernardino'
],
'is_tokenized' => false
],
'subscription' => [
'id' => 'Your-Subscription1-ID',
'starts' => '2022-08-27T21:47:45.000Z'
],
'timestamp' => '2023-02-25T21:47:45.000Z',
'metadata' => [
'metadata1' => 'clicks-and-mortar',
'metadata2' => 'metrics'
],
'avs_code' => 'Y',
'cvn_code' => 'M',
'payment_network_transaction_id' => 'CIT-TX-ID1'
],
[
'account' => [
'id' => 'Your-Customer2-ID'
],
'amount' => 21.64,
'auth_code' => '500',
'currency' => 'USD',
'division_number' => '349641',
'id' => 'Your-Failed-TX-ID2',
'payment_method' => [
'credit_card' => [
'account' => '4012888888881881',
'expiration_date' => '202212'
],
'id' => 'Your-PayMethod2-ID',
'account_holder' => 'Cousin It',
'billing_address' => [
'city' => 'Mockingbird Heights',
'country' => 'US',
'district' => 'CA',
'line1' => '1313 Mockingbird Ln.',
'postal_code' => '92415',
'line2' => 'Floor 13',
'line3' => 'Suite 13',
'county' => 'San Bernardino'
],
'is_tokenized' => false
],
'subscription' => [
'id' => 'Your-Subscription2-ID',
'starts' => '2022-08-27T21:47:45.000Z'
],
'timestamp' => '2023-02-25T21:47:45.000Z',
'avs_code' => 'Y',
'cvn_code' => 'M',
'payment_network_transaction_id' => 'CIT-TX-ID2'
]
]
]),
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/transactions"
payload := strings.NewReader("{\n \"transactions\": [\n {\n \"account\": {\n \"id\": \"Your-Customer1-ID\"\n },\n \"amount\": 21.64,\n \"auth_code\": \"530\",\n \"currency\": \"USD\",\n \"division_number\": \"349641\",\n \"id\": \"Your-Failed-TX-ID1\",\n \"payment_method\": {\n \"credit_card\": {\n \"account\": \"4111111111111111\",\n \"expiration_date\": \"202301\"\n },\n \"id\": \"Your-PayMethod1-ID\",\n \"account_holder\": \"Lily Munster\",\n \"billing_address\": {\n \"city\": \"Mockingbird Heights\",\n \"country\": \"US\",\n \"district\": \"CA\",\n \"line1\": \"1313 Mockingbird Ln.\",\n \"postal_code\": \"92415\",\n \"line2\": \"Floor 13\",\n \"line3\": \"Suite 13\",\n \"county\": \"San Bernardino\"\n },\n \"is_tokenized\": false\n },\n \"subscription\": {\n \"id\": \"Your-Subscription1-ID\",\n \"starts\": \"2022-08-27T21:47:45.000Z\"\n },\n \"timestamp\": \"2023-02-25T21:47:45.000Z\",\n \"metadata\": {\n \"metadata1\": \"clicks-and-mortar\",\n \"metadata2\": \"metrics\"\n },\n \"avs_code\": \"Y\",\n \"cvn_code\": \"M\",\n \"payment_network_transaction_id\": \"CIT-TX-ID1\"\n },\n {\n \"account\": {\n \"id\": \"Your-Customer2-ID\"\n },\n \"amount\": 21.64,\n \"auth_code\": \"500\",\n \"currency\": \"USD\",\n \"division_number\": \"349641\",\n \"id\": \"Your-Failed-TX-ID2\",\n \"payment_method\": {\n \"credit_card\": {\n \"account\": \"4012888888881881\",\n \"expiration_date\": \"202212\"\n },\n \"id\": \"Your-PayMethod2-ID\",\n \"account_holder\": \"Cousin It\",\n \"billing_address\": {\n \"city\": \"Mockingbird Heights\",\n \"country\": \"US\",\n \"district\": \"CA\",\n \"line1\": \"1313 Mockingbird Ln.\",\n \"postal_code\": \"92415\",\n \"line2\": \"Floor 13\",\n \"line3\": \"Suite 13\",\n \"county\": \"San Bernardino\"\n },\n \"is_tokenized\": false\n },\n \"subscription\": {\n \"id\": \"Your-Subscription2-ID\",\n \"starts\": \"2022-08-27T21:47:45.000Z\"\n },\n \"timestamp\": \"2023-02-25T21:47:45.000Z\",\n \"avs_code\": \"Y\",\n \"cvn_code\": \"M\",\n \"payment_network_transaction_id\": \"CIT-TX-ID2\"\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/transactions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transactions\": [\n {\n \"account\": {\n \"id\": \"Your-Customer1-ID\"\n },\n \"amount\": 21.64,\n \"auth_code\": \"530\",\n \"currency\": \"USD\",\n \"division_number\": \"349641\",\n \"id\": \"Your-Failed-TX-ID1\",\n \"payment_method\": {\n \"credit_card\": {\n \"account\": \"4111111111111111\",\n \"expiration_date\": \"202301\"\n },\n \"id\": \"Your-PayMethod1-ID\",\n \"account_holder\": \"Lily Munster\",\n \"billing_address\": {\n \"city\": \"Mockingbird Heights\",\n \"country\": \"US\",\n \"district\": \"CA\",\n \"line1\": \"1313 Mockingbird Ln.\",\n \"postal_code\": \"92415\",\n \"line2\": \"Floor 13\",\n \"line3\": \"Suite 13\",\n \"county\": \"San Bernardino\"\n },\n \"is_tokenized\": false\n },\n \"subscription\": {\n \"id\": \"Your-Subscription1-ID\",\n \"starts\": \"2022-08-27T21:47:45.000Z\"\n },\n \"timestamp\": \"2023-02-25T21:47:45.000Z\",\n \"metadata\": {\n \"metadata1\": \"clicks-and-mortar\",\n \"metadata2\": \"metrics\"\n },\n \"avs_code\": \"Y\",\n \"cvn_code\": \"M\",\n \"payment_network_transaction_id\": \"CIT-TX-ID1\"\n },\n {\n \"account\": {\n \"id\": \"Your-Customer2-ID\"\n },\n \"amount\": 21.64,\n \"auth_code\": \"500\",\n \"currency\": \"USD\",\n \"division_number\": \"349641\",\n \"id\": \"Your-Failed-TX-ID2\",\n \"payment_method\": {\n \"credit_card\": {\n \"account\": \"4012888888881881\",\n \"expiration_date\": \"202212\"\n },\n \"id\": \"Your-PayMethod2-ID\",\n \"account_holder\": \"Cousin It\",\n \"billing_address\": {\n \"city\": \"Mockingbird Heights\",\n \"country\": \"US\",\n \"district\": \"CA\",\n \"line1\": \"1313 Mockingbird Ln.\",\n \"postal_code\": \"92415\",\n \"line2\": \"Floor 13\",\n \"line3\": \"Suite 13\",\n \"county\": \"San Bernardino\"\n },\n \"is_tokenized\": false\n },\n \"subscription\": {\n \"id\": \"Your-Subscription2-ID\",\n \"starts\": \"2022-08-27T21:47:45.000Z\"\n },\n \"timestamp\": \"2023-02-25T21:47:45.000Z\",\n \"avs_code\": \"Y\",\n \"cvn_code\": \"M\",\n \"payment_network_transaction_id\": \"CIT-TX-ID2\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/transactions")
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 \"transactions\": [\n {\n \"account\": {\n \"id\": \"Your-Customer1-ID\"\n },\n \"amount\": 21.64,\n \"auth_code\": \"530\",\n \"currency\": \"USD\",\n \"division_number\": \"349641\",\n \"id\": \"Your-Failed-TX-ID1\",\n \"payment_method\": {\n \"credit_card\": {\n \"account\": \"4111111111111111\",\n \"expiration_date\": \"202301\"\n },\n \"id\": \"Your-PayMethod1-ID\",\n \"account_holder\": \"Lily Munster\",\n \"billing_address\": {\n \"city\": \"Mockingbird Heights\",\n \"country\": \"US\",\n \"district\": \"CA\",\n \"line1\": \"1313 Mockingbird Ln.\",\n \"postal_code\": \"92415\",\n \"line2\": \"Floor 13\",\n \"line3\": \"Suite 13\",\n \"county\": \"San Bernardino\"\n },\n \"is_tokenized\": false\n },\n \"subscription\": {\n \"id\": \"Your-Subscription1-ID\",\n \"starts\": \"2022-08-27T21:47:45.000Z\"\n },\n \"timestamp\": \"2023-02-25T21:47:45.000Z\",\n \"metadata\": {\n \"metadata1\": \"clicks-and-mortar\",\n \"metadata2\": \"metrics\"\n },\n \"avs_code\": \"Y\",\n \"cvn_code\": \"M\",\n \"payment_network_transaction_id\": \"CIT-TX-ID1\"\n },\n {\n \"account\": {\n \"id\": \"Your-Customer2-ID\"\n },\n \"amount\": 21.64,\n \"auth_code\": \"500\",\n \"currency\": \"USD\",\n \"division_number\": \"349641\",\n \"id\": \"Your-Failed-TX-ID2\",\n \"payment_method\": {\n \"credit_card\": {\n \"account\": \"4012888888881881\",\n \"expiration_date\": \"202212\"\n },\n \"id\": \"Your-PayMethod2-ID\",\n \"account_holder\": \"Cousin It\",\n \"billing_address\": {\n \"city\": \"Mockingbird Heights\",\n \"country\": \"US\",\n \"district\": \"CA\",\n \"line1\": \"1313 Mockingbird Ln.\",\n \"postal_code\": \"92415\",\n \"line2\": \"Floor 13\",\n \"line3\": \"Suite 13\",\n \"county\": \"San Bernardino\"\n },\n \"is_tokenized\": false\n },\n \"subscription\": {\n \"id\": \"Your-Subscription2-ID\",\n \"starts\": \"2022-08-27T21:47:45.000Z\"\n },\n \"timestamp\": \"2023-02-25T21:47:45.000Z\",\n \"avs_code\": \"Y\",\n \"cvn_code\": \"M\",\n \"payment_network_transaction_id\": \"CIT-TX-ID2\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"error_count": 2,
"rejected": [
{
"id": "TX_ID_1",
"errors": [
{
"code": "RETDUP2",
"message": "Duplicate transaction from prior submission"
}
]
},
{
"id": "TX_ID_2",
"errors": [
{
"code": "RETDUP",
"message": "Duplicate transaction within submission"
}
]
}
]
}{
"code": "RET400",
"message": "Invalid parameter: <bad_parm>"
}{
"code": "RET0404",
"message": "No matching results found"
}Submit Retain Transactions
Use this call to submit an array of Transactions to Vindicia Retain for processing and recovery.
Use Push Notifications to automatically listen to Transaction recovery results or proactively retrieve the list of Transactions using the Get GET /retain/transactionscall.
Accepts
Vindicia Retain accepts an array of up to 1000 Transactions per individual API call.
Submitted Transactions must include the following:
- transaction id
- amount
- currency
- timestamp
- transaction auth code
- subscription id
- customer id
- payment method id
- tokenized
- credit card - required if tokenized is set to false (0)
- cc expiration date - required if tokenized is set to false (0)
- division number
Additional input is optional but recommended for recovery:
- account holder and billing address details
- cit mit (card-on file) processor id
- cvn code
- avs code
Notes
Returns
-
All submitted Transactions undergo input validations for required fields and formats.
-
If all Transactions in the request body successfully pass the validation, Vindicia Retain responds with a 200 HTTP return code and no response body. Transactions that sucessfully pass input validations are saved and processed.
-
If some of the submitted Transactions in the request fail input validations, Vindicia Retain responds with a 207 HTTP return code and a response as described in
transaction_validation_errors. It contains an error message for each invalid Transaction listing the following:- Identifier of the Transaction
- Retain error code
- Error message indicating the reason for the validation failure.
All other transactions in the request are saved to Retain and undergo undergo an asynchronous post-submission system review to detect additional errors prior to processing.
curl --request POST \
--url https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transactions": [
{
"account": {
"id": "Your-Customer1-ID"
},
"amount": 21.64,
"auth_code": "530",
"currency": "USD",
"division_number": "349641",
"id": "Your-Failed-TX-ID1",
"payment_method": {
"credit_card": {
"account": "4111111111111111",
"expiration_date": "202301"
},
"id": "Your-PayMethod1-ID",
"account_holder": "Lily Munster",
"billing_address": {
"city": "Mockingbird Heights",
"country": "US",
"district": "CA",
"line1": "1313 Mockingbird Ln.",
"postal_code": "92415",
"line2": "Floor 13",
"line3": "Suite 13",
"county": "San Bernardino"
},
"is_tokenized": false
},
"subscription": {
"id": "Your-Subscription1-ID",
"starts": "2022-08-27T21:47:45.000Z"
},
"timestamp": "2023-02-25T21:47:45.000Z",
"metadata": {
"metadata1": "clicks-and-mortar",
"metadata2": "metrics"
},
"avs_code": "Y",
"cvn_code": "M",
"payment_network_transaction_id": "CIT-TX-ID1"
},
{
"account": {
"id": "Your-Customer2-ID"
},
"amount": 21.64,
"auth_code": "500",
"currency": "USD",
"division_number": "349641",
"id": "Your-Failed-TX-ID2",
"payment_method": {
"credit_card": {
"account": "4012888888881881",
"expiration_date": "202212"
},
"id": "Your-PayMethod2-ID",
"account_holder": "Cousin It",
"billing_address": {
"city": "Mockingbird Heights",
"country": "US",
"district": "CA",
"line1": "1313 Mockingbird Ln.",
"postal_code": "92415",
"line2": "Floor 13",
"line3": "Suite 13",
"county": "San Bernardino"
},
"is_tokenized": false
},
"subscription": {
"id": "Your-Subscription2-ID",
"starts": "2022-08-27T21:47:45.000Z"
},
"timestamp": "2023-02-25T21:47:45.000Z",
"avs_code": "Y",
"cvn_code": "M",
"payment_network_transaction_id": "CIT-TX-ID2"
}
]
}
'import requests
url = "https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/transactions"
payload = { "transactions": [
{
"account": { "id": "Your-Customer1-ID" },
"amount": 21.64,
"auth_code": "530",
"currency": "USD",
"division_number": "349641",
"id": "Your-Failed-TX-ID1",
"payment_method": {
"credit_card": {
"account": "4111111111111111",
"expiration_date": "202301"
},
"id": "Your-PayMethod1-ID",
"account_holder": "Lily Munster",
"billing_address": {
"city": "Mockingbird Heights",
"country": "US",
"district": "CA",
"line1": "1313 Mockingbird Ln.",
"postal_code": "92415",
"line2": "Floor 13",
"line3": "Suite 13",
"county": "San Bernardino"
},
"is_tokenized": False
},
"subscription": {
"id": "Your-Subscription1-ID",
"starts": "2022-08-27T21:47:45.000Z"
},
"timestamp": "2023-02-25T21:47:45.000Z",
"metadata": {
"metadata1": "clicks-and-mortar",
"metadata2": "metrics"
},
"avs_code": "Y",
"cvn_code": "M",
"payment_network_transaction_id": "CIT-TX-ID1"
},
{
"account": { "id": "Your-Customer2-ID" },
"amount": 21.64,
"auth_code": "500",
"currency": "USD",
"division_number": "349641",
"id": "Your-Failed-TX-ID2",
"payment_method": {
"credit_card": {
"account": "4012888888881881",
"expiration_date": "202212"
},
"id": "Your-PayMethod2-ID",
"account_holder": "Cousin It",
"billing_address": {
"city": "Mockingbird Heights",
"country": "US",
"district": "CA",
"line1": "1313 Mockingbird Ln.",
"postal_code": "92415",
"line2": "Floor 13",
"line3": "Suite 13",
"county": "San Bernardino"
},
"is_tokenized": False
},
"subscription": {
"id": "Your-Subscription2-ID",
"starts": "2022-08-27T21:47:45.000Z"
},
"timestamp": "2023-02-25T21:47:45.000Z",
"avs_code": "Y",
"cvn_code": "M",
"payment_network_transaction_id": "CIT-TX-ID2"
}
] }
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({
transactions: [
{
account: {id: 'Your-Customer1-ID'},
amount: 21.64,
auth_code: '530',
currency: 'USD',
division_number: '349641',
id: 'Your-Failed-TX-ID1',
payment_method: {
credit_card: {account: '4111111111111111', expiration_date: '202301'},
id: 'Your-PayMethod1-ID',
account_holder: 'Lily Munster',
billing_address: {
city: 'Mockingbird Heights',
country: 'US',
district: 'CA',
line1: '1313 Mockingbird Ln.',
postal_code: '92415',
line2: 'Floor 13',
line3: 'Suite 13',
county: 'San Bernardino'
},
is_tokenized: false
},
subscription: {id: 'Your-Subscription1-ID', starts: '2022-08-27T21:47:45.000Z'},
timestamp: '2023-02-25T21:47:45.000Z',
metadata: {metadata1: 'clicks-and-mortar', metadata2: 'metrics'},
avs_code: 'Y',
cvn_code: 'M',
payment_network_transaction_id: 'CIT-TX-ID1'
},
{
account: {id: 'Your-Customer2-ID'},
amount: 21.64,
auth_code: '500',
currency: 'USD',
division_number: '349641',
id: 'Your-Failed-TX-ID2',
payment_method: {
credit_card: {account: '4012888888881881', expiration_date: '202212'},
id: 'Your-PayMethod2-ID',
account_holder: 'Cousin It',
billing_address: {
city: 'Mockingbird Heights',
country: 'US',
district: 'CA',
line1: '1313 Mockingbird Ln.',
postal_code: '92415',
line2: 'Floor 13',
line3: 'Suite 13',
county: 'San Bernardino'
},
is_tokenized: false
},
subscription: {id: 'Your-Subscription2-ID', starts: '2022-08-27T21:47:45.000Z'},
timestamp: '2023-02-25T21:47:45.000Z',
avs_code: 'Y',
cvn_code: 'M',
payment_network_transaction_id: 'CIT-TX-ID2'
}
]
})
};
fetch('https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/transactions', 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/transactions",
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([
'transactions' => [
[
'account' => [
'id' => 'Your-Customer1-ID'
],
'amount' => 21.64,
'auth_code' => '530',
'currency' => 'USD',
'division_number' => '349641',
'id' => 'Your-Failed-TX-ID1',
'payment_method' => [
'credit_card' => [
'account' => '4111111111111111',
'expiration_date' => '202301'
],
'id' => 'Your-PayMethod1-ID',
'account_holder' => 'Lily Munster',
'billing_address' => [
'city' => 'Mockingbird Heights',
'country' => 'US',
'district' => 'CA',
'line1' => '1313 Mockingbird Ln.',
'postal_code' => '92415',
'line2' => 'Floor 13',
'line3' => 'Suite 13',
'county' => 'San Bernardino'
],
'is_tokenized' => false
],
'subscription' => [
'id' => 'Your-Subscription1-ID',
'starts' => '2022-08-27T21:47:45.000Z'
],
'timestamp' => '2023-02-25T21:47:45.000Z',
'metadata' => [
'metadata1' => 'clicks-and-mortar',
'metadata2' => 'metrics'
],
'avs_code' => 'Y',
'cvn_code' => 'M',
'payment_network_transaction_id' => 'CIT-TX-ID1'
],
[
'account' => [
'id' => 'Your-Customer2-ID'
],
'amount' => 21.64,
'auth_code' => '500',
'currency' => 'USD',
'division_number' => '349641',
'id' => 'Your-Failed-TX-ID2',
'payment_method' => [
'credit_card' => [
'account' => '4012888888881881',
'expiration_date' => '202212'
],
'id' => 'Your-PayMethod2-ID',
'account_holder' => 'Cousin It',
'billing_address' => [
'city' => 'Mockingbird Heights',
'country' => 'US',
'district' => 'CA',
'line1' => '1313 Mockingbird Ln.',
'postal_code' => '92415',
'line2' => 'Floor 13',
'line3' => 'Suite 13',
'county' => 'San Bernardino'
],
'is_tokenized' => false
],
'subscription' => [
'id' => 'Your-Subscription2-ID',
'starts' => '2022-08-27T21:47:45.000Z'
],
'timestamp' => '2023-02-25T21:47:45.000Z',
'avs_code' => 'Y',
'cvn_code' => 'M',
'payment_network_transaction_id' => 'CIT-TX-ID2'
]
]
]),
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/transactions"
payload := strings.NewReader("{\n \"transactions\": [\n {\n \"account\": {\n \"id\": \"Your-Customer1-ID\"\n },\n \"amount\": 21.64,\n \"auth_code\": \"530\",\n \"currency\": \"USD\",\n \"division_number\": \"349641\",\n \"id\": \"Your-Failed-TX-ID1\",\n \"payment_method\": {\n \"credit_card\": {\n \"account\": \"4111111111111111\",\n \"expiration_date\": \"202301\"\n },\n \"id\": \"Your-PayMethod1-ID\",\n \"account_holder\": \"Lily Munster\",\n \"billing_address\": {\n \"city\": \"Mockingbird Heights\",\n \"country\": \"US\",\n \"district\": \"CA\",\n \"line1\": \"1313 Mockingbird Ln.\",\n \"postal_code\": \"92415\",\n \"line2\": \"Floor 13\",\n \"line3\": \"Suite 13\",\n \"county\": \"San Bernardino\"\n },\n \"is_tokenized\": false\n },\n \"subscription\": {\n \"id\": \"Your-Subscription1-ID\",\n \"starts\": \"2022-08-27T21:47:45.000Z\"\n },\n \"timestamp\": \"2023-02-25T21:47:45.000Z\",\n \"metadata\": {\n \"metadata1\": \"clicks-and-mortar\",\n \"metadata2\": \"metrics\"\n },\n \"avs_code\": \"Y\",\n \"cvn_code\": \"M\",\n \"payment_network_transaction_id\": \"CIT-TX-ID1\"\n },\n {\n \"account\": {\n \"id\": \"Your-Customer2-ID\"\n },\n \"amount\": 21.64,\n \"auth_code\": \"500\",\n \"currency\": \"USD\",\n \"division_number\": \"349641\",\n \"id\": \"Your-Failed-TX-ID2\",\n \"payment_method\": {\n \"credit_card\": {\n \"account\": \"4012888888881881\",\n \"expiration_date\": \"202212\"\n },\n \"id\": \"Your-PayMethod2-ID\",\n \"account_holder\": \"Cousin It\",\n \"billing_address\": {\n \"city\": \"Mockingbird Heights\",\n \"country\": \"US\",\n \"district\": \"CA\",\n \"line1\": \"1313 Mockingbird Ln.\",\n \"postal_code\": \"92415\",\n \"line2\": \"Floor 13\",\n \"line3\": \"Suite 13\",\n \"county\": \"San Bernardino\"\n },\n \"is_tokenized\": false\n },\n \"subscription\": {\n \"id\": \"Your-Subscription2-ID\",\n \"starts\": \"2022-08-27T21:47:45.000Z\"\n },\n \"timestamp\": \"2023-02-25T21:47:45.000Z\",\n \"avs_code\": \"Y\",\n \"cvn_code\": \"M\",\n \"payment_network_transaction_id\": \"CIT-TX-ID2\"\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/transactions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transactions\": [\n {\n \"account\": {\n \"id\": \"Your-Customer1-ID\"\n },\n \"amount\": 21.64,\n \"auth_code\": \"530\",\n \"currency\": \"USD\",\n \"division_number\": \"349641\",\n \"id\": \"Your-Failed-TX-ID1\",\n \"payment_method\": {\n \"credit_card\": {\n \"account\": \"4111111111111111\",\n \"expiration_date\": \"202301\"\n },\n \"id\": \"Your-PayMethod1-ID\",\n \"account_holder\": \"Lily Munster\",\n \"billing_address\": {\n \"city\": \"Mockingbird Heights\",\n \"country\": \"US\",\n \"district\": \"CA\",\n \"line1\": \"1313 Mockingbird Ln.\",\n \"postal_code\": \"92415\",\n \"line2\": \"Floor 13\",\n \"line3\": \"Suite 13\",\n \"county\": \"San Bernardino\"\n },\n \"is_tokenized\": false\n },\n \"subscription\": {\n \"id\": \"Your-Subscription1-ID\",\n \"starts\": \"2022-08-27T21:47:45.000Z\"\n },\n \"timestamp\": \"2023-02-25T21:47:45.000Z\",\n \"metadata\": {\n \"metadata1\": \"clicks-and-mortar\",\n \"metadata2\": \"metrics\"\n },\n \"avs_code\": \"Y\",\n \"cvn_code\": \"M\",\n \"payment_network_transaction_id\": \"CIT-TX-ID1\"\n },\n {\n \"account\": {\n \"id\": \"Your-Customer2-ID\"\n },\n \"amount\": 21.64,\n \"auth_code\": \"500\",\n \"currency\": \"USD\",\n \"division_number\": \"349641\",\n \"id\": \"Your-Failed-TX-ID2\",\n \"payment_method\": {\n \"credit_card\": {\n \"account\": \"4012888888881881\",\n \"expiration_date\": \"202212\"\n },\n \"id\": \"Your-PayMethod2-ID\",\n \"account_holder\": \"Cousin It\",\n \"billing_address\": {\n \"city\": \"Mockingbird Heights\",\n \"country\": \"US\",\n \"district\": \"CA\",\n \"line1\": \"1313 Mockingbird Ln.\",\n \"postal_code\": \"92415\",\n \"line2\": \"Floor 13\",\n \"line3\": \"Suite 13\",\n \"county\": \"San Bernardino\"\n },\n \"is_tokenized\": false\n },\n \"subscription\": {\n \"id\": \"Your-Subscription2-ID\",\n \"starts\": \"2022-08-27T21:47:45.000Z\"\n },\n \"timestamp\": \"2023-02-25T21:47:45.000Z\",\n \"avs_code\": \"Y\",\n \"cvn_code\": \"M\",\n \"payment_network_transaction_id\": \"CIT-TX-ID2\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://virtserver.swaggerhub.com/Amdocs_Media/Retain_API/2024.06/retain/transactions")
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 \"transactions\": [\n {\n \"account\": {\n \"id\": \"Your-Customer1-ID\"\n },\n \"amount\": 21.64,\n \"auth_code\": \"530\",\n \"currency\": \"USD\",\n \"division_number\": \"349641\",\n \"id\": \"Your-Failed-TX-ID1\",\n \"payment_method\": {\n \"credit_card\": {\n \"account\": \"4111111111111111\",\n \"expiration_date\": \"202301\"\n },\n \"id\": \"Your-PayMethod1-ID\",\n \"account_holder\": \"Lily Munster\",\n \"billing_address\": {\n \"city\": \"Mockingbird Heights\",\n \"country\": \"US\",\n \"district\": \"CA\",\n \"line1\": \"1313 Mockingbird Ln.\",\n \"postal_code\": \"92415\",\n \"line2\": \"Floor 13\",\n \"line3\": \"Suite 13\",\n \"county\": \"San Bernardino\"\n },\n \"is_tokenized\": false\n },\n \"subscription\": {\n \"id\": \"Your-Subscription1-ID\",\n \"starts\": \"2022-08-27T21:47:45.000Z\"\n },\n \"timestamp\": \"2023-02-25T21:47:45.000Z\",\n \"metadata\": {\n \"metadata1\": \"clicks-and-mortar\",\n \"metadata2\": \"metrics\"\n },\n \"avs_code\": \"Y\",\n \"cvn_code\": \"M\",\n \"payment_network_transaction_id\": \"CIT-TX-ID1\"\n },\n {\n \"account\": {\n \"id\": \"Your-Customer2-ID\"\n },\n \"amount\": 21.64,\n \"auth_code\": \"500\",\n \"currency\": \"USD\",\n \"division_number\": \"349641\",\n \"id\": \"Your-Failed-TX-ID2\",\n \"payment_method\": {\n \"credit_card\": {\n \"account\": \"4012888888881881\",\n \"expiration_date\": \"202212\"\n },\n \"id\": \"Your-PayMethod2-ID\",\n \"account_holder\": \"Cousin It\",\n \"billing_address\": {\n \"city\": \"Mockingbird Heights\",\n \"country\": \"US\",\n \"district\": \"CA\",\n \"line1\": \"1313 Mockingbird Ln.\",\n \"postal_code\": \"92415\",\n \"line2\": \"Floor 13\",\n \"line3\": \"Suite 13\",\n \"county\": \"San Bernardino\"\n },\n \"is_tokenized\": false\n },\n \"subscription\": {\n \"id\": \"Your-Subscription2-ID\",\n \"starts\": \"2022-08-27T21:47:45.000Z\"\n },\n \"timestamp\": \"2023-02-25T21:47:45.000Z\",\n \"avs_code\": \"Y\",\n \"cvn_code\": \"M\",\n \"payment_network_transaction_id\": \"CIT-TX-ID2\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"error_count": 2,
"rejected": [
{
"id": "TX_ID_1",
"errors": [
{
"code": "RETDUP2",
"message": "Duplicate transaction from prior submission"
}
]
},
{
"id": "TX_ID_2",
"errors": [
{
"code": "RETDUP",
"message": "Duplicate transaction within submission"
}
]
}
]
}{
"code": "RET400",
"message": "Invalid parameter: <bad_parm>"
}{
"code": "RET0404",
"message": "No matching results found"
}Query Parameters
When enabled, Transactions are submitted for primary data validation only, without submitting them to Retain for processing.
0 <= x <= 1Body
Show child attributes
Show child attributes
Callbacks
POSThttps://webhook.merchant.com/pathprocessing status
Body
Show child attributes
Show child attributes
API request received, understood, and accepted, but invalid properties prevent one or more transactions from being processed by Retain.
Show child attributes
Show child attributes
{ "error_count": 2, "rejected": [ { "id": "TX_ID_1", "errors": [ { "code": "RETDUP2", "message": "Duplicate transaction from prior submission" } ] }, { "id": "TX_ID_2", "errors": [ { "code": "RETDUP", "message": "Duplicate transaction within submission" } ] } ] }
Response
Receiving server returns this code if it accepts the message
POSThttps://webhook.merchant.com/path2retry_succeeded
Response
All Transactions that were submitted to Vindicia Retain have successfully passed all input validations, without exception.
No responseBody is returned.
