Skip to main content
GET
/
api
/
v2
/
subscriptions
/
refund-details
Get Subscription Refund Details
curl --request GET \
  --url https://sandbox.cashfree.com/api/v2/subscriptions/refund-details \
  --header 'X-Client-Id: <x-client-id>' \
  --header 'X-Client-Secret: <x-client-secret>'
import requests

url = "https://sandbox.cashfree.com/api/v2/subscriptions/refund-details"

headers = {
    "X-Client-Id": "<x-client-id>",
    "X-Client-Secret": "<x-client-secret>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {
  method: 'GET',
  headers: {'X-Client-Id': '<x-client-id>', 'X-Client-Secret': '<x-client-secret>'}
};

fetch('https://sandbox.cashfree.com/api/v2/subscriptions/refund-details', 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/refund-details",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  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/refund-details"

	req, _ := http.NewRequest("GET", 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.get("https://sandbox.cashfree.com/api/v2/subscriptions/refund-details")
  .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/refund-details")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Client-Id"] = '<x-client-id>'
request["X-Client-Secret"] = '<x-client-secret>'

response = http.request(request)
puts response.read_body
{ "refundId": 12, "subReferenceId": 123, "paymentId": 12344, "subRefundId": "SUB_john194d4", "refundAmount": 1, "refundNote": "", "refundType": "AUTH", "refundStatus": "PENDING", "addedOn": "2023-10-16 16:24:57" }

Headers

X-Client-Id
string
required

Client ID provided by Cashfree.

Example:

"asdf1234"

X-Client-Secret
string
required

Client Secret provided by Cashfree.

Example:

"qwer9876"

Query Parameters

paymentId
string

Payment ID for which refund details are to be fetched.

Example:

"12344"

merchantRefundId
string

Merchant Refund ID for which refund details are to be fetched.

Example:

"test-refund"

Response

Successful retrieval of refund details.