Generate Transaction Return Summary
curl --request POST \
--url https://sandbox.cashfree.com/api/v2/subscriptions/charge/{paymentId}/transaction-return-summary/generate \
--header 'X-Client-Id: <x-client-id>' \
--header 'X-Client-Secret: <x-client-secret>'import requests
url = "https://sandbox.cashfree.com/api/v2/subscriptions/charge/{paymentId}/transaction-return-summary/generate"
headers = {
"X-Client-Id": "<x-client-id>",
"X-Client-Secret": "<x-client-secret>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Client-Id': '<x-client-id>', 'X-Client-Secret': '<x-client-secret>'}
};
fetch('https://sandbox.cashfree.com/api/v2/subscriptions/charge/{paymentId}/transaction-return-summary/generate', 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://sandbox.cashfree.com/api/v2/subscriptions/charge/{paymentId}/transaction-return-summary/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Client-Id: <x-client-id>",
"X-Client-Secret: <x-client-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.cashfree.com/api/v2/subscriptions/charge/{paymentId}/transaction-return-summary/generate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Client-Id", "<x-client-id>")
req.Header.Add("X-Client-Secret", "<x-client-secret>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.cashfree.com/api/v2/subscriptions/charge/{paymentId}/transaction-return-summary/generate")
.header("X-Client-Id", "<x-client-id>")
.header("X-Client-Secret", "<x-client-secret>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/api/v2/subscriptions/charge/{paymentId}/transaction-return-summary/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-Id"] = '<x-client-id>'
request["X-Client-Secret"] = '<x-client-secret>'
response = http.request(request)
puts response.read_body{
"status": 200,
"message": "Transaction return summary status fetched successfully.",
"data": {
"paymentId": 123456,
"status": "GENERATED",
"link": "<download-link>"
}
}Subscription
Generate Transaction Return Summary
Use this API to generate transaction return summary for failed transactions (insufficient balance). You will have to hit the API again to check the status of the transaction return summary, or go to the Merchant Dashboard and download the same.
POST
/
api
/
v2
/
subscriptions
/
charge
/
{paymentId}
/
transaction-return-summary
/
generate
Generate Transaction Return Summary
curl --request POST \
--url https://sandbox.cashfree.com/api/v2/subscriptions/charge/{paymentId}/transaction-return-summary/generate \
--header 'X-Client-Id: <x-client-id>' \
--header 'X-Client-Secret: <x-client-secret>'import requests
url = "https://sandbox.cashfree.com/api/v2/subscriptions/charge/{paymentId}/transaction-return-summary/generate"
headers = {
"X-Client-Id": "<x-client-id>",
"X-Client-Secret": "<x-client-secret>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Client-Id': '<x-client-id>', 'X-Client-Secret': '<x-client-secret>'}
};
fetch('https://sandbox.cashfree.com/api/v2/subscriptions/charge/{paymentId}/transaction-return-summary/generate', 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://sandbox.cashfree.com/api/v2/subscriptions/charge/{paymentId}/transaction-return-summary/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Client-Id: <x-client-id>",
"X-Client-Secret: <x-client-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.cashfree.com/api/v2/subscriptions/charge/{paymentId}/transaction-return-summary/generate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Client-Id", "<x-client-id>")
req.Header.Add("X-Client-Secret", "<x-client-secret>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.cashfree.com/api/v2/subscriptions/charge/{paymentId}/transaction-return-summary/generate")
.header("X-Client-Id", "<x-client-id>")
.header("X-Client-Secret", "<x-client-secret>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/api/v2/subscriptions/charge/{paymentId}/transaction-return-summary/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-Id"] = '<x-client-id>'
request["X-Client-Secret"] = '<x-client-secret>'
response = http.request(request)
puts response.read_body{
"status": 200,
"message": "Transaction return summary status fetched successfully.",
"data": {
"paymentId": 123456,
"status": "GENERATED",
"link": "<download-link>"
}
}Headers
Client ID provided by Cashfree.
Example:
"asdf1234"
Client Secret provided by Cashfree.
Example:
"qwer9876"
Path Parameters
The ID of the payment whose transaction return summary is to be generated.
Example:
123456
Response
Successful generation of the transaction return summary.
Was this page helpful?
āI