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

# API 回應格式

> QFPay API 標準回應結構與欄位說明。

所有 QFPay API 均以 JSON 格式回傳資料。

標準回應結構如下：

```json JSON theme={null}
{
  "respcd": "0000",
  "respmsg": "success",
  "data": {
    "txamt": "100",
    "out_trade_no": "20231101000001",
    "txcurrcd": "HKD",
    "pay_type": "800101",
    "txdtm": "2023-11-01 10:00:00"
  }
}
```

***

# 回應欄位說明

| 欄位 | 類型 | 說明 |
| - | - | - |
| `respcd` | String(4) | API 層級回應代碼。`0000` 表示請求處理成功；其他代碼表示錯誤。 |
| `respmsg` | String(64) | 對應 `respcd` 的文字說明。 |
| `data` | Object | 業務資料物件。實際欄位依 API 類型而定。 |

***

| 欄位 | 類型 | 說明 |
| - | - | - |
| `txamt` | String | 交易金額（以分為單位）。 |
| `out_trade_no` | String | 商戶交易編號。 |
| `txcurrcd` | String | 貨幣代碼（例如 HKD）。 |
| `pay_type` | String | 支付方式代碼。 |
| `txdtm` | String | 交易時間（格式：`YYYY-MM-DD HH:mm:ss`）。 |

***

# 狀態判斷說明

<Note>
  `respcd = 0000` 表示 API 請求成功處理。

  實際交易結果應依 `respmsg 及 data` 内文判斷。
</Note>

範例：

* `respcd = 0000` 且 `respmsg = Success` → 交易成功

***

# 回應簽名驗證

在關鍵系統整合場景中，建議驗證回應 Header 中的簽名（若存在），以確保資料完整性。

回應可能包含以下 Header：

* `X-QF-SIGN`
* `X-QF-SIGNTYPE`

***

## 驗證流程

1. 依欄位名稱升冪排序 `data` 物件中的所有欄位。
2. 組合為字串格式：


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