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

# 查询转账

> 查询转账

完整[认证、签名、数据约定与错误响应](https://docs.stablepayfi.ai/zh/api/stablecoin-exchange/overview)。每次重试均须重新生成时间戳、nonce 与签名。

`GET /transfer/{transfer_id}` 按转账 ID 或业务参考号返回转账详情与状态。

## 请求头

**Authorization** `string` *required*

Bearer API Key。

**X-StablePay-Timestamp** `string` *required*

Unix 秒，允许与服务端相差最多 5 分钟。

**X-StablePay-Nonce** `string` *required*

每次请求唯一的随机串，16–64 字符。

**X-StablePay-Signature** `string` *required*

HMAC-SHA256 签名，小写十六进制；签名必须对应实际发送的请求体。

## 请求参数

**transfer\_id** `string` *required*

转账 ID，10 位数字

**merchant\_id** `string`

10 位数字；商户 App 不传，服务商 App 传值指定作用商户

**external\_transfer\_id** `string`

按业务参考号查询

## 响应

**transfer\_id** `string` *required*

转账 ID，10 位数字

**merchant\_id** `string` *required*

商户 ID

**external\_transfer\_id** `string`

业务参考号

**transfer\_type** `string` *required*

`on_ramp`、`off_ramp`、swap

**quote\_id** `string`

执行的报价 ID

**fiat\_deposit\_id** `string`

`on_ramp` 的充值记录

**source\_currency** `string`

卖出币种

**target\_currency** `string`

买入币种

**source\_network** `string`

卖出网络

**target\_network** `string`

买入网络

**source\_amount** `integer`

卖出金额，不含费用

**target\_amount** `integer`

买入金额；floating 下为估算

**rate\_type** `string`

fixed 或 floating

**rate** `string`

汇率，十进制字符串

**fee\_amount** `integer`

手续费

**fee\_currency** `string`

费用币种

**source\_account\_no** `string`

转出账户

**target\_account\_no** `string`

入账账户

**recipient\_id** `string`

收款人 ID

**recipient** `object`

地址与 memo 或银行字段

**status** `string` *required*

processing、`payment_submitted`、completed、`funds_refunded`、`bounced_back`

**failure\_reason** `string`

失败原因

**metadata** `object`

自定义元数据

**created** `integer` *required*

创建时间

**updated** `integer`

最近更新时间

## 状态与错误

404 转账不存在或不属于目标商户。

状态机：processing（处理中）→ `payment_submitted`（资金链路已发出）→ completed（完成）；终态还包括 `funds_refunded`（退回）与 `bounced_back`（拒收退回），失败原因写在 `failure_reason`。状态变化通过 Webhook 推送 transfer.\* 事件，也可通过转账查询接口轮询。

```bash cURL theme={"system"}
curl --request GET \
  --url "https://api.stablepay.co/api/v1/transfer/{transfer_id}" \
  --header "Authorization: Bearer <API_KEY>" \
  --header "X-StablePay-Timestamp: <TIMESTAMP>" \
  --header "X-StablePay-Nonce: <NONCE>" \
  --header "X-StablePay-Signature: <SIGNATURE>"
```

```javascript JavaScript theme={"system"}
const response = await fetch("https://api.stablepay.co/api/v1/transfer/{transfer_id}", {
  method: "GET",
  headers: {
    "Authorization": "Bearer <API_KEY>",
    "X-StablePay-Timestamp": "<TIMESTAMP>",
    "X-StablePay-Nonce": "<NONCE>",
    "X-StablePay-Signature": "<SIGNATURE>"
  }
});
console.log(await response.json());
```

```json 200 theme={"system"}
{
  "transfer_id": "9000000011",
  "merchant_id": "2000000001",
  "transfer_type": "on_ramp",
  "quote_id": "9000000017",
  "fiat_deposit_id": "9000000090",
  "source_amount": 100500,
  "target_amount": 100479,
  "rate_type": "fixed",
  "rate": "0.9998",
  "fee_amount": 5,
  "fee_currency": "USD",
  "target_account_no": "00000001",
  "status": "processing",
  "created": 1718726400
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.