Retrieve a refund
curl --request GET \
--url https://api-sandbox.uqpaytech.com/api/v2/payment/refunds/{id} \
--header 'x-auth-token: <api-key>' \
--header 'x-client-id: <x-client-id>'import requests
url = "https://api-sandbox.uqpaytech.com/api/v2/payment/refunds/{id}"
headers = {
"x-client-id": "<x-client-id>",
"x-auth-token": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-client-id': '<x-client-id>', 'x-auth-token': '<api-key>'}
};
fetch('https://api-sandbox.uqpaytech.com/api/v2/payment/refunds/{id}', 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-sandbox.uqpaytech.com/api/v2/payment/refunds/{id}",
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-auth-token: <api-key>",
"x-client-id: <x-client-id>"
],
]);
$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-sandbox.uqpaytech.com/api/v2/payment/refunds/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-client-id", "<x-client-id>")
req.Header.Add("x-auth-token", "<api-key>")
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-sandbox.uqpaytech.com/api/v2/payment/refunds/{id}")
.header("x-client-id", "<x-client-id>")
.header("x-auth-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.uqpaytech.com/api/v2/payment/refunds/{id}")
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-auth-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"payment_refund_id": "RF123456789",
"payment_attempt_id": "PA123456789",
"amount": "10.01",
"currency": "USD",
"refund_status": "SUCCEEDED",
"create_time": "2024-03-01T00:00:00+08:00",
"update_time": "2024-03-01T00:00:00+08:00",
"reason": "Order 1234 has been returned",
"metadata": {
"customer_id": "cust_12345",
"order_id": "order_6789"
}
}Payment Refunds
Retrieve a refund
按 ID 查询指定退款的详细信息
GET
/
v2
/
payment
/
refunds
/
{id}
Retrieve a refund
curl --request GET \
--url https://api-sandbox.uqpaytech.com/api/v2/payment/refunds/{id} \
--header 'x-auth-token: <api-key>' \
--header 'x-client-id: <x-client-id>'import requests
url = "https://api-sandbox.uqpaytech.com/api/v2/payment/refunds/{id}"
headers = {
"x-client-id": "<x-client-id>",
"x-auth-token": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-client-id': '<x-client-id>', 'x-auth-token': '<api-key>'}
};
fetch('https://api-sandbox.uqpaytech.com/api/v2/payment/refunds/{id}', 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-sandbox.uqpaytech.com/api/v2/payment/refunds/{id}",
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-auth-token: <api-key>",
"x-client-id: <x-client-id>"
],
]);
$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-sandbox.uqpaytech.com/api/v2/payment/refunds/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-client-id", "<x-client-id>")
req.Header.Add("x-auth-token", "<api-key>")
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-sandbox.uqpaytech.com/api/v2/payment/refunds/{id}")
.header("x-client-id", "<x-client-id>")
.header("x-auth-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.uqpaytech.com/api/v2/payment/refunds/{id}")
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-auth-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"payment_refund_id": "RF123456789",
"payment_attempt_id": "PA123456789",
"amount": "10.01",
"currency": "USD",
"refund_status": "SUCCEEDED",
"create_time": "2024-03-01T00:00:00+08:00",
"update_time": "2024-03-01T00:00:00+08:00",
"reason": "Order 1234 has been returned",
"metadata": {
"customer_id": "cust_12345",
"order_id": "order_6789"
}
}授权
UQPAY 提供的登录 API Token。
请求头
UQPAY 生成的 API 客户端 ID
路径参数
要查询的退款 ID
示例:
"RF1234567890123456789"
响应
200 - application/json
成功获取退款详情
退款的唯一标识
示例:
"RF123456789"
已退款的 PaymentAttempt 的 ID
示例:
"PA123456789"
已退款的金额
示例:
"10.01"
三字母币种代码(ISO 4217)
示例:
"USD"
退款的当前状态。
INITIATED:退款已发起。PROCESSING:退款正在处理中。SUCCEEDED:退款已成功完成。FAILED:退款尝试失败。REVERSAL_INITIATED:退款的冲正已发起。REVERSAL_PROCESSING:退款的冲正正在处理中。REVERSAL_SUCCEEDED:退款的冲正已成功完成。
可用选项:
INITIATED, PROCESSING, SUCCEEDED, FAILED, REVERSAL_INITIATED, REVERSAL_PROCESSING, REVERSAL_SUCCEEDED 示例:
"SUCCEEDED"
该退款的创建时间。
示例:
"2024-03-01T00:00:00+08:00"
该退款最近一次更新或操作的时间。
示例:
"2024-03-01T00:00:00+08:00"
退款原因
Maximum string length:
100示例:
"Order 1234 has been returned"
与退款关联的附加元数据。用户自定义的键值对。
Show child attributes
Show child attributes
示例:
{ "customer_id": "cust_12345", "order_id": "order_6789" }

