History of completed orders
get
https://api.cryptomus.com/v2/user-api/exchange/orders/history
Request
Query parameters
Name | Parameter type | Definition |
---|---|---|
market | string | Filter by trading pair (e.g., `TRX_USDT`) |
direction | string | Filter by directionAvailable options:• buy• sell |
order_id | string | Filter by order ID in the order book |
client_order_id | string | Filter by client order ID |
limit | string | A special parameter that sets the maximum number of records the request will return |
offset | string | A special parameter that indicates the number of records to skip |
Parameter type
stringDefinition
Filter by trading pair (e.g., `TRX_USDT`)Parameter type
stringDefinition
Filter by directionAvailable options:- buy- sellParameter type
stringDefinition
Filter by order ID in the order bookParameter type
stringDefinition
Filter by client order IDParameter type
stringDefinition
A special parameter that sets the maximum number of records the request will returnParameter type
stringDefinition
A special parameter that indicates the number of records to skip
Response
Order response parameters
Name | Definition |
---|---|
id | Order ID in the order book |
type | Order typeAvailable options:• buy• sell |
direction | Order directionAvailable options:• buy• sell |
symbol | Filter by trading pair (e.g., `TRX_USDT`) |
quantity | Requested quantity of the base asset |
filledQuantity | Filled quantity of base asset |
filledValue | Filled quantity of quote asset |
state | Current state of the order (e.g., 'completed') |
internalState | Internal state of the order (e.g., 'filled') |
createdAt | Time when the order was created |
finishedAt | Time when the order was completed |
stopLossPrice | The threshold market price of the asset, upon reaching which the order will be automatically canceled |
Definition
Order ID in the order bookDefinition
Order typeAvailable options:- buy- sellDefinition
Order directionAvailable options:- buy- sellDefinition
Filter by trading pair (e.g., `TRX_USDT`)Definition
Requested quantity of the base assetDefinition
Filled quantity of base assetDefinition
Filled quantity of quote assetDefinition
Current state of the order (e.g., 'completed')Definition
Internal state of the order (e.g., 'filled')Definition
Time when the order was createdDefinition
Time when the order was completedDefinition
The threshold market price of the asset, upon reaching which the order will be automatically canceled
Deal response parameters
Name | Definition |
---|---|
id | Trade id |
state | Trade state (e.g., `completed`) |
createdAt | Time when the trade was created |
completedAt | Time when the trade was completed |
averageFilledPrice | Average filled price for the trade |
Definition
Trade idDefinition
Trade state (e.g., `completed`)Definition
Time when the trade was createdDefinition
Time when the trade was completedDefinition
Average filled price for the trade
Deal transaction response parameters
Name | Definition |
---|---|
id | Transaction id |
tradeRole | Role in the tradeAvailable options:• taker• maker |
filledPrice | Filled price for the transaction |
filledQuantity | Executed amount in the base currency |
filledValue | Executed amount in the quote currency |
fee | Transaction fee |
feeCurrency | Currency in which the fee is charged |
committedAt | Time of transaction execution |
Definition
Transaction idDefinition
Role in the tradeAvailable options:- taker- makerDefinition
Filled price for the transactionDefinition
Executed amount in the base currencyDefinition
Executed amount in the quote currencyDefinition
Transaction feeDefinition
Currency in which the fee is chargedDefinition
Time of transaction execution
Response example
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
COPYPossible codes
404: User or resource not found
422: Invalid input data
500: Internal server error
Possible combinations
Name | Definition | internal_state |
---|---|---|
completed | The order is completed and fully filled | filled |
canceled | The order was not filled and was canceled by the user | empty |
canceled_by_stop_loss | The order was not filled and was automatically canceled due to the market reaching the stop_loss price | empty |
canceled | The order was partially filled and then canceled by the user | partially_filled |
canceled_by_stop_loss | The order was partially filled and then automatically canceled due to the market reaching the stop_loss price | partially_filled |
Definition
The order is completed and fully filledDefinition
The order was not filled and was canceled by the userDefinition
The order was not filled and was automatically canceled due to the market reaching the stop_loss priceDefinition
The order was partially filled and then canceled by the userDefinition
The order was partially filled and then automatically canceled due to the market reaching the stop_loss price
Possible errors
Example responses:
1{
2 "state": 0,
3 "message": "Standard validation error"
4}
COPYResponse example with error
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}
COPY