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
COPY

Request

Query parameters

NameParameter typeDefinition
market*stringDesignation of available trading pair (e.g. `TRX_USDT`)
quantity*stringQuantity in base_currency
price*stringLimit price for order execution in quote_currency
direction*stringOrder typeAvailable options:buysell
stop_loss_pricestringThe threshold market price of the asset, upon reaching which the order will be automatically canceled
client_order_idstringUnique identifier created by the client
tagstringBroker Tag

Parameter type

string

Definition

Designation of available trading pair (e.g. `TRX_USDT`)

Parameter type

string

Definition

Quantity in base_currency

Parameter type

string

Definition

Limit price for order execution in quote_currency

Parameter type

string

Definition

Order typeAvailable options:- buy- sell

Parameter type

string

Definition

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

Parameter type

string

Definition

Unique identifier created by the client

Parameter type

string

Definition

Broker Tag

* - mandatory parameter

Request example


{
  "market": "TRX_USDT",
  "quantity": "20",
  "price": "0.2964",
  "direction": "buy",
  "stop_loss_price": "0.31"
}
COPY

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

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

Response example with error


1{
2  "code": 4,
3  "message": "Stop-loss price must be higher than order price"
4}
COPY