交易紀錄
此端點用於查詢用戶帳戶的現金交易紀錄,包括存款、提領、成交結算、手續費及幣別兌換。支援依日期、資金流向、業務類型等條件篩選。適用於帳戶對帳、報表及個人理財追蹤。
📨 HTTP 請求
bash
GET /account/v1/transactions📥 查詢參數
| 參數 | 類型 | 必填 | 說明 | 範例值 |
|---|---|---|---|---|
page | int | 否 | 當前頁碼 | 預設 1 |
page_size | int | 否 | 每頁筆數 | 預設 20 |
business_type | enum | 否 | 依業務類型篩選 | hk_stock、us_stock、other,詳見 business_type 枚舉 |
io_type | enum | 否 | 依資金流向篩選 | in、out,詳見 io_type 枚舉 |
from_date | long | 否 | 查詢區間起始日期(Unix 時間戳) | 1746775317 |
to_date | long | 否 | 查詢區間結束日期(Unix 時間戳) | 1746775317 |
✅ 成功回應
回應欄位
| 欄位 | 類型 | 說明 |
|---|---|---|
id | int | 交易紀錄 ID |
account_id | int | 帳戶 ID |
tran_type | enum | 交易類型(詳見 tran_type 枚舉) |
date | long | 交易日期(Unix 時間戳) |
sett_date | long | 結算日期(Unix 時間戳) |
base_currency | string | 幣種代碼 |
market | enum | 市場代碼(詳見 market 枚舉) |
product_code | string | 證券/產品代碼 |
product_name | string | 證券/產品名稱 |
price | decimal | 單位價格 |
qty | decimal | 數量 |
amt | decimal | 交易金額 |
balance | decimal | 交易後帳戶餘額 |
io_type | enum | 資金流向(詳見 io_type 枚舉) |
fx_currency | string | 外幣幣種 |
fx_amt | decimal | 外幣金額 |
fx_rate | decimal | 匯率 |
remarks | string | 備註 |
business_type | enum | 業務類型(詳見 business_type 枚舉) |
business_sub_type | enum | 業務子類型(詳見 business_sub_type 枚舉) |
❌ 錯誤回應
錯誤欄位
| 欄位 | 類型 | 說明 |
|---|---|---|
code | int | 錯誤代碼 |
message | string | 錯誤訊息(人類可讀) |
details | string | 其他錯誤資訊 |
💡 cURL 範例
curl -X GET "https://{{base_url}}/account/v1/transactions?page=1&page_size=20&from_date=1746775317&to_date=1746775257&io_type=in&business_types=us_stock" \
-H "X-API-Key: YOUR_API_KEY" \
-H "X-API-Timestamp: 1345678912312" \
-H "X-API-Signature: YOUR_GENERATED_SIGNATURE" \
-H "Content-Type: application/json"✅ 成功回應範例
json
{
"code": 0,
"data": {
"total_records": 1,
"page": 1,
"page_size": 20,
"transactions": [
{
"id": 0,
"tran_type": "cash",
"date": 1746775317,
"sett_date": 1746775317,
"base_currency": "USD",
"market": "usex",
"product_code": "AAPL",
"product_name": "Apple Inc.",
"price": 150.0,
"qty": 10,
"amt": 1500.0,
"balance": 8500.0,
"io_type": "out",
"fx_ccy": "USD",
"fx_amt": 1500.0,
"fx_rate": 1.0,
"remarks": "股票交易",
"business_type": "us_stock",
"business_sub_type": "not"
}
]
}
}❌ 錯誤回應範例
json
{
"code": 12010012,
"message": "Internal server error"
}
