Limit order creation
The limit order will be executed when the specified price is reached
post
https://api.cryptomus.com/v2/user-api/exchange/orders
Request
Query parameters
Name | Parameter type | Definition |
---|---|---|
market* | string | Designation of available trading pair (e.g. `TRX_USDT`) |
quantity* | string | Quantity in base_currency |
price* | string | Limit price for order execution in quote_currency |
direction* | string | Order typeAvailable options:• buy• sell |
stop_loss_price | string | The threshold market price of the asset, upon reaching which the order will be automatically canceled |
client_order_id | string | Unique identifier created by the client |
tag | string | Broker Tag |
Parameter type
stringDefinition
Designation of available trading pair (e.g. `TRX_USDT`)Parameter type
stringDefinition
Quantity in base_currencyParameter type
stringDefinition
Limit price for order execution in quote_currencyParameter type
stringDefinition
Order typeAvailable options:- buy- sellParameter type
stringDefinition
The threshold market price of the asset, upon reaching which the order will be automatically canceledParameter type
stringDefinition
Unique identifier created by the clientParameter type
stringDefinition
Broker Tag
* - mandatory parameter
Request example
{
"market": "TRX_USDT",
"quantity": "20",
"price": "0.2964",
"direction": "buy",
"stop_loss_price": "0.31"
}
COPYPossible codes
200: The order was successfully created
404: User or resource not found
422: Invalid input data
500: Internal server error
Response example
1{
2 "order_id": "01JEXAFCCC5ZVJPZAAHHDKQBNG"
3}
COPYPossible errors
Example responses:
1{
2 "state": 1,
3 "message": "Market validation error"
4}
COPY
1{
2 "state": 2,
3 "message": "Incorrect amount or price accuracy"
4}
COPY
1{
2 "state": 3,
3 "message": "Order amount is out of acceptable ranges"
4}
COPY
1{
2 "state": 4,
3 "message": "Stop Loss order price error"
4}
COPY
1{
2 "state": 6,
3 "message": "Insufficient balance"
4}
COPY
1{
2 "state": 7,
3 "message": "client_order_id error"
4}
COPY
1{
2 "state": 0,
3 "message": "Standard validation error"
4}
COPYResponse example with error
1{
2 "code": 4,
3 "message": "Stop-loss price must be higher than order price"
4}
COPY