已完成訂單的歷史記錄

get https://api.cryptomus.com/v2/user-api/exchange/orders/history 複製

要求

查詢參數

姓名參數類型定義
marketstring按交易對過濾(例如“TRX_USDT”)
directionstring按方向過濾可用選項:• buy• sell
order_idstring按訂單簿中的訂單 ID 進行過濾
client_order_idstring按客戶訂單 ID 過濾
limitstring設定請求將傳回的最大記錄數的特殊參數
offsetstring指示要跳過的記錄數的特殊參數

參數類型

string

定義

按交易對過濾(例如“TRX_USDT”)

參數類型

string

定義

按方向過濾可用選項:- buy- sell

參數類型

string

定義

按訂單簿中的訂單 ID 進行過濾

參數類型

string

定義

按客戶訂單 ID 過濾

參數類型

string

定義

設定請求將傳回的最大記錄數的特殊參數

參數類型

string

定義

指示要跳過的記錄數的特殊參數

回覆

訂單響應參數

姓名參數類型定義
idstring訂單簿中的訂單ID
typestring訂單類型可用選項:• buy• sell
directionstring訂單方向可用選項:• buy• sell
symbolstring按交易對過濾(例如“TRX_USDT”)
quantitystring|null基礎資產請求數量
filledQuantitystring基礎資產成交數量
filledValuestring報價資產成交數量
statestring訂單的當前狀態(例如“已完成”)
internalStatestring訂單的內部狀態(例如「已完成」)
createdAtstring訂單創建時間
finishedAtstring訂單完成時間
stopLossPricestring|null資產的門檻市場價格,達到該價格後訂單將自動取消

參數類型

string

定義

訂單簿中的訂單ID

參數類型

string

定義

訂單類型可用選項:- buy- sell

參數類型

string

定義

訂單方向可用選項:- buy- sell

參數類型

string

定義

按交易對過濾(例如“TRX_USDT”)

參數類型

string|null

定義

基礎資產請求數量

參數類型

string

定義

基礎資產成交數量

參數類型

string

定義

報價資產成交數量

參數類型

string

定義

訂單的當前狀態(例如“已完成”)

參數類型

string

定義

訂單的內部狀態(例如「已完成」)

參數類型

string

定義

訂單創建時間

參數類型

string

定義

訂單完成時間

參數類型

string|null

定義

資產的門檻市場價格,達到該價格後訂單將自動取消

交易回應參數

姓名參數類型定義
idstring交易編號
statestring交易狀態(例如「已完成」)
createdAtstring交易創建時間
completedAtstring交易完成時間
averageFilledPricestring交易的平均成交價格

參數類型

string

定義

交易編號

參數類型

string

定義

交易狀態(例如「已完成」)

參數類型

string

定義

交易創建時間

參數類型

string

定義

交易完成時間

參數類型

string

定義

交易的平均成交價格

成交交易響應參數

姓名參數類型定義
idstring交易 ID
tradeRolestring在貿易中的作用可用選項:• taker• maker
filledPricestring交易成交價格
filledQuantitystring以基礎貨幣計算的執行金額
filledValuestring以報價貨幣計算的成交金額
feestring交易費
feeCurrencystring收取費用的貨幣
committedAtstring交易執行時間

參數類型

string

定義

交易 ID

參數類型

string

定義

在貿易中的作用可用選項:- taker- maker

參數類型

string

定義

交易成交價格

參數類型

string

定義

以基礎貨幣計算的執行金額

參數類型

string

定義

以報價貨幣計算的成交金額

參數類型

string

定義

交易費

參數類型

string

定義

收取費用的貨幣

參數類型

string

定義

交易執行時間

回應範例


1{
2    "result": [
3        {
4            "id": "01JEXAPY04JDFBVFC2D23BCKMK",
5            "type": "market",
6            "direction": "sell",
7            "symbol": "TRX_USDT",
8            "quantity": "67.5400000000000000",
9            "filledQuantity": "67.5400000000000000",
10            "filledValue": "20.0053480000000000",
11            "state": "completed",
12            "internalState": "filled",
13            "createdAt": "2024-12-12 11:40:19",
14            "finishedAt": "2024-12-12 11:40:21",
15            "deal": {
16                "id": "01JEXAPZ9C9TWENPFZJASZ1YD2",
17                "state": "completed",
18                "createdAt": "2024-12-12 11:40:21",
19                "completedAt": "2024-12-12 11:40:21",
20                "averageFilledPrice": "0.2962000000000000",
21                "transactions": [
22                    {
23                        "id": "01JEXAPZ9C9TWENPFZJASZ1YD3",
24                        "tradeRole": "taker",
25                        "filledPrice": "0.2962000000000000",
26                        "filledQuantity": "67.5400000000000000",
27                        "filledValue": "20.0053480000000000",
28                        "fee": "0.0000000000000000",
29                        "feeCurrency": "USDT",
30                        "committedAt": "2024-12-12 11:40:21"
31                    }
32                ]
33            }
34        },
35        {
36            "id": "01JEXAJDK51C453Z3395RTAY8Y",
37            "type": "market",
38            "direction": "buy",
39            "symbol": "TRX_USDT",
40            "value": "20.0000000000000000",
41            "filledQuantity": "67.5400000000000000",
42            "filledValue": "19.9985940000000000",
43            "state": "completed",
44            "internalState": "filled",
45            "createdAt": "2024-12-12 11:37:51",
46            "finishedAt": "2024-12-12 11:37:53",
47            "deal": {
48                "id": "01JEXAJF41RJ05Z220F2H01S9Z",
49                "state": "completed",
50                "createdAt": "2024-12-12 11:37:53",
51                "completedAt": "2024-12-12 11:37:53",
52                "averageFilledPrice": "0.2961000000000000",
53                "transactions": [
54                    {
55                        "id": "01JEXAJF4ADPPPVH3NVP2SFX0F",
56                        "tradeRole": "taker",
57                        "filledPrice": "0.2961000000000000",
58                        "filledQuantity": "67.5400000000000000",
59                        "filledValue": "19.9985940000000000",
60                        "fee": "0.0000000000000000",
61                        "feeCurrency": "TRX",
62                        "committedAt": "2024-12-12 11:37:53"
63                    }
64                ]
65            }
66        },
67        {
68            "id": "01JEXAFCCC5ZVJPZAAHHDKQBNG",
69            "type": "limit",
70            "direction": "sell",
71            "symbol": "TRX_USDT",
72            "price": "0.2964000000000000",
73            "quantity": "20.0000000000000000",
74            "value": "5.9280000000000000",
75            "filledQuantity": "20.0000000000000000",
76            "filledValue": "5.9280000000000000",
77            "state": "completed",
78            "internalState": "filled",
79            "createdAt": "2024-12-12 11:36:12",
80            "finishedAt": "2024-12-12 11:36:22",
81            "deal": {
82                "id": "01JEXAFP50QGFS8CGY2YRR5EDV",
83                "state": "completed",
84                "createdAt": "2024-12-12 11:36:22",
85                "completedAt": "2024-12-12 11:36:22",
86                "averageFilledPrice": "0.2964000000000000",
87                "transactions": [
88                    {
89                        "id": "01JEXAFP55H5XHF3SHRVCEQ1G9",
90                        "tradeRole": "taker",
91                        "filledPrice": "0.2964000000000000",
92                        "filledQuantity": "20.0000000000000000",
93                        "filledValue": "5.9280000000000000",
94                        "fee": "0.0000000000000000",
95                        "feeCurrency": "USDT",
96                        "committedAt": "2024-12-12 11:36:22"
97                    }
98                ]
99            }
100        }
101    ]
102}
103      
複製

可能的程式碼

404:未找到使用者或資源

422:無效的輸入數據

500:內部伺服器錯誤

可能的組合

姓名定義內部狀態
completed訂單已完成並全部填寫已填滿
canceled訂單未成交,被用戶取消空的
canceled_by_stop_loss訂單未成交,因市場達到停損價自動取消空的
canceled訂單已部分成交,然後被用戶取消部分填充
canceled_by_stop_loss訂單部分成交後,因市場達到停損價而自動取消部分填充

定義

訂單已完成並全部填寫

定義

訂單未成交,被用戶取消

定義

訂單未成交,因市場達到停損價自動取消

定義

訂單已部分成交,然後被用戶取消

定義

訂單部分成交後,因市場達到停損價而自動取消

可能的錯誤

範例回覆:


1{
2  "state": 0,
3  "message": "Standard validation error"
4}
複製

錯誤回應範例


1{
2  "code": 0,
3  "message": "Validation failed.",
4  "errors": [
5    {
6      "property": "direction",
7      "value": "sells",
8      "message": "The value you selected is not a valid choice."
9    }
10  ]
11}
複製