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:• buy• sell
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

NameParameter typeDefinition
idstringOrder ID in the order book
typestringOrder typeAvailable options:• buy• sell
directionstringOrder directionAvailable options:• buy• sell
symbolstringFilter by trading pair (e.g., `TRX_USDT`)
quantitystring|nullRequested quantity of the base asset
filledQuantitystringFilled quantity of base asset
filledValuestringFilled quantity of quote asset
statestringCurrent state of the order (e.g., 'completed')
internalStatestringInternal state of the order (e.g., 'filled')
createdAtstringTime when the order was created
finishedAtstringTime when the order was completed
stopLossPricestring|nullThe threshold market price of the asset, upon reaching which the order will be automatically canceled

Parameter type

string

Definition

Order ID in the order book

Parameter type

string

Definition

Order typeAvailable options:- buy- sell

Parameter type

string

Definition

Order directionAvailable options:- buy- sell

Parameter type

string

Definition

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

Parameter type

string|null

Definition

Requested quantity of the base asset

Parameter type

string

Definition

Filled quantity of base asset

Parameter type

string

Definition

Filled quantity of quote asset

Parameter type

string

Definition

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

Parameter type

string

Definition

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

Parameter type

string

Definition

Time when the order was created

Parameter type

string

Definition

Time when the order was completed

Parameter type

string|null

Definition

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

Deal response parameters

NameParameter typeDefinition
idstringTrade id
statestringTrade state (e.g., `completed`)
createdAtstringTime when the trade was created
completedAtstringTime when the trade was completed
averageFilledPricestringAverage filled price for the trade

Parameter type

string

Definition

Trade id

Parameter type

string

Definition

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

Parameter type

string

Definition

Time when the trade was created

Parameter type

string

Definition

Time when the trade was completed

Parameter type

string

Definition

Average filled price for the trade

Deal transaction response parameters

NameParameter typeDefinition
idstringTransaction id
tradeRolestringRole in the tradeAvailable options:• taker• maker
filledPricestringFilled price for the transaction
filledQuantitystringExecuted amount in the base currency
filledValuestringExecuted amount in the quote currency
feestringTransaction fee
feeCurrencystringCurrency in which the fee is charged
committedAtstringTime of transaction execution

Parameter type

string

Definition

Transaction id

Parameter type

string

Definition

Role in the tradeAvailable options:- taker- maker

Parameter type

string

Definition

Filled price for the transaction

Parameter type

string

Definition

Executed amount in the base currency

Parameter type

string

Definition

Executed amount in the quote currency

Parameter type

string

Definition

Transaction fee

Parameter type

string

Definition

Currency in which the fee is charged

Parameter type

string

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