Retrieve Issuing Balance
curl --request POST \
--url https://api-sandbox.uqpaytech.com/api/v1/issuing/balances \
--header 'Content-Type: application/json' \
--header 'x-auth-token: <api-key>' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"currency": "USD"
}
'import requests
url = "https://api-sandbox.uqpaytech.com/api/v1/issuing/balances"
payload = { "currency": "USD" }
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"x-auth-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-idempotency-key': '<x-idempotency-key>',
'x-auth-token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({currency: 'USD'})
};
fetch('https://api-sandbox.uqpaytech.com/api/v1/issuing/balances', 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/issuing/balances",
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([
'currency' => 'USD'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-auth-token: <api-key>",
"x-idempotency-key: <x-idempotency-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://api-sandbox.uqpaytech.com/api/v1/issuing/balances"
payload := strings.NewReader("{\n \"currency\": \"USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
req.Header.Add("x-auth-token", "<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://api-sandbox.uqpaytech.com/api/v1/issuing/balances")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("x-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.uqpaytech.com/api/v1/issuing/balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-idempotency-key"] = '<x-idempotency-key>'
request["x-auth-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"balance_id": "72970a7c-7921-431c-b95f-3438724ba16f",
"currency": "USD",
"available_balance": 5000.25,
"margin_balance": 10000,
"frozen_balance": 2353.25,
"create_time": "2024-03-21T17:17:32+08:00",
"last_trade_time": "2024-03-21T17:17:32+08:00",
"balance_status": "ACTIVE"
}Balances
Retrieve Issuing Balance
根据发起请求所用的身份认证,查询当前账户余额。
POST
/
v1
/
issuing
/
balances
Retrieve Issuing Balance
curl --request POST \
--url https://api-sandbox.uqpaytech.com/api/v1/issuing/balances \
--header 'Content-Type: application/json' \
--header 'x-auth-token: <api-key>' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"currency": "USD"
}
'import requests
url = "https://api-sandbox.uqpaytech.com/api/v1/issuing/balances"
payload = { "currency": "USD" }
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"x-auth-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-idempotency-key': '<x-idempotency-key>',
'x-auth-token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({currency: 'USD'})
};
fetch('https://api-sandbox.uqpaytech.com/api/v1/issuing/balances', 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/issuing/balances",
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([
'currency' => 'USD'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-auth-token: <api-key>",
"x-idempotency-key: <x-idempotency-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://api-sandbox.uqpaytech.com/api/v1/issuing/balances"
payload := strings.NewReader("{\n \"currency\": \"USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
req.Header.Add("x-auth-token", "<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://api-sandbox.uqpaytech.com/api/v1/issuing/balances")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("x-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.uqpaytech.com/api/v1/issuing/balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-idempotency-key"] = '<x-idempotency-key>'
request["x-auth-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"balance_id": "72970a7c-7921-431c-b95f-3438724ba16f",
"currency": "USD",
"available_balance": 5000.25,
"margin_balance": 10000,
"frozen_balance": 2353.25,
"create_time": "2024-03-21T17:17:32+08:00",
"last_trade_time": "2024-03-21T17:17:32+08:00",
"balance_status": "ACTIVE"
}授权
由 UQPay 提供的登录 API Token。
请求头
指定代表哪个子账户发起请求。应设置为 account_id,该值可通过 List Connected Accounts 接口获取。若省略或为空,则请求以主账户身份执行。
更多信息参见 关联账户。
用于维持操作幂等性的唯一标识符(UUID),确保同一操作的重复执行不会产生意外影响或重复。它有助于在网络错误、重试或失败的情况下保持数据一致性。
请求体
application/json
账户余额的币种。
示例:
"USD"
响应
200 - application/json
成功返回余额。
账户余额 id。
示例:
"72970a7c-7921-431c-b95f-3438724ba16f"
账户余额的币种。
示例:
"USD"
可用余额。
示例:
5000.25
保证金余额。
示例:
10000
冻结余额。
示例:
2353.25
对象的创建时间。
示例:
"2024-03-21T17:17:32+08:00"
对象最后一次更新的交易时间。
示例:
"2024-03-21T17:17:32+08:00"
账户的余额状态。
可用选项:
ACTIVE, PENDING, PROCESSING, CLOSED 示例:
"ACTIVE"
⌘I

