交易錯誤碼
當訂單未通過驗證,或因帳戶、市場、業務規則等限制被阻擋時,交易 API 會返回這些錯誤碼。請根據這些錯誤碼理解與排查訂單被拒原因。
錯誤碼參考
所有 API 非 2xx 狀態碼的回應均遵循標準 JSON 錯誤格式:
json
{
"code": 11030103,
"message": "The product code is invalid or unrecognized."
}| 欄位名稱 | 類型 | 說明 |
|---|---|---|
code | int | 業務專用錯誤碼(非零表示錯誤) |
message | string | 人類可讀的錯誤訊息(英文) |
參數驗證錯誤
| 錯誤碼 | 訊息 | 說明 |
|---|---|---|
| 11030101 | Invalid Parameter BSFlag | 買賣方向參數無效 |
| 11030102 | Invalid Parameter Type | 訂單型態不支援或格式錯誤 |
| 11030103 | Invalid Parameter ProductCode | 產品代碼無效或不存在 |
| 11030104 | Invalid Parameter Price | 價格格式錯誤或超出範圍 |
| 11030105 | Invalid Parameter Qty | 數量無效 |
| 11030111 | Invalid Parameter TriggerPrice | 觸發價無效 |
| 11030301 | Invalid Parameter Market | 市場無效 |
| 11030304 | Invalid Parameter Ratio | 比例無效 |
| 11030106 | Qty and Amount cannot be zero | 數量和金额不不能為零 |
| 11030107 | Qty must be greater than or equal to 1 | 數量必須大於等於 1 |
| 11030110 | Qty must be greater than 1 | 數量必須大於 1 |
| 11030108 | Oddlot Order Qty Range Between 0 and | 碎股單數量範圍在0和{value}之間 |
| 11030109 | Oddlot Order Qty Accuracy | 碎股單數量精度是 |
| 11030201 | OrderNo, Reference cannot be empty at the same time | 訂單號和第三方ID不能同時爲空 |
| 11030203 | OrderNo, Reference is an invalid order number | 訂單號和第三方ID無效 |
| 11030501 | OrderNo cannot be empty | 訂單號不能為空 |
| 11030601 | StartTime cannot be empty | 開始時間不能為空 |
| 11030203 | EndTime cannot be empty | 結束時間不能為空 |
訂單時段限制
| 錯誤碼 | 訊息 | 說明 |
|---|---|---|
| 11030124 | This product is prohibited from buying and selling | 當前產品禁止買賣 |
| 11030125 | MarketOrder is not available | 市價單不可用 |
| 11030202 | Frequent cancellation of orders | 取消訂單過於頻繁 |
| 11030204 | Order status cannot be cancelled | 當前訂單狀態不可取消 |
帳戶權限錯誤
| 錯誤碼 | 訊息 | 說明 |
|---|---|---|
| 11030117 | Account Not Permitted to Buy in This Market | 帳戶無權在此市場買入產品 |
| 11030118 | Account Not Permitted to Buy | 此帳戶禁止買入操作 |
| 11030122 | Account Not Permitted to Sell in This Market | 帳戶無權在此市場賣出產品 |
| 11030123 | Account Not Permitted to Sell | 此帳戶禁止賣出操作 |
| 11030135 | Account Not Permitted to Trade This Product | 帳戶無權交易此產品 |
市場驗證錯誤
| 錯誤碼 | 訊息 | 說明 |
|---|---|---|
| 11030113 | Market Closed | 市場目前未開放交易 |
| 11030114 | Security Type Trading Limit | 此類證券交易受限 |
| 11030115 | Order type is prohibited at the current time | 当前时间禁止该订单类型 |
| 11030116 | Product Type Limited Day Trading | 产品类型限日交易 |
| 11030119 | Product prohibited from trading | 产品禁止交易 |
| 11030120 | Product Type Restrictions | 产品类型限制交易 |
| 11030121 | Order type is prohibited at the current time | 当前时间禁止该订单类型 |
| 11030126 | Self-Match Prevention | 不允許自成交 |
| 11030130 | Product Suspended | 該產品已暫停交易 |
| 11030131 | Product Not Tradable | 該產品目前不可交易 |
| 11030132 | Product Not Found | 查無此產品代碼 |
業務規則驗證錯誤
| 錯誤碼 | 訊息 | 說明 |
|---|---|---|
| 11030127 | Insufficient Sellable Quantity | 可賣出數量不足 |
| 11030129 | Insufficient Funds | 帳戶可用資金不足 |

