> ## 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 与 Global Account 之间转账

> 在 Stablecoin Account 与 UQPAY Global Account 之间双向划转法币。

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

转账在 UQPAY 的两套账户体系之间划转**法币**：\*\*转出（transfer out）\*\*把资金从 Stablecoin Account 划到 Global Account，\*\*转入（transfer in）\*\*把资金从 Global Account 划到 Stablecoin Account。它与充值、兑换、出款一起构成完整闭环：加密货币入账 → 兑换 → 转出 → 从 Global Account 出款（入金客户则反向操作）。

<h2 id="create-a-transfer">
  创建转账
</h2>

调用 [Create Transfer](/zh/stablecoin-account/v1.6/api-reference/create-transfer)，传入币种、金额和方向：

```bash theme={null}
curl -X POST https://api-sandbox.uqpaytech.com/api/v1/ramp/transfer \
  -H "x-auth-token: YOUR_API_TOKEN" \
  -H "x-idempotency-key: $(uuidgen | tr '[:upper:]' '[:lower:]')" \
  -H "Content-Type: application/json" \
  -d '{
    "currency": "USD",
    "amount": "100.50",
    "type": 4001,
    "reason": "Business transfer"
  }'
```

| 字段         |  必填 | 描述                                                                                                 |
| ---------- | :-: | -------------------------------------------------------------------------------------------------- |
| `currency` |  是  | 转账的法币币种，例如 `USD`                                                                                   |
| `amount`   |  是  | 金额，十进制字符串                                                                                          |
| `type`     |  是  | 方向：`4001` 为转出（Stablecoin Account → Global Account）；`4000` 为转入（Global Account → Stablecoin Account） |
| `reason`   |  否  | 交易备注                                                                                               |

**响应：**

```json theme={null}
{
  "code": 200,
  "message": "Success",
  "data": {
    "order_id": "3c9e22ba-7b5e-4b7c-b92e-197d0406b86b",
    "short_order_id": "TO260123-JZBHC9IA",
    "order_status": "Pending",
    "order_type": "Transfer Out",
    "amount": 100,
    "currency": "USD",
    "processing_fee": 0,
    "reason": "testAPI",
    "create_time": "2026-01-23 13:12:27 +08:00",
    "complete_time": ""
  }
}
```

如果订单在提交时失败，`data` 中的 `message` 字段会携带失败原因。

<h2 id="track-the-transfer">
  跟踪转账
</h2>

转账状态从 `Submitted` / `Pending` 流转到 `Success`、`Failed` 或 `Submit Failed`。更新通过[转账 webhook](/zh/stablecoin-account/v1.6/webhooks/transfer) 推送：

| 事件类型                             | 含义      |
| -------------------------------- | ------- |
| `ramp.transfer.submitted`        | 转账请求已提交 |
| `ramp.transfer.pending`          | 转账进行中   |
| `ramp.transfer.success`          | 转账已完成   |
| `ramp.transfer.failed`           | 转账失败    |
| `ramp.transfer.submitted.failed` | 转账提交失败  |

用长 `order_id` 通过 [Retrieve Transfer](/zh/stablecoin-account/v1.6/api-reference/retrieve-transfer) 查询单个订单。转账也会以 `Transfer In` / `Transfer Out` 出现在统一流水中 —— 参见[管理资产余额](/zh/stablecoin-account/v1.6/guide/manage-asset-balances)。

<Tip>
  转出完成后，资金即可在你的 Global Account 中使用 —— 后续操作参见 [Global Account 指南](/zh/global-account/v1.6/guide/overview)。
</Tip>

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

* [Create Transfer API](/zh/stablecoin-account/v1.6/api-reference/create-transfer)
* [Retrieve Transfer API](/zh/stablecoin-account/v1.6/api-reference/retrieve-transfer)
* [转账 webhook](/zh/stablecoin-account/v1.6/webhooks/transfer)
* [货币兑换](/zh/stablecoin-account/v1.6/guide/convert-currencies) —— 转出前先把加密货币兑换成法币
