List Current Rates
curl --request GET \
--url https://api-sandbox.uqpaytech.com/api/v1/exchange/rates \
--header 'x-auth-token: <api-key>'import requests
url = "https://api-sandbox.uqpaytech.com/api/v1/exchange/rates"
headers = {"x-auth-token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-auth-token': '<api-key>'}};
fetch('https://api-sandbox.uqpaytech.com/api/v1/exchange/rates', 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/v1/exchange/rates",
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>"
],
]);
$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/v1/exchange/rates"
req, _ := http.NewRequest("GET", url, nil)
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/v1/exchange/rates")
.header("x-auth-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.uqpaytech.com/api/v1/exchange/rates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-auth-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"rates": [
{
"buy_price": "0.8766",
"sell_price": "0.8837",
"currency_pair": "USDEUR"
}
],
"unavailable_currency_pairs": [
"JPYKRW"
],
"last_updated": "2023-11-07T05:31:56Z"
}
}Exchange Rates
List Current Rates
获取一个或多个指定货币对的最新汇率。返回的汇率反映 UQPAY 实际适用的换汇汇率。
使用说明
-
如果未提供
currency_pairs,将返回所有可用货币对的汇率。 -
如果请求包含不受支持的货币对,它们将列在响应的
unavailable_currency_pairs字段中。
GET
/
v1
/
exchange
/
rates
List Current Rates
curl --request GET \
--url https://api-sandbox.uqpaytech.com/api/v1/exchange/rates \
--header 'x-auth-token: <api-key>'import requests
url = "https://api-sandbox.uqpaytech.com/api/v1/exchange/rates"
headers = {"x-auth-token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-auth-token': '<api-key>'}};
fetch('https://api-sandbox.uqpaytech.com/api/v1/exchange/rates', 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/v1/exchange/rates",
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>"
],
]);
$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/v1/exchange/rates"
req, _ := http.NewRequest("GET", url, nil)
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/v1/exchange/rates")
.header("x-auth-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.uqpaytech.com/api/v1/exchange/rates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-auth-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"rates": [
{
"buy_price": "0.8766",
"sell_price": "0.8837",
"currency_pair": "USDEUR"
}
],
"unavailable_currency_pairs": [
"JPYKRW"
],
"last_updated": "2023-11-07T05:31:56Z"
}
}授权
由 UQPay 提供的登录 API Token。
查询参数
以逗号分隔的待查询货币对字符串。每个货币对必须为 6 位大写字母代码(如 USDEUR、USDJPY)。
可提供多个货币对,以逗号分隔,最多 100 个。
示例:
"USDEUR,USDJPY"
响应
200 - application/json
OK —— 成功获取当前汇率列表。
Show child attributes
Show child attributes
⌘I

