Market order creation

post
https://api.cryptomus.com/v2/user-api/exchange/orders/market
COPY

Request

Query parameters

NameParameter typeDefinition
market*stringDesignation of available trading pair (e.g. `TRX_USDT`)
quantity*stringQuantity in base_currency
value*stringLimit price for order execution in quote_currency
direction*stringOrder typeAvailable options:buysell
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

Unique identifier created by the client

Parameter type

string

Definition

Broker Tag

* - mandatory parameter

Request example


curl https://api.cryptomus.com/v2/user-api/exchange/orders/market \
  -X POST \
  -H 'userId: 8b03432e-385b-4670-8d06-064591096795' \
  -H 'sign: fe99035f86fa436181717b302b95bacff1' \
  -H 'Content-Type: application/json' \
  -d '{
    "market": "TRX_USDT",
    "quantity": "100",
    "direction": "sell"
  }'
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": 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  "state": 3,
3  "message": "Order quantity must be between 10 and 10000000000 size."
4}
COPY