> ## Documentation Index
> Fetch the complete documentation index at: https://developers.uqpay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 管理资产余额

> 查询各币种的钱包余额，并查看统一的交易流水。

[Stablecoin Account API 发布方声明](/zh/stablecoin-account/v1.6/guide/stablecoin-account-api-publisher-disclaimer)

你持有的每个币种 —— 无论加密货币还是法币 —— 都对应一个带 `balance_id` 的钱包。钱包在你首次收到该币种时自动创建，没有单独的创建钱包接口。使用 Assets 相关接口读取余额，并核对余额背后的交易明细。

<h2 id="list-all-balances">
  查询全部余额
</h2>

调用 [List Assets](/zh/stablecoin-account/v1.6/api-reference/list-assets) 分页遍历账户下的所有钱包。只需要部分结果时，可按 `balance_currency` 或 `balance_status`（`Pending`、`Active`、`Closed`）过滤。

```bash theme={null}
curl "https://api-sandbox.uqpaytech.com/api/v1/ramp/asset?page_size=10&page_num=1&balance_status=Active" \
  -H "x-auth-token: YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
```

**响应（节选）：**

```json theme={null}
{
  "code": 200,
  "message": "Success",
  "data": {
    "data": [
      {
        "balance_id": "5e56e5de-f354-4570-8cbc-cc134d7a5b75",
        "balance_currency": "USDC",
        "balance_status": "Active",
        "available_balance": "9100",
        "margin_balance": "0",
        "frozen_balance": "0",
        "create_time": "2025-06-30 17:03:06 +08:00",
        "last_trade_time": "2025-10-24 17:51:24 +08:00"
      }
    ],
    "total_pages": 1,
    "total_items": 1
  }
}
```

只有 `available_balance` 可以支配。被在途提现、兑换或风控审核占用的资金会留在 `frozen_balance` 中，直到订单结束。

<h2 id="retrieve-one-balance">
  查询单个余额
</h2>

已知币种时，可用 [Retrieve Asset](/zh/stablecoin-account/v1.6/api-reference/retrieve-asset) 直接获取：

```bash theme={null}
curl "https://api-sandbox.uqpaytech.com/api/v1/ramp/asset/USDC" \
  -H "x-auth-token: YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
```

响应返回单个资产对象，字段与列表接口一致。

<h2 id="review-transaction-history">
  查看交易流水
</h2>

[List Asset Transactions](/zh/stablecoin-account/v1.6/api-reference/list-asset-transactions) 返回一份覆盖所有订单类型的统一流水 —— 充值、提现、兑换（`Sell` / `Buy` / `Swap`）与转账 —— 无需分别调用各资源的列表接口即可完成余额对账。

```bash theme={null}
curl "https://api-sandbox.uqpaytech.com/api/v1/ramp/asset/transactions?page_size=10&page_num=1&order_type=WITHDRAW&order_status=SUCCESS" \
  -H "x-auth-token: YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
```

常用过滤参数：

| 参数                        | 取值                                                                    |
| ------------------------- | --------------------------------------------------------------------- |
| `order_type`              | `DEPOSIT`、`WITHDRAW`、`SELL`、`BUY`、`SWAP`、`TRANSFER_IN`、`TRANSFER_OUT` |
| `order_status`            | `SUBMIT_FAILED`、`FAILED`、`PENDING`、`SUCCESS`、`SUBMITTED`              |
| `balance_currency`        | 钱包币种，例如 `USDT`                                                        |
| `order_id`                | 长 `order_id` 或 `short_order_id`                                       |
| `start_time` / `end_time` | 对 `create_time` 的 ISO 8601 边界（开区间）                                    |

每条流水会给出卖出侧（`sell_currency` / `sell_amount`）、兑换时的买入侧（`buy_currency` / `buy_amount`），以及收取的费用（`network_fee`、`processing_fee`）。

<Tip>
  如需流水行之外的明细 —— 例如提现的目标地址或交易哈希 —— 请用 `order_id` 到订单所属资源查询：[Retrieve Deposit](/zh/stablecoin-account/v1.6/api-reference/retrieve-deposit)、[Retrieve Withdraw](/zh/stablecoin-account/v1.6/api-reference/retrieve-withdraw)、[Retrieve Conversion](/zh/stablecoin-account/v1.6/api-reference/retrieve-conversion) 或 [Retrieve Transfer](/zh/stablecoin-account/v1.6/api-reference/retrieve-transfer)。
</Tip>

<h2 id="related">
  相关页面
</h2>

* [List Assets API](/zh/stablecoin-account/v1.6/api-reference/list-assets)
* [List Asset Transactions API](/zh/stablecoin-account/v1.6/api-reference/list-asset-transactions)
* [核心概念](/zh/stablecoin-account/v1.6/guide/core-concepts) —— 订单类型与状态
* [支持的资产与网络](/zh/stablecoin-account/v1.6/guide/supported-assets-and-networks)
