cURL
curl --request GET \
--url https://api.xpaycheckout.com/payments/refunds/{intentId} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.xpaycheckout.com/payments/refunds/{intentId}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.xpaycheckout.com/payments/refunds/{intentId}', 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://api.xpaycheckout.com/payments/refunds/{intentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$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://api.xpaycheckout.com/payments/refunds/{intentId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.xpaycheckout.com/payments/refunds/{intentId}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xpaycheckout.com/payments/refunds/{intentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body[
{
"refundId": "rf_fooBOwYsaK50AEaJ",
"intentId": "in_fooBOwYsaK50AEfK",
"amount": 2000,
"currency": "USD",
"refundedAt": 1727340330123,
"refundReferenceId": "re123"
}
]{
"errorCode": "bad_request",
"errorDescription": "Failed to read request"
}Payments
Get Refunds of an Intent
Retrieve a list of refunds for a specific payment intent
GET
/
payments
/
refunds
/
{intentId}
cURL
curl --request GET \
--url https://api.xpaycheckout.com/payments/refunds/{intentId} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.xpaycheckout.com/payments/refunds/{intentId}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.xpaycheckout.com/payments/refunds/{intentId}', 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://api.xpaycheckout.com/payments/refunds/{intentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$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://api.xpaycheckout.com/payments/refunds/{intentId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.xpaycheckout.com/payments/refunds/{intentId}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xpaycheckout.com/payments/refunds/{intentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body[
{
"refundId": "rf_fooBOwYsaK50AEaJ",
"intentId": "in_fooBOwYsaK50AEfK",
"amount": 2000,
"currency": "USD",
"refundedAt": 1727340330123,
"refundReferenceId": "re123"
}
]{
"errorCode": "bad_request",
"errorDescription": "Failed to read request"
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
Unique identifier of the payment intent
Response
Successful response with list of refunds
Unique identifier of the refund
Example:
"rf_fooBOwYsaK50AEaJ"
Unique identifier of the payment intent
Example:
"in_fooBOwYsaK50AEfK"
The amount in lowest count unit. e.g.: For USD 1, amount is 100 representing 100 cents (The minimum amount should be greater than 1 USD)
Example:
2000
Three letter abbreviation of the currency. Refer supported currencies
Example:
"USD"
Epoch timestamp in milliseconds of when the refund was processed
Example:
1727340330123
Your identifier for the refund
Example:
"re123"
Was this page helpful?