curl --request POST \
--url https://sandbox.hyperswitch.io/refunds/list \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"payment_id": "<string>",
"refund_id": "<string>",
"profile_id": "<string>",
"limit": 50,
"offset": 10000,
"amount_filter": {
"start_amount": 123,
"end_amount": 123
},
"connector": [
"<string>"
],
"merchant_connector_id": [
"<string>"
],
"currency": [],
"refund_status": []
}
'import requests
url = "https://sandbox.hyperswitch.io/refunds/list"
payload = {
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"payment_id": "<string>",
"refund_id": "<string>",
"profile_id": "<string>",
"limit": 50,
"offset": 10000,
"amount_filter": {
"start_amount": 123,
"end_amount": 123
},
"connector": ["<string>"],
"merchant_connector_id": ["<string>"],
"currency": [],
"refund_status": []
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z',
payment_id: '<string>',
refund_id: '<string>',
profile_id: '<string>',
limit: 50,
offset: 10000,
amount_filter: {start_amount: 123, end_amount: 123},
connector: ['<string>'],
merchant_connector_id: ['<string>'],
currency: [],
refund_status: []
})
};
fetch('https://sandbox.hyperswitch.io/refunds/list', 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.hyperswitch.io/refunds/list",
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([
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z',
'payment_id' => '<string>',
'refund_id' => '<string>',
'profile_id' => '<string>',
'limit' => 50,
'offset' => 10000,
'amount_filter' => [
'start_amount' => 123,
'end_amount' => 123
],
'connector' => [
'<string>'
],
'merchant_connector_id' => [
'<string>'
],
'currency' => [
],
'refund_status' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$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://sandbox.hyperswitch.io/refunds/list"
payload := strings.NewReader("{\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"payment_id\": \"<string>\",\n \"refund_id\": \"<string>\",\n \"profile_id\": \"<string>\",\n \"limit\": 50,\n \"offset\": 10000,\n \"amount_filter\": {\n \"start_amount\": 123,\n \"end_amount\": 123\n },\n \"connector\": [\n \"<string>\"\n ],\n \"merchant_connector_id\": [\n \"<string>\"\n ],\n \"currency\": [],\n \"refund_status\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
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://sandbox.hyperswitch.io/refunds/list")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"payment_id\": \"<string>\",\n \"refund_id\": \"<string>\",\n \"profile_id\": \"<string>\",\n \"limit\": 50,\n \"offset\": 10000,\n \"amount_filter\": {\n \"start_amount\": 123,\n \"end_amount\": 123\n },\n \"connector\": [\n \"<string>\"\n ],\n \"merchant_connector_id\": [\n \"<string>\"\n ],\n \"currency\": [],\n \"refund_status\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hyperswitch.io/refunds/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"payment_id\": \"<string>\",\n \"refund_id\": \"<string>\",\n \"profile_id\": \"<string>\",\n \"limit\": 50,\n \"offset\": 10000,\n \"amount_filter\": {\n \"start_amount\": 123,\n \"end_amount\": 123\n },\n \"connector\": [\n \"<string>\"\n ],\n \"merchant_connector_id\": [\n \"<string>\"\n ],\n \"currency\": [],\n \"refund_status\": []\n}"
response = http.request(request)
puts response.read_body{
"count": 1,
"total_count": 123,
"data": [
{
"refund_id": "<string>",
"payment_id": "<string>",
"amount": 6540,
"currency": "<string>",
"status": "succeeded",
"connector": "stripe",
"reason": "<string>",
"metadata": {},
"error_message": "<string>",
"error_code": "<string>",
"unified_code": "<string>",
"unified_message": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"profile_id": "<string>",
"merchant_connector_id": "<string>",
"split_refunds": {
"stripe_split_refund": {
"revert_platform_fee": true,
"revert_transfer": true
}
},
"issuer_error_code": "<string>",
"issuer_error_message": "<string>",
"raw_connector_response": "<string>",
"connector_refund_id": "<string>"
}
]
}Refunds - List
Lists all the refunds associated with the merchant, or for a specific payment if payment_id is provided
curl --request POST \
--url https://sandbox.hyperswitch.io/refunds/list \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"payment_id": "<string>",
"refund_id": "<string>",
"profile_id": "<string>",
"limit": 50,
"offset": 10000,
"amount_filter": {
"start_amount": 123,
"end_amount": 123
},
"connector": [
"<string>"
],
"merchant_connector_id": [
"<string>"
],
"currency": [],
"refund_status": []
}
'import requests
url = "https://sandbox.hyperswitch.io/refunds/list"
payload = {
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"payment_id": "<string>",
"refund_id": "<string>",
"profile_id": "<string>",
"limit": 50,
"offset": 10000,
"amount_filter": {
"start_amount": 123,
"end_amount": 123
},
"connector": ["<string>"],
"merchant_connector_id": ["<string>"],
"currency": [],
"refund_status": []
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z',
payment_id: '<string>',
refund_id: '<string>',
profile_id: '<string>',
limit: 50,
offset: 10000,
amount_filter: {start_amount: 123, end_amount: 123},
connector: ['<string>'],
merchant_connector_id: ['<string>'],
currency: [],
refund_status: []
})
};
fetch('https://sandbox.hyperswitch.io/refunds/list', 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.hyperswitch.io/refunds/list",
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([
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z',
'payment_id' => '<string>',
'refund_id' => '<string>',
'profile_id' => '<string>',
'limit' => 50,
'offset' => 10000,
'amount_filter' => [
'start_amount' => 123,
'end_amount' => 123
],
'connector' => [
'<string>'
],
'merchant_connector_id' => [
'<string>'
],
'currency' => [
],
'refund_status' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$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://sandbox.hyperswitch.io/refunds/list"
payload := strings.NewReader("{\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"payment_id\": \"<string>\",\n \"refund_id\": \"<string>\",\n \"profile_id\": \"<string>\",\n \"limit\": 50,\n \"offset\": 10000,\n \"amount_filter\": {\n \"start_amount\": 123,\n \"end_amount\": 123\n },\n \"connector\": [\n \"<string>\"\n ],\n \"merchant_connector_id\": [\n \"<string>\"\n ],\n \"currency\": [],\n \"refund_status\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
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://sandbox.hyperswitch.io/refunds/list")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"payment_id\": \"<string>\",\n \"refund_id\": \"<string>\",\n \"profile_id\": \"<string>\",\n \"limit\": 50,\n \"offset\": 10000,\n \"amount_filter\": {\n \"start_amount\": 123,\n \"end_amount\": 123\n },\n \"connector\": [\n \"<string>\"\n ],\n \"merchant_connector_id\": [\n \"<string>\"\n ],\n \"currency\": [],\n \"refund_status\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hyperswitch.io/refunds/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"payment_id\": \"<string>\",\n \"refund_id\": \"<string>\",\n \"profile_id\": \"<string>\",\n \"limit\": 50,\n \"offset\": 10000,\n \"amount_filter\": {\n \"start_amount\": 123,\n \"end_amount\": 123\n },\n \"connector\": [\n \"<string>\"\n ],\n \"merchant_connector_id\": [\n \"<string>\"\n ],\n \"currency\": [],\n \"refund_status\": []\n}"
response = http.request(request)
puts response.read_body{
"count": 1,
"total_count": 123,
"data": [
{
"refund_id": "<string>",
"payment_id": "<string>",
"amount": 6540,
"currency": "<string>",
"status": "succeeded",
"connector": "stripe",
"reason": "<string>",
"metadata": {},
"error_message": "<string>",
"error_code": "<string>",
"unified_code": "<string>",
"unified_message": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"profile_id": "<string>",
"merchant_connector_id": "<string>",
"split_refunds": {
"stripe_split_refund": {
"revert_platform_fee": true,
"revert_transfer": true
}
},
"issuer_error_code": "<string>",
"issuer_error_message": "<string>",
"raw_connector_response": "<string>",
"connector_refund_id": "<string>"
}
]
}Authorizations
Use the API key created under your merchant account from the HyperSwitch dashboard. API key is used to authenticate API requests from your merchant server only. Don't expose this key on a website or embed it in a mobile application.
Body
A type representing a range of time for filtering, including a mandatory start time and an optional end time.
The start time to filter payments list or to get list of filters. To get list of filters start time is needed to be passed
The end time to filter payments list or to get list of filters. If not passed the default time is now
The identifier for the payment
The identifier for the refund
The identifier for business profile
1 <= x <= 1000 <= x <= 20000Show child attributes
Show child attributes
The list of connectors to filter refunds list
The list of merchant connector ids to filter the refunds list for selected label
The list of currencies to filter refunds list
The three-letter ISO 4217 currency code (e.g., "USD", "EUR") for the payment amount. This field is mandatory for creating a payment.
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL The list of refund statuses to filter refunds list
The status for refunds
succeeded, failed, pending, review Was this page helpful?