History of completed orders

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

Request

Query parameters

NameParameter typeDefinition
marketstringFilter by trading pair (e.g., `TRX_USDT`)
directionstringFilter by directionAvailable options:buysell
order_idstringFilter by order ID in the order book
client_order_idstringFilter by client order ID
limitstringA special parameter that sets the maximum number of records the request will return
offsetstringA special parameter that indicates the number of records to skip

Parameter type

string

Definition

Filter by trading pair (e.g., `TRX_USDT`)

Parameter type

string

Definition

Filter by directionAvailable options:- buy- sell

Parameter type

string

Definition

Filter by order ID in the order book

Parameter type

string

Definition

Filter by client order ID

Parameter type

string

Definition

A special parameter that sets the maximum number of records the request will return

Parameter type

string

Definition

A special parameter that indicates the number of records to skip

Response

Order response parameters

NameDefinition
idOrder ID in the order book
typeOrder typeAvailable options:buysell
directionOrder directionAvailable options:buysell
symbolFilter by trading pair (e.g., `TRX_USDT`)
quantityRequested quantity of the base asset
filledQuantityFilled quantity of base asset
filledValueFilled quantity of quote asset
stateCurrent state of the order (e.g., 'completed')
internalStateInternal state of the order (e.g., 'filled')
createdAtTime when the order was created
finishedAtTime when the order was completed
stopLossPriceThe threshold market price of the asset, upon reaching which the order will be automatically canceled

Definition

Order ID in the order book

Definition

Order typeAvailable options:- buy- sell

Definition

Order directionAvailable options:- buy- sell

Definition

Filter by trading pair (e.g., `TRX_USDT`)

Definition

Requested quantity of the base asset

Definition

Filled quantity of base asset

Definition

Filled quantity of quote asset

Definition

Current state of the order (e.g., 'completed')

Definition

Internal state of the order (e.g., 'filled')

Definition

Time when the order was created

Definition

Time when the order was completed

Definition

The threshold market price of the asset, upon reaching which the order will be automatically canceled

Deal response parameters

NameDefinition
idTrade id
stateTrade state (e.g., `completed`)
createdAtTime when the trade was created
completedAtTime when the trade was completed
averageFilledPriceAverage filled price for the trade

Definition

Trade id

Definition

Trade state (e.g., `completed`)

Definition

Time when the trade was created

Definition

Time when the trade was completed

Definition

Average filled price for the trade

Deal transaction response parameters

NameDefinition
idTransaction id
tradeRoleRole in the tradeAvailable options:takermaker
filledPriceFilled price for the transaction
filledQuantityExecuted amount in the base currency
filledValueExecuted amount in the quote currency
feeTransaction fee
feeCurrencyCurrency in which the fee is charged
committedAtTime of transaction execution

Definition

Transaction id

Definition

Role in the tradeAvailable options:- taker- maker

Definition

Filled price for the transaction

Definition

Executed amount in the base currency

Definition

Executed amount in the quote currency

Definition

Transaction fee

Definition

Currency in which the fee is charged

Definition

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      
COPY

Possible codes

404: User or resource not found

422: Invalid input data

500: Internal server error

Possible combinations

NameDefinitioninternal_state
completedThe order is completed and fully filledfilled
canceledThe order was not filled and was canceled by the userempty
canceled_by_stop_lossThe order was not filled and was automatically canceled due to the market reaching the stop_loss priceempty
canceledThe order was partially filled and then canceled by the userpartially_filled
canceled_by_stop_lossThe order was partially filled and then automatically canceled due to the market reaching the stop_loss pricepartially_filled

Definition

The order is completed and fully filled

Definition

The order was not filled and was canceled by the user

Definition

The order was not filled and was automatically canceled due to the market reaching the stop_loss price

Definition

The order was partially filled and then canceled by the user

Definition

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}
COPY

Response 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